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] PR #498 & #476 #502

Closed hbto closed 2 years ago

hbto commented 2 years ago

PR #498

[IMP] sale: Added context value to prevent auto invoice #476

In Mexico the invoice must be signed with the SAT, and that process is executed after of a commit, so, if this change is not applied, the email is send to the customer without stamp.

Now, if the parameter is generated, the invoice will not to auto-sent

This MR is a cherry-pick on commit vauxoo/odoo@0e354064dc5c15888d19d6b72e64c6f9529090a4 which is in PR https://github.com/Vauxoo/odoo/pull/498

PR #476

The purpose of this MR is to be able to apply the changes via patch.

In a previous development to a client (ABSA), the payment acquirers have a field to specify the invoice policy.

Since we are not using the default invoice policy (the one from the config), the original validation only compares the config parameter, so even if we change the policy to delivered quantities, the invoice will be created in case the default policy has auto invoice checked.

A sale order with the invoice policy set from the payment acquirer as 'delivered quantities' will create an automatic invoice. Using the above case, the sale order won't create an invoice.

This MR is a cherry-pick on comit vauxoo/odoo@967045e97cd04d12f7578cc8b2aa29bbe80989be which is in PR https://github.com/Vauxoo/odoo/pull/476/

NOTE:

As both PR change the same file when applying the patch by the MQT tools for patching it was not properly applying one of the patches.

-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr