cron update sale order lines

This commit is contained in:
GitHub Copilot 2026-05-21 13:37:10 +02:00
parent 56509892e6
commit 4ea0286b52

View file

@ -8,6 +8,16 @@ _logger = logging.getLogger(__name__)
class SaleOrder(models.Model): class SaleOrder(models.Model):
_inherit = "sale.order" _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): def action_update_lines_from_list_price(self):
"""Copy current product list price into sale order lines. """Copy current product list price into sale order lines.