diff --git a/addons/account/wizard/accrued_orders.py b/addons/account/wizard/accrued_orders.py index 1c348914334..9a6533e8c61 100644 --- a/addons/account/wizard/accrued_orders.py +++ b/addons/account/wizard/accrued_orders.py @@ -155,7 +155,7 @@ class AccruedExpenseRevenue(models.TransientModel): o.order_line.with_context(accrual_entry_date=self.date)._compute_qty_delivered() o.order_line.with_context(accrual_entry_date=self.date)._compute_qty_invoiced() o.order_line.with_context(accrual_entry_date=self.date)._compute_untaxed_amount_invoiced() - o.order_line.with_context(accrual_entry_date=self.date)._get_to_invoice_qty() + o.order_line.with_context(accrual_entry_date=self.date)._compute_qty_to_invoice() lines = o.order_line.filtered( lambda l: fields.Float.compare( l.qty_to_invoice, diff --git a/addons/sale/models/sale_order_line.py b/addons/sale/models/sale_order_line.py index 08a88ce024e..687e1881b37 100644 --- a/addons/sale/models/sale_order_line.py +++ b/addons/sale/models/sale_order_line.py @@ -23,7 +23,7 @@ class SaleOrderLine(models.Model): - no: if the SO is not in status 'sale' or 'done', we consider that there is nothing to invoice. This is also hte default value if the conditions of no other status is met. - to invoice: we refer to the quantity to invoice of the line. Refer to method - `_get_to_invoice_qty()` for more information on how this quantity is calculated. + `_compute_qty_to_invoice()` for more information on how this quantity is calculated. - upselling: this is possible only for a product invoiced on ordered quantities for which we delivered more than expected. The could arise if, for example, a project took more time than expected but we decided not to invoice the extra cost to the client. This @@ -81,7 +81,7 @@ class SaleOrderLine(models.Model): # no trigger product_id.invoice_policy to avoid retroactively changing SO @api.depends('qty_invoiced', 'qty_delivered', 'product_uom_qty', 'order_id.state') - def _get_to_invoice_qty(self): + def _compute_qty_to_invoice(self): """ Compute the quantity to invoice. If the invoice policy is order, the quantity to invoice is calculated from the ordered quantity. Otherwise, the quantity delivered is used. @@ -283,7 +283,7 @@ class SaleOrderLine(models.Model): compute='_compute_qty_delivered', store=True, readonly=False, digits='Product Unit of Measure') qty_to_invoice = fields.Float( - compute='_get_to_invoice_qty', string='To Invoice Quantity', store=True, + compute='_compute_qty_to_invoice', string='To Invoice Quantity', store=True, digits='Product Unit of Measure') qty_invoiced = fields.Float( compute='_compute_qty_invoiced', string='Invoiced Quantity', store=True,