diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-03-14 14:13:47 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-03-14 14:13:47 +0100 |
| commit | 9a4e84ae6670a6ce7086174a3f33f2eee8ded0a3 (patch) | |
| tree | 6a89fa5e6afe9120abda03cfbd32e27cf6cf4768 /addons/purchase | |
| parent | 5625257991d8997c453aee26b5f05ef85925824e (diff) | |
| parent | f5ab04ce5098bb3c3e88ca18ba6b533e6139f8e5 (diff) | |
[MERGE] forward port branch saas-11.3 up to f5ab04ce509
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}'/> |
