[FIX] repair: use Customer Payment Terms in repair invoice

- Install Contacts and Repairs
- Go to Contacts and configure Payment Terms of Contact X (i.e. 2 Months)
- Go to Repairs and create a Repair Order:
  * Select Contact X as Customer
  * Select "Before Repair" as Invoice Method
  * Add Parts or Operations
- Confirm Repair and Create invoice
The Payment Terms of the created invoice is the default one and not the Payment Terms of Customer.

opw-2304818

closes odoo/odoo#55152

X-original-commit: 351718d5f579fca4945538c78e63aa50118af2b4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Anh Thao Pham (pta)
2020-07-29 14:30:21 +00:00
parent 99c02a83a5
commit 7d010ee8a5
+2
View File
@@ -347,6 +347,8 @@ class Repair(models.Model):
'invoice_line_ids': [],
'fiscal_position_id': fpos.id
}
if partner_invoice.property_payment_term_id:
invoice_vals['invoice_payment_term_id'] = partner_invoice.property_payment_term_id.id
current_invoices_list.append(invoice_vals)
else:
# if group == True: concatenate invoices by partner and currency