Skip to content
Snippets Groups Projects
Commit 61b5dd38 authored by Thomas Lefebvre (thle)'s avatar Thomas Lefebvre (thle)
Browse files

[FIX] membership: add payment terms on the invoice


Versions:
---------
- 14.0
- 15.0

Steps to reproduce:
-------------------
- in Members app, add a membership product;
- add a "Payment Terms" on a contact (Sales & Purchase tab);
- in Membership tab click on "Buy Membership";
- add the membership product and invoice;

Issue:
------
There is no payment term on the invoice.

Cause:
------
In the invoice creation flow, the following logic is not triggered:
```py
if self.is_sale_document(include_receipts=True) and self.partner_id:
	self.invoice_payment_term_id = self.partner_id.property_payment_term_id or self.invoice_payment_term_id
```
Consequently, we have no invoice_payment_term_id.

Solution:
---------
Specify `invoice_payment_term_id` in the values used for invoice creation.

Note:
-----
This FIX solution only handles the invoice creation
from the membership module, to be as non-invasive as possible.

In version 16.0, this is handled by the account module,
which has made the `invoice_payment_term_id` field computed and dependent on `partner_id`.

opw-3382398

closes odoo/odoo#130998

Signed-off-by: default avatarAndrea Grazioso (agr) <agr@odoo.com>
parent f210c4c9
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment