Skip to content

[19.0][MIG] sale_semaphore : Migration to 19.0.#4456

Open
uncannycs wants to merge 15 commits into
OCA:19.0from
uncannycs:19.0-mig-sale_semaphore
Open

[19.0][MIG] sale_semaphore : Migration to 19.0.#4456
uncannycs wants to merge 15 commits into
OCA:19.0from
uncannycs:19.0-mig-sale_semaphore

Conversation

@uncannycs

Copy link
Copy Markdown

[19.0][MIG] sale_semaphore : Migration to 19.0.

CarlosRoca13 and others added 14 commits July 9, 2026 13:57
…icelist

A line priced exactly at the pricelist could wrongly block confirmation for regular salespeople, even without lowering the price.

Additionally, the write() guard called pricelist.get_product_price(), a method that does not exist in this Odoo version and would raise AttributeError when a salesperson edited the price of a confirmed line.

Centralize the logic in _get_semaphore_price_reduce(), _get_semaphore_pricelist_price() (aligning uom, tax basis and currency rounding) and _is_price_below_pricelist(), and reuse them in action_confirm() and write(). Add regression tests covering both the no-block and block cases.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_semaphore
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_semaphore/
Currently translated at 100.0% (25 of 25 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_semaphore
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_semaphore/es/
Currently translated at 100.0% (25 of 25 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_semaphore
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_semaphore/es/
@rousseldenis

Copy link
Copy Markdown
Contributor

/ocabot migration sale_semaphore

@rousseldenis rousseldenis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

At least change the test name

order.with_user(self.salesperson).action_confirm()

def test_additional_coverage(self):
pre_init_hook(self.env)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a non sense as that hook has already been called during install.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@rousseldenis - We completely understand that the hook is already executed during the module's installation. However, We explicitly called pre_init_hook(self.env) here in the test case for the purpose of Code Coverage.

Since the standard test suite runner sometimes misses the initial installation hooks in its coverage report, manually triggering it here ensures that the hook's logic is fully executed and covered by the coverage metrics. If there is a more preferred OCA standard way to test and cover pre_init_hook without calling it directly here, please let me know and We will gladly update it!

Also, We have addressed your other point and renamed the test method to test_semaphore_edge_cases_and_reporting to better reflect its aim.

@rousseldenis rousseldenis Jul 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@uncannycs IMHO, we should not be jesuistics on coverage. Some corner cases will never be tested and that's normal.

Comment thread sale_semaphore/tests/test_sale_semaphore.py Outdated
@uncannycs
uncannycs force-pushed the 19.0-mig-sale_semaphore branch from e528e62 to 86bbacd Compare July 17, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants