Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][IMP] sale_order_line_date: commitment_date copy False #3377

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 9 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,12 @@ 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.
"""
self._assert_equal_dates(self.sale_line1.commitment_date, self.dt1)
duplicated_order = self.sale1.copy()
for duplicated_line in duplicated_order.order_line:
self.assertFalse(duplicated_line.commitment_date)
Loading