Rename _get_invoice_purchase in _get_invoice on purchase
This commit is contained in:
@@ -72,7 +72,7 @@ class Purchase(metaclass=PoolMeta):
|
||||
amount = sum(map(self.currency.cash_round, amounts))
|
||||
return amount
|
||||
|
||||
def _get_invoice_purchase(self):
|
||||
invoice = super()._get_invoice_purchase()
|
||||
def _get_invoice(self):
|
||||
invoice = super()._get_invoice()
|
||||
invoice.cash_rounding = self.cash_rounding
|
||||
return invoice
|
||||
|
||||
@@ -813,7 +813,7 @@ class Purchase(
|
||||
purchase.total_amount_cache = purchase.total_amount
|
||||
cls.save(purchases)
|
||||
|
||||
def _get_invoice_purchase(self):
|
||||
def _get_invoice(self):
|
||||
'Return invoice'
|
||||
pool = Pool()
|
||||
Invoice = pool.get('account.invoice')
|
||||
@@ -844,7 +844,7 @@ class Purchase(
|
||||
if not invoice_lines:
|
||||
return
|
||||
|
||||
invoice = self._get_invoice_purchase()
|
||||
invoice = self._get_invoice()
|
||||
if getattr(invoice, 'lines', None):
|
||||
invoice_lines = list(invoice.lines) + invoice_lines
|
||||
invoice.lines = invoice_lines
|
||||
|
||||
Reference in New Issue
Block a user