Vauxoo / odoo

Fork of Odoo (formerly OpenERP). [This project is not publically mantained just born for internal usage with some little patches] go to official repository on github.com/odoo/odoo
https://www.odoo.com
Other
9 stars 9 forks source link

[FIX] Time consuming Journal Item creation process can be avoided #245

Closed hbto closed 2 years ago

hbto commented 7 years ago

[FIX] This fix will add a new key into the context sending novalidate=True in order to avoid validation at Entry Lines creation When this method is run at invoice (action_move_create) it commission the creation of Journal Entry Lines at https://github.com/odoo/odoo/blob/8.0/addons/account/account_invoice.py#L938 where each line created is validated at https://github.com/odoo/odoo/blob/8.0/addons/account/account_move_line.py#L1481 after all lines are created and glued their Journal Entry is posted at https://github.com/odoo/odoo/blob/8.0/addons/account/account_invoice.py#L949 which in turn does another validation on all the previous Journal Items at https://github.com/odoo/odoo/blob/8.0/addons/account/account.py#L1316 Therefore, when creating the Journal Entry for an invoice it is enough to do one validate when posting the Journal Entry and skip the other validations at creation time.