Odoo13将于2019年10月发布,本次发布也包含了大量的改进,例如,对会计的重构。
去掉了 account.invoice / account.invoice.line/ account.voucher / account.voucher.line 等模型, 将它们合并到 account.move 和 account.move.line

具体提交记录如下:

[IMP/REF] accounting-pocalypse yeaaahh

This commit merges the following models

  • account.invoice and account.move
  • account.invoice.line and account.move.line
  • account.voucher and account.move
  • account.voucher.line and account.move.line

It was the opportunity for a big cleanup of the code, so it also restructures the whole account module, its different models/fields, the tests etc. for a better world and a better code readability.

==== Rationale ====
The rationale of this huge change is that we want journal entries / invoices to be easily edited, and changes reflected in the other model. It's a HUGE feature and very strategic for the fiduciary companies. For example, changing the account of a journal entry needs to be automatically reflected on the related invoice.

The same reasoning applies to sale/purchase vouchers.

==== Changes made in features =====
When creating an invoice, you are now creating a journal entry directly.
--> The object account.invoice no longer exists.
In the same fashion when creating an invoice line, you're now adding journal items directly in the journal entry representing the invoice. If this invoice line has some tax, it may create additional journal items as well.
--> The models account.invoice.line & account.invoice.tax no longer exist

Identically, when creating a sale/purchase receipt with its lines, you are now creating a journal entry directly and there's no more usability difference between encoding a receipt or an invoice.
--> The object account.voucher no longer exists.
--> The object account.voucher.line no longer exists.
--> The whole account_voucher module no longer exists.

Positive side-effects coming from these changes are

  • draft invoices/bills/sale or purchase receipts now create a draft accounting entry. Validate these objects now simply post its journal entry. That means that draft invoices/bills/sale or purchase receipt can straightforwardly be included in reporting or budgets.
  • opening a journal entry in form view will now always open the correct view: if it's a sale/purchase journal entry we will have a customer invoice/vendor bill view or a sale/purchase receipt view, whatever the menu we're coming from.
  • code & business logic simplification. It is also condensed in a single place instead of being partially duplicated on invoices, vouchers and journal entries.

There should be no feature loss, except the one allowing to group multiple journal items together based on the same product during the invoice validation.

==== Changes made in models =====

  • account.invoice: model removed. Instead, now use account.move with following mapping

field (account.invoice) field (account.move)
----------------------- --------------------
name invoice_payment_ref
number name
reference ref
comment narration
user_id invoice_user_id
amount_ total_company_signed amount_total_signed
residual amount_residual
state state + invoice_payment_state /! selection changed
date_invoice invoice_date
date_due invoice_date_due
sent invoice_sent
origin invoice_origin
payment_term_id invoice_payment_term_id
partner_bank_id invoice_partner_bank_id
incoterm_id invoice_incoterm_id
vendor_bill_id invoice_vendor_bill_id
source_email invoice_source_email
vendor_display_name invoice_vendor_display_name
invoice_icon invoice_vendor_icon
cash_rounding_id invoice_cash_rounding_id
sequence_number_next invoice_sequence_number_next
sequence_number_next_prefix invoice_sequence_number_next_prefix

'invoices' subset of account.move can be accessed by using the selection field 'type' or one of the many helpers like is_invoice()

  • account.move: now has a valid state 'cancel' that has to be excluded from all business logic
  • account.move: field 'amount' renamed into 'amount_total'
  • account.move: field 'reverse_entry_id' renamed into 'reversed_entry_id'
  • account.move.line: now has a field 'display_type' that has to be excluded from all business logic, in order to support invoice layouting
  • account.invoice.line: model removed. Instead, now use account.move.line with following mapping

field (account.invoice.line) field (account.move.line)
---------------------------- -------------------------
invoice_id move_id
uom_id product_uom_id
invoice_line_tax_ids tax_ids
account_analytic_id analytic_account_id

'invoice lines' subset of all account.move.line from a journal entry can be accessed by using the boolean field 'exclude_from_invoice_tab'

  • account.invoice.tax: model removed. Instead, now use account.move.line with following mapping

field (account.invoice.tax) field (account.move.line)
--------------------------- -------------------------
invoice_id move_id
account_analytic_id analytic_account_id
amount price_unit
base tax_base_amount

'tax lines' subset of all account.move.line from a journal entry can be accessed by using the relational field 'tax_line_id'

  • account.invoice.confirm: model removed. Instead, now use the 'post()' function of account.move
  • account.invoice.refund: model removed. Instead, now use account.move.reversal to reverse the entries with the same options as we had for invoices
  • account.voucher: model removed. Instead, now use account.move of type in ['out_receipt', 'in_receipt]
  • account.voucher.line: model removed. Instead, now use account.move.line

==== Changes made in functions ====

  • on account.move, method _run_post_draft_to_post() renamed into _autopost_draft_entries()
  • on account.move, method action_account_invoice_payment() renamed into action_invoice_register_payment()
  • on account.move, method action_invoice_reconcile_to_check() renamed into action_open_matching_suspense_moves()
  • on account.move, method _get_domain_edition_mode_available() renamed into _get_domain_matching_supsense_moves()
  • on account.move, method _get_intrastat_country_id() renamed into _get_invoice_intrastat_country_id()
  • on account.move.line, method _get_domain_for_edition_mode() renamed into _get_suspense_moves_domain()
  • in account.bank.statement, contextual key 'edition_mode' renamed into 'suspense_moves_mode'

Was task 1917430

Odoo13 新变化:会计的更多相关文章

  1. Odoo13 新变化:存货核算

    Odoo13将于2019年10月发布,本次发布也包含了大量的改进,例如,对存货核算的重构. 去掉了 产品历史价格product.price.history ,增加了 stock valuation l ...

  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. 前端面试之HTML5的新变化

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

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

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

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

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

  9. [译] OpenStack Liberty 版本中的53个新变化

    一个新的秋季,一个新的OpenStack 版本.OpenStack 的第12个版本,Liberty,在10月15日如期交付,而且目前发行版本已经备好了.那么我们期望能从过去六个月时间的开发中获得些什么 ...

随机推荐

  1. swoole,http\server 跨域---记一次php网站跨域访问上机实验

    缘由:为了更好的体验swoole组件优良的协程Mysql客户端,实现更好的并发设计:写了一个小程序. 环境准备: 没有采用任何框架,只是使用了smarty模版,来渲染后端php响应的数据,在一个htm ...

  2. [2019年湘潭大学程序设计竞赛(重现赛)H chat][背包dp]

    链接:https://ac.nowcoder.com/acm/contest/893/H来源:牛客网 题目描述 在Casya生活的世界里,一天由m个小时组成. 最近Casya的女神终于答应在接下来的n ...

  3. 007_Linux驱动之_copy_from_user函数

    1. copy_from_user函数的目的是从用户空间拷贝数据到内核空间 2. 解析原型: copy_from_user(void *to, const void __user *from, uns ...

  4. nc命令用法举

    什么是nc nc是netcat的简写,有着网络界的瑞士军刀美誉.因为它短小精悍.功能实用,被设计为一个简单.可靠的网络工具 nc的作用 (1)实现任意TCP/UDP端口的侦听,nc可以作为server ...

  5. 夺命连环问:一个 TCP 连接可以发多少个 HTTP 请求?

    曾经有这么一道面试题:从 URL 在浏览器被被输入到页面展现的过程中发生了什么? 相信大多数准备过的同学都能回答出来,但是如果继续问:收到的 HTML 如果包含几十个图片标签,这些图片是以什么方式.什 ...

  6. Git 中无法忽略 .xcuserstate 的解决方法

    1.查看代码变化git status 2.接着输入 git rm –cached 刚才复制的地址 ,如下.git rm --cached RxSwift/Rx.xcodeproj/xcuserdata ...

  7. pwn学习日记Day19 《程序员的自我修养》读书笔记

    windows PE/COFF章总结 本章学习了windows下的可执行文件和目标文件格式PE/COFF.PE/COFF文件与ELF文件非常相似,它们都是基于段的结构的二进制文件格式.Windows下 ...

  8. Python进行Redis数据迁移

    Python进行Redis数据迁移 由于开发时的误操作,导致redis数据损坏,所以需要进行redis的数据迁移,网上大佬的教程基本都是需要下载附加工具,亦或是需要一些复杂的操作,个人觉得麻烦还不如写 ...

  9. python中heapq对dict进行排序

    问题: 想从以下形式的dict中取value最大的2个key-value的key dict_num_num = {0: 0.07374631268436578, 1: 0.16307692307692 ...

  10. mysql中的union操作(整理)

    mysql中的union操作(整理) 一.总结 一句话总结: union两侧的字段数和字段类型要是一样的 union可以接多个 orderby和排序可以在最后的union组合之后 1.union简单实 ...