From 4ea0286b521c3f51d3d7d7752ebe5dd6b86927ff Mon Sep 17 00:00:00 2001 From: GitHub Copilot Date: Thu, 21 May 2026 13:37:10 +0200 Subject: [PATCH] cron update sale order lines --- product_sale_price_from_pricelist/models/sale_order.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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.