[18.0][ADD] contract_line_defer: Avoid invoicing line until activated - #1342
tobiaszehntner wants to merge 3 commits into
Conversation
6f7b2ba to
c710c94
Compare
acsonefho
left a comment
There was a problem hiding this comment.
Only minor stuff!
Really good job 💪
0541b4c to
00ca05a
Compare
00ca05a to
30a185f
Compare
|
@tobiaszehntner Can you please fix the tests? |
50740b8 to
858be8a
Compare
rebased branch which fixed the tests. Added extra tests for improving coverage. |
858be8a to
571be12
Compare
571be12 to
fdfafde
Compare
bc976fb to
3c91e70
Compare
3c91e70 to
f8eea3b
Compare
|
@gurneyalex Can you please merge? |
afca6d2 to
c31cdf5
Compare
|
This PR has the |
There was a problem hiding this comment.
Functional test OK. Thank you for the great readme.
Just two non-blocking comments :
- I note that the module contract_service_dates is not affected by the defered field. It could be nice to have a glue module at some point.
- Also, the field "Next Period Start" is still filled and visible even the line is deferred. This could generate confusion.
56da702 to
e2b18dd
Compare
@victor-champonnois Thanks! I fixed the next period start (now False if deferred) and added a point to the readme/Roadmap regarding |
| if not self.is_deferred: | ||
| today = fields.date.today() | ||
| if not self.date_start or self.date_start < today: | ||
| self.date_start = today |
There was a problem hiding this comment.
@tobiaszehntner Contract line date_start and date_end are computed. Don't use onchanges.
There was a problem hiding this comment.
fixed for date_start and left for date_end as it's not computed on the contract mixin
There was a problem hiding this comment.
@rousseldenis hah that doesn't actually work. The onchange was for the single purpose when the user de-selects is_deferred in the view. but if I move it to the view it triggers on any contract.line that has is_deferred False. I reverted to onchange
2026-09-22 09:36:11,339 337 ERROR odoo odoo.addons.contract_sale_generation.tests.test_contract_sale: FAIL: TestContractSale.test_contract
Traceback (most recent call last):
File "/__w/contract/contract/contract_sale_generation/tests/test_contract_sale.py", line 25, in test_contract
self.assertEqual(self.contract_line.recurring_next_date, recurring_next_date)
AssertionError: datetime.date(2026, 10, 22) != datetime.date(2020, 2, 15)
2026-09-22 09:36:11,492 337 ERROR odoo odoo.addons.contract_sale_generation.tests.test_contract_sale: FAIL: TestContractSale.test_contract_autoconfirm
Traceback (most recent call last):
File "/__w/contract/contract/contract_sale_generation/tests/test_contract_sale.py", line 40, in test_contract_autoconfirm
self.assertEqual(self.contract_line.recurring_next_date, recurring_next_date)
AssertionError: datetime.date(2026, 10, 22) != datetime.date(2020, 2, 15)
e2b18dd to
f641b65
Compare
f641b65 to
7fe1737
Compare
Defer Contract Lines to avoid invoicing while start date unknown
Enable to defer contract line's invoicing. If a contract line start date is not known, it can be deferred. It will not be invoiced until manually activated.