[19.0][MIG] sale_semaphore : Migration to 19.0.#4456
Conversation
…on to be able to inherit from the category
…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/
|
/ocabot migration sale_semaphore |
rousseldenis
left a comment
There was a problem hiding this comment.
LGTM.
At least change the test name
| order.with_user(self.salesperson).action_confirm() | ||
|
|
||
| def test_additional_coverage(self): | ||
| pre_init_hook(self.env) |
There was a problem hiding this comment.
This is a non sense as that hook has already been called during install.
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
@uncannycs IMHO, we should not be jesuistics on coverage. Some corner cases will never be tested and that's normal.
e528e62 to
86bbacd
Compare
[19.0][MIG] sale_semaphore : Migration to 19.0.