-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[FIX] sale_timesheet: project task invoice wizard daterange #140874
[FIX] sale_timesheet: project task invoice wizard daterange #140874
Conversation
@@ -15,11 +15,14 @@ | |||
name="timesheet_invoice_date_range" | |||
attrs="{'invisible': ['|', ('invoicing_timesheet_enabled', '=', False), ('advance_payment_method', '!=', 'delivered')]}" | |||
> | |||
<label for="date_start_invoice_timesheet" string="Timesheets Period" attrs="{'invisible': [ '|', ('invoicing_timesheet_enabled', '=', False), ('advance_payment_method', '!=', 'delivered')]}"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update the pot file otherwise translation is break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you are correct
7212f09
to
a2b5e91
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @dhda-odoo for your work 💯
I left one comment 😁
<field | ||
name="date_start_invoice_timesheet" | ||
widget="daterange" | ||
attrs="{'required': ['|', ('date_start_invoice_timesheet', '!=', False), ('date_end_invoice_timesheet', '!=', False)]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this really needed ? can't you just do this ?
attrs="{'required': ['|', ('date_start_invoice_timesheet', '!=', False), ('date_end_invoice_timesheet', '!=', False)]}" | |
required="1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pkyriakou Yes, we do need it to ensure the same behavior as in version 16.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pkyriakou we cannot because the daterange should be only required when there is at least one date set. If the both fields are empty then the daterange should not be required. 🙂
I agree it is a bit strange to write the required condition like this but it does not seem we have another way to do that. 😅
a2b5e91
to
058ad6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @dhda-odoo 💯
LGTM 🟢 🥳
ec34bd2
to
607d64f
Compare
607d64f
to
c557199
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work 🙂
<field | ||
name="date_start_invoice_timesheet" | ||
widget="daterange" | ||
attrs="{'required': ['|', ('date_start_invoice_timesheet', '!=', False), ('date_end_invoice_timesheet', '!=', False)]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pkyriakou we cannot because the daterange should be only required when there is at least one date set. If the both fields are empty then the daterange should not be required. 🙂
I agree it is a bit strange to write the required condition like this but it does not seem we have another way to do that. 😅
@@ -15,13 +15,23 @@ | |||
name="timesheet_invoice_date_range" | |||
attrs="{'invisible': ['|', ('invoicing_timesheet_enabled', '=', False), ('advance_payment_method', '!=', 'delivered')]}" | |||
> | |||
<label for="date_start_invoice_timesheet" string="Timesheets Period"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could just be a string in the field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xavierbol no that is not working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it works, it is just because you added nolabel="1"
... 😕
I will fix it
I applied my comment and rebased your branch. 🙂 robodoo r+ |
robodoo r- |
saas-16.3 Steps To reproduce: - install project, sales, and timesheets - open the project module and select any project created from SO - click on any task - click on the Sales Order smart button - to set the end date hover beside the start date Issue: - end date should not be optional to select. Cause: - the unification of datetime, daterange, and date happened in task 3121497 where daterange widget has the end date by default optional. Solution: - I have added attrs and Timesheets Period label to have the same behavior as it was in saas-16.2. task-3506482
c557199
to
2223fbd
Compare
robodoo r+ |
saas-16.3 Steps To reproduce: - install project, sales, and timesheets - open the project module and select any project created from SO - click on any task - click on the Sales Order smart button - to set the end date hover beside the start date Issue: - end date should not be optional to select. Cause: - the unification of datetime, daterange, and date happened in task 3121497 where daterange widget has the end date by default optional. Solution: - I have added attrs and Timesheets Period label to have the same behavior as it was in saas-16.2. task-3506482 closes #140874 Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
saas-16.3
Steps To reproduce:
Issue:
Cause:
Solution:
task-3506482