Skip to content

Commit

Permalink
[IMP] sale_order_line_date: commitment_date copy False
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanSForgeFlow committed Oct 28, 2024
1 parent 5a00994 commit 1aae3b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sale_order_line_date/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions sale_order_line_date/tests/test_sale_order_line_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 1aae3b2

Please sign in to comment.