Rename _get_invoice_sale in _get_invoice on sale
This commit is contained in:
1 parent
a7908ffdec
commit
2bcb418688
6 files changed
+10
-10
No files matched your search
@@ -121,7 +121,7 @@ class Line(metaclass=PoolMeta):
|
||||
for shipment in self.sale.shipments:
|
||||
if (shipment.state == 'done'
|
||||
and shipment.id not in shipment_cost_invoiced):
|
||||
invoice = self.sale._get_invoice_sale()
|
||||
invoice = self.sale._get_invoice()
|
||||
for carriage in shipment.carriages:
|
||||
# XXX: self is not necessary linked to carriage
|
||||
invoice_line = carriage.get_cost_sale_invoice_line(
|
||||
|
||||
@@ -971,7 +971,7 @@ class Sale(
|
||||
sale.total_amount_cache = sale.total_amount
|
||||
cls.save(sales)
|
||||
|
||||
def _get_invoice_sale(self):
|
||||
def _get_invoice(self):
|
||||
'Return invoice'
|
||||
pool = Pool()
|
||||
Invoice = pool.get('account.invoice')
|
||||
@@ -1002,7 +1002,7 @@ class Sale(
|
||||
if not invoice_lines:
|
||||
return
|
||||
|
||||
invoice = self._get_invoice_sale()
|
||||
invoice = self._get_invoice()
|
||||
if getattr(invoice, 'lines', None):
|
||||
invoice_lines = list(invoice.lines) + invoice_lines
|
||||
invoice.lines = invoice_lines
|
||||
|
||||
@@ -216,7 +216,7 @@ class AdvancePaymentCondition(ModelSQL, ModelView):
|
||||
return super().copy(conditions, default)
|
||||
|
||||
def create_invoice(self):
|
||||
invoice = self.sale._get_invoice_sale()
|
||||
invoice = self.sale._get_invoice()
|
||||
if self.invoice_delay is not None:
|
||||
invoice.invoice_date = self.sale.sale_date + self.invoice_delay
|
||||
invoice.payment_term = None
|
||||
|
||||
@@ -119,8 +119,8 @@ class Sale(metaclass=PoolMeta):
|
||||
def _invoice_term_date(self):
|
||||
return
|
||||
|
||||
def _get_invoice_sale(self):
|
||||
invoice = super()._get_invoice_sale()
|
||||
def _get_invoice(self):
|
||||
invoice = super()._get_invoice()
|
||||
if self.invoice_term:
|
||||
invoice.invoice_date = self.invoice_term.get_date(
|
||||
date=self._invoice_term_date)
|
||||
|
||||
@@ -43,14 +43,14 @@ class Sale(metaclass=PoolMeta):
|
||||
)
|
||||
return invoice_domain
|
||||
|
||||
def _get_invoice_sale(self):
|
||||
def _get_invoice(self):
|
||||
transaction = Transaction()
|
||||
context = transaction.context
|
||||
invoice = super()._get_invoice_sale()
|
||||
invoice = super()._get_invoice()
|
||||
if (not context.get('skip_grouping', False)
|
||||
and self.invoice_grouping_method):
|
||||
with transaction.set_context(skip_grouping=True):
|
||||
invoice = self._get_invoice_sale()
|
||||
invoice = self._get_invoice()
|
||||
Invoice = invoice.__class__
|
||||
domain = self._get_grouped_invoice_domain(invoice)
|
||||
order = self._get_grouped_invoice_order()
|
||||
|
||||
@@ -434,7 +434,7 @@ class Line(metaclass=PoolMeta):
|
||||
if (shipment.state == 'done'
|
||||
and shipment.id not in shipment_cost_invoiced):
|
||||
invoice_line = shipment.get_cost_sale_invoice_line(
|
||||
self.sale._get_invoice_sale(), origin=self)
|
||||
self.sale._get_invoice(), origin=self)
|
||||
if invoice_line:
|
||||
lines.append(invoice_line)
|
||||
shipment_cost_invoiced.append(shipment.id)
|
||||
|
||||
Reference in new issue
Block a user