Closed hbto closed 2 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.
novalidate=True
[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.