diff options
Diffstat (limited to 'addons/purchase')
| -rw-r--r-- | addons/purchase/models/account_invoice.py | 1 | ||||
| -rw-r--r-- | addons/purchase/models/purchase.py | 2 | ||||
| -rw-r--r-- | addons/purchase/report/purchase_order_templates.xml | 2 | ||||
| -rw-r--r-- | addons/purchase/report/purchase_quotation_templates.xml | 2 |
4 files changed, 4 insertions, 3 deletions
diff --git a/addons/purchase/models/account_invoice.py b/addons/purchase/models/account_invoice.py index 4ac0a3a4156..eaa71775476 100644 --- a/addons/purchase/models/account_invoice.py +++ b/addons/purchase/models/account_invoice.py @@ -124,7 +124,6 @@ class AccountInvoice(models.Model): purchase_ids = self.invoice_line_ids.mapped('purchase_id') if purchase_ids: self.origin = ', '.join(purchase_ids.mapped('name')) - self.reference = ', '.join(purchase_ids.filtered('partner_ref').mapped('partner_ref')) or self.reference @api.onchange('partner_id', 'company_id') def _onchange_partner_id(self): diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index bca2c8afc84..de25d8b29fc 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -413,6 +413,8 @@ class PurchaseOrder(models.Model): # Do not set an invoice_id if we want to create a new bill. if not create_bill: result['res_id'] = self.invoice_ids.id or False + result['context']['default_origin'] = self.name + result['context']['default_reference'] = self.partner_ref return result @api.multi diff --git a/addons/purchase/report/purchase_order_templates.xml b/addons/purchase/report/purchase_order_templates.xml index 4418b15b0a6..17162f934f9 100644 --- a/addons/purchase/report/purchase_order_templates.xml +++ b/addons/purchase/report/purchase_order_templates.xml @@ -2,7 +2,7 @@ <odoo> <template id="report_purchaseorder_document"> <t t-call="web.external_layout"> - <t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/> + <t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> <t t-set="address"> <div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> diff --git a/addons/purchase/report/purchase_quotation_templates.xml b/addons/purchase/report/purchase_quotation_templates.xml index e63e1a88198..eec1465e0ca 100644 --- a/addons/purchase/report/purchase_quotation_templates.xml +++ b/addons/purchase/report/purchase_quotation_templates.xml @@ -2,7 +2,7 @@ <odoo> <template id="report_purchasequotation_document"> <t t-call="web.external_layout"> - <t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/> + <t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/> <t t-set="address"> <div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> |
