From 1aae3b27f9afffc766ee8b564546ef28c14477d1 Mon Sep 17 00:00:00 2001 From: Joan Sisquella Date: Mon, 28 Oct 2024 10:09:30 +0100 Subject: [PATCH] [IMP] sale_order_line_date: commitment_date copy False --- sale_order_line_date/models/sale_order_line.py | 2 +- sale_order_line_date/tests/test_sale_order_line_date.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sale_order_line_date/models/sale_order_line.py b/sale_order_line_date/models/sale_order_line.py index 316634aab55..3b9fd68973d 100644 --- a/sale_order_line_date/models/sale_order_line.py +++ b/sale_order_line_date/models/sale_order_line.py @@ -14,7 +14,7 @@ class SaleOrderLine(models.Model): _inherit = "sale.order.line" - commitment_date = fields.Datetime("Delivery Date") + commitment_date = fields.Datetime("Delivery Date", copy=False) def _prepare_procurement_values(self, group_id=False): vals = super(SaleOrderLine, self)._prepare_procurement_values(group_id) diff --git a/sale_order_line_date/tests/test_sale_order_line_date.py b/sale_order_line_date/tests/test_sale_order_line_date.py index c2ee31096a5..f68ee7a6e7f 100644 --- a/sale_order_line_date/tests/test_sale_order_line_date.py +++ b/sale_order_line_date/tests/test_sale_order_line_date.py @@ -158,3 +158,10 @@ def test_03_line_commitment_date_picking_propagation(self): self._assert_equal_dates( self.sale_line3.commitment_date, self.sale_line3.move_ids.date_deadline ) + + def test_04_commitment_date_duplication(self): + """ + Test if commitment_date field is empty when duplicating a sale order line. + """ + duplicated_line = self.sale_line1.copy() + self.assertFalse(duplicated_line.commitment_date)