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

[18.0][MIG] sale_timesheet_line_exclude: Migration to 18.0 #728

Open
wants to merge 25 commits into
base: 18.0
Choose a base branch
from

Conversation

HeliconiaSolutions
Copy link

No description provided.

alexey-pelykh and others added 22 commits January 2, 2025 17:08
* [FIX] sale_timesheet_line_exclude: fix manifest
* [FIX] sale_timesheet_task_exclude: fix manifest
Currently translated at 100.0% (5 of 5 strings)

Translation: timesheet-15.0/timesheet-15.0-sale_timesheet_line_exclude
Translate-URL: https://translation.odoo-community.org/projects/timesheet-15-0/timesheet-15-0-sale_timesheet_line_exclude/fr/
Copy link

@JessBrandl JessBrandl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, I ran it in runboat and it worked as intended except the following:
I came across an error that was already present in previous versions after some testing; If you go to Timesheets, then Reporting>By Billing Type it will throw an error I cannot place.
image

UncaughtPromiseError > OwlError Uncaught Promise > The following error occurred in onWillStart: "Cannot read properties of undefined (reading 'type')" OwlError: The following error occurred in onWillStart: "Cannot read properties of undefined (reading 'type')" Error at wrapError (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:10180:23) (/web/static/lib/owl/owl.js:2631) at onWillStart (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:10224:29) (/web/static/lib/owl/owl.js:2675) at WithSearch.setup (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:75487:9) (/web/static/src/search/with_search/with_search.js:43) at new ComponentNode (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:9928:28) (/web/static/lib/owl/owl.js:2379) at https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:13524:28 (/web/static/lib/owl/owl.js:5975) at View.template (eval at compile (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:13248:20), <anonymous>:22:12) (/web/static/lib/owl/owl.js:5699) at Fiber._render (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:9278:38) (/web/static/lib/owl/owl.js:1729) at Fiber.render (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:9270:18) (/web/static/lib/owl/owl.js:1721) at ComponentNode.initiateRender (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:9950:23) (/web/static/lib/owl/owl.js:2401) Caused by: TypeError: Cannot read properties of undefined (reading 'type') at SearchArchParser.visitField (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:71007:49) (/web/static/src/search/search_arch_parser.js:126) at https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:70959:26 (/web/static/src/search/search_arch_parser.js:78) at visit (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:42466:41) (/web/static/src/core/utils/xml.js:51) at visitChildren (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:42462:21) (/web/static/src/core/utils/xml.js:47) at SearchArchParser.visitSearch (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:71148:9) (/web/static/src/search/search_arch_parser.js:267) at https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:70948:26 (/web/static/src/search/search_arch_parser.js:67) at visit (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:42466:41) (/web/static/src/core/utils/xml.js:51) at visitXML (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:42473:5) (/web/static/src/core/utils/xml.js:58) at SearchArchParser.parse (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:70945:9) (/web/static/src/search/search_arch_parser.js:64) at PivotSearchModel.load (https://c4a8.odoo.com/web/assets/debug/web.assets_web.js:72457:78) (/web/static/src/search/search_model.js:297)

@@ -1,3 +1,4 @@
- [CorporateHub](https://corporatehub.eu/)
- Alexey Pelykh \<<[email protected]>\>
- Freni Patel \<<[email protected]>\>
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`_

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting can be improved

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JessBrandl , Please review.it's done.

Comment on lines 23 to 28
raise ValidationError(
_(
"You can not modify timesheets in a way that would affect "
"invoices since these timesheets were already invoiced."
)
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small performance improvement possible according to the documentation https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-18.0:

You can replace the call to translate a string ( _ ) with self.env._ for getting some performance improvement in some cases. See odoo/odoo#174844.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JessBrandl , Thanks for the suggestions! it's done.

@HeliconiaSolutions HeliconiaSolutions force-pushed the 18.0-mig-sale_timesheet_line_exclude branch from 0b76d81 to 8417693 Compare February 7, 2025 10:23
@sbidoul
Copy link
Member

sbidoul commented Feb 14, 2025

Can you pick the commits from #707 ?

@HeliconiaSolutions HeliconiaSolutions force-pushed the 18.0-mig-sale_timesheet_line_exclude branch from 8417693 to 9fb186c Compare February 18, 2025 12:05
We don't copy the field by default, because it breaks the
OE timesheet grid for users in the security group that hides
the field.

Functionally, it also makes sens to not copy this field,
because it is better to consider the new line not excluded
by default.
@HeliconiaSolutions
Copy link
Author

HeliconiaSolutions commented Feb 18, 2025

@sbidoul , yes.it's done.

Copy link

@JessBrandl JessBrandl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine, except that the user is not by default given access to the non-billable field; see #719 .

Comment on lines 400 to 409
<<<<<<< HEAD
# Go to <em>Project &gt; All Tasks</em>, ans open a specific Task form # On the
Task form, <em>Timesheets</em> tab, check <em>Non-billable</em> for specific
timesheet entries</blockquote>
=======
# Go to <em>Project &gt; All Tasks</em>, ans open a specific Task form
# On the Task form, <em>Timesheets</em> tab, check <em>Non-billable</em> for specific timesheet entries</blockquote>
<p>To have access to this <em>Non-billable</em> field, the user must be added to the
<em>Exclude timesheets from sale order</em> security group.</p>
>>>>>>> 34a29d33 ([IMP] sale_timesheet_line_exclude: add security group)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge conflict not resolved?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JessBrandl , Please review.i fixed.

@HeliconiaSolutions HeliconiaSolutions force-pushed the 18.0-mig-sale_timesheet_line_exclude branch from 88ddc62 to e33f08b Compare February 21, 2025 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.