Odoo13将于2019年10月发布,本次发布也包含了大量的改进,例如,对存货核算的重构。
去掉了 产品历史价格product.price.history ,增加了 stock valuation layer 对象,重写了 存货计价的逻辑
具体提交记录如下:

[REF] stock_account: standard cost method with valuation layers

Valuation of standard move: We introduce _create_in_svl and
_create_out_svl and call these method in _action_done only on the
standard move, the other valuation methods still use the old code. We
hijack _account_entry_move to create journal entries anyway for the
valuation layer with a minimal diff. Helpers for the valuation layers
creation are added on the product because we will need to create similar
layer without stock move later on when we'll implement changes of cost
method. We also make a first implementation of the edition in the past
to make some tests pass, it will be completed with other cost method
implementation

Change of standard price: Before this commit, the wizard to change the
standard price was only displayed in perpetual, because it was used to
create accountign entries. We also use this wizard in manual now,
because we want to create a stock valuation layer. Fortunetaly, the
accounting fields of this wizard are not required if the product has a
manual valuation. And the new method is private.

We adapt the existing tests as well as we can and include the start of a
new battery of tests: test_stockvaluationlayer.py

task-1875873

[REF] stock_account: average cost method with valuation layers

One of the goal of this refactoring is also to run the vacuum when the
cost method is AVCO. This will be used allow already out landed cost
on AVCO and also to have a consistent value when going into negative.

We update _prepare_in_svl_vals to set the remaining_qty field that
will be used when fifo is implemented. On the stock move, we create the
layer in with the real price unit of the move and adapt
product_price_update_before_done. This method will now compute the AVCO
according to the quantity valued in stock (quantity_svl) instead of all
the quantities in stock (qty_available), which was wrong (qty_available
could contain consigned quants).

We also make sure to recompute the avco when editing a done move.

We don't implement yet the negative handling as we'll need fifo for
that.

task-1875873

[REF] stock_account: fifo "normal" cost method with valuation layers

We don't implement fifo negative handling in this commit.
We make sure we run fifo in average mode to get a proper remaining_qty
field.
_run_fifo is now a method on product (since it could be user outside
of a stock move context). It is really similar to its ancestor on the
stock move, with a few float_is_zero and compare more and a missing
remaing_value.

We move the valuation sanity check into a proper helper,
_sanity_check_for_valuation.

We complete the _create_correction_svl method with accounting entries.

task-1875873

[REF] stock_account: fifo "negative" cost method with valuation layers

Re-implement _run_fifo_vacuum on the product this time with
float_is_zero and without remaining_value.

Trigger the vacuum at each receipt. Before it was done in the scheduler
each night, meaning the valuation on the move was not really
understandable nor consistent (the estimated value could be fixed by
some other move than the next receipt).

task-1875873

同时,代发货模式,到岸成本,以及制造成本等,也进行了重构

[REF] stock_account: dropshipping valuation

We standardize the dropshipping by handling it as it was an receipt
directly followed by an out.

We also follow the same logic whatever the cost method, ie we don't run
fifo or update the AVCO.

task-1875873

[REF] mrp_account: adapt to valuation layers

A finished move is considered as an incoming move and will pass by
_create_in_svl. We thus compute the price_unit that will be set on the
valuation layer.

We also set a stat button on the MO displaying the valuation
layers, similar to the one on the picking.

task-1875873

[REF] stock_dropshipping: adapt to stock valuation layers

The tests of this module showed multiple issues with the anglos axon
accounting entries creation so we fix them by getting the value on the
valuation layer and not directly on the stock moves.

About the changes in
test_crossdock.py

To change a standard price, we need to open the wizard
test_lifo_price.py
To change a standard price, we need to open the wizard + read the
valuation on the layers.
test_stockvaluation.py
Now that we create a layer in and out for a dropshipped move, the
accounting entries are similar to an in followed by an out, thus we need
to increment the number of generated AML. Not that the balance of the
accounts stay the same.

There's a slight change in fifo_perpetual_anglosaxon_ordered though.
Let's say for a start that this config doesn't make sense. Ordered means
we don't read the value on the stock move to create the accounting
entries but only the standard price. We had to change 8 by 10 in this
test because, before this task, the standard price was updated when
running fifo, even in dropshipped. As the PO line was valued at 8, the
anglos axon in stock out was at 8 because the standard price was changed
to 8 after the delivery.

task-1875873

[REF] stock_landed_costs: adapt to valuation layers

We need to increment the value of another layer. We don't want to write
on this layer in place as we used to do for multiple reasons:

  • valuation at date: before the application of an lc, the value should
    not change
  • if the layer was consumed, we would need to adapt the consumers and
    if one day we would have needed to understand what happened in the
    fifo stack it would be hell

So we allow to create a valuation layer linked to another valuation
layer through a simple M2O O2M. At the time it is only used on the
landed costs to add value and no quantity so the code expects it would
be the case and it is not enforced. We adapt _run_fifo to use the full
value.

We also add a stat button on the landed cost to access the valuation
layers, like what is done for the picking and manufacturing orders.

task-1875873

Odoo13 新变化:存货核算的更多相关文章

  1. Odoo13 新变化:会计

    Odoo13将于2019年10月发布,本次发布也包含了大量的改进,例如,对会计的重构. 去掉了 account.invoice / account.invoice.line/ account.vouc ...

  2. [转]Material Design Library 23.1.0的新变化与代码实战

    Design Library出来已经快有一个月了,当时大概看了一下介绍这个新版本变化的译文,内容不多,给我印象最深的就是Percent lib.AppBarLayout 和NavigationView ...

  3. Material Design Library 23.1.0的新变化与代码实战

    Design Library出来已经快有一个月了,当时大概看了一下介绍这个新版本变化的译文,内容不多,给我印象最深的就是Percent lib.AppBarLayout 和NavigationView ...

  4. 从iOS 11 UI Kit中谈谈iOS 11的新变化

    北京时间9月20日凌晨1点,iOS 11终于迎来了正式版的推送,相信各位小伙伴已经在第一时间进行了升级.iOS 11毫无疑问是一次大规模的系统更新,UI.系统内核.锁屏等多方面都进行了不同程度的改进. ...

  5. Delphi XE7 GPS控件android下的新变化

    Delphi XE7 GPS控件的Android新变化 GPS控件的Accuracy可以起作用了,Accuracy>0时:      1--100:ACCURACY_HIGH  101--500 ...

  6. 用友U8将存货核算期初单价金额回写到库存管理期初单价金额

    在用友U8及相关产品中,库存管理期初要求必须录入数量,但单价和金额并不是必输的.从本人过去实施经验来看,为了保证ERP产品的快速上线,有不少企业只能先提供库存管理期初数量,而单价金额需要后续才能确定. ...

  7. 前端面试之HTML5的新变化

    前端面试之HTML5的新变化 H5新增语义化标签 头部标签 <header> :头部标签 <nav> :导航标签 <article> :内容标签 <secti ...

  8. iOS8.3发布了Swift 1.2带来哪些新变化

    苹果前几日在面向开发者推送iOS 8.3 Beta的同时,还发布了版本号为6D520o的Xcode 6.3 Beta,其中便包含了iOS 8.3 Beta和OS X v10.10 SDK,并进一步提升 ...

  9. [译] OpenStack Kilo 版本中 Neutron 的新变化

    OpenStack Kilo 版本,OpenStack 这个开源项目的第11个版本,已经于2015年4月正式发布了.现在是个合适的时间来看看这个版本中Neutron到底发生了哪些变化了,以及引入了哪些 ...

随机推荐

  1. C# 任务、线程、同步(三)

    线程池使用, 线程池中线程均为后台线程 static void Main() { int nWorkerThreads; int nCompletionPortThreads; ThreadPool. ...

  2. python自动华 (十五)

    Python自动化 [第十五篇]:CSS.JavaScript 和 Dom介绍 本节内容 CSS javascript dom CSS position标签 fixed: 固定在页面的某个位置 rel ...

  3. 多线程爬取猫眼电影TOP100并保存到mongo数据库中

    import requests import re import json from requests.exceptions import RequestException from multipro ...

  4. Shiro (包含权限满足其中一个就通过的用法)

    方法/步骤 1 web.xml添加配置 <!-- shiro过滤器 --> <filter> <filter-name>shiroFilter</filter ...

  5. Kafka 消息队列系列之分布式消息队列Kafka

    介绍 ApacheKafka®是一个分布式流媒体平台.这到底是什么意思呢?我们认为流媒体平台具有三个关键功能:它可以让你发布和订阅记录流.在这方面,它类似于消​​息队列或企业消息传递系统.它允许您以容 ...

  6. MySQL 使用连接池封装pymysql

    备注:1,记得先修改连接的数据库哦,(用navicat更方便一点):2,分开两个py文件写入,运行sqlhelper.py文件 一.在utils.py中写 import pymysqlfrom DBU ...

  7. STS工具:mybayis连接oracle数据库

    1.pom.xml文件中的依赖 刚添加依赖的时候会报错,原因是jar包下不下来. 2.我的jdk是1.6,所以需要升级jdk版本到1.8 执行mvn -v命令,可以看到maven的版本号 DOS窗口执 ...

  8. Java进阶知识20 Spring的代理模式

    本文知识点(目录): 1.概念  2.代理模式      2.1.静态代理      2.2.动态代理      2.3.Cglib子类代理 1.概念 1.工厂模式  2. 单例模式 代理(Proxy ...

  9. Noip2011 提高组 选择客栈

    P1311 选择客栈 直通 思路: ①看题,我们可以发现一个显然的性质,即当最左边的客栈向右移动时,最右边的客栈时单调向右的,并且右端点往右的客栈也符合要求.(因为只要左侧有一个满足的,右边的自然可以 ...

  10. CF55D Beautiful numbers (数位dp)

    题目链接 题解 一个数能被一些数整除,那么一定被这些数的\(lcm\)整除 那么我们容易想到根据\(lcm\)设状态 我们可以发现有用的\(lcm\)只有\(48\)个 那么按照一般的数位\(dp\) ...