diff --git a/product_sale_price_from_pricelist/models/sale_order.py b/product_sale_price_from_pricelist/models/sale_order.py index 2895f31..466daea 100644 --- a/product_sale_price_from_pricelist/models/sale_order.py +++ b/product_sale_price_from_pricelist/models/sale_order.py @@ -8,6 +8,16 @@ _logger = logging.getLogger(__name__) class SaleOrder(models.Model): _inherit = "sale.order" + def cron_action_update_lines_from_list_price(self): + records = self.env["sale.order"].search( + [ + ("invoice_status", "!=", "invoiced"), + ("invoice_status", "!=", "up_to_date"), + ("state", "!=", "cancel"), + ] + ) + records.action_update_lines_from_list_price() + def action_update_lines_from_list_price(self): """Copy current product list price into sale order lines.