diff options
Diffstat (limited to 'addons/purchase/models')
| -rw-r--r-- | addons/purchase/models/account_invoice.py | 1 | ||||
| -rw-r--r-- | addons/purchase/models/purchase.py | 2 |
2 files changed, 2 insertions, 1 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 |
