[18.0][MIG] pos_order_to_sale_order: Migration to 18.0
Hi @legalsylvain ,
Could this module be merged?
Hi @pedrobaeza ,
Sorry, can this be merged?
/ocabot migration pos_order_to_sale_order /ocabot merge nobump
What a great day to merge this nice PR. Let's do it! Prepared branch 18.0-ocabot-merge-pr-1429-by-pedrobaeza-bump-nobump, awaiting test results.
@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 18.0-ocabot-merge-pr-1429-by-pedrobaeza-bump-nobump.
After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.
Hi @pedrobaeza , could you relaunch the merge?
/ocabot merge nobump
Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 18.0-ocabot-merge-pr-1429-by-pedrobaeza-bump-nobump, awaiting test results.
@pedrobaeza , It didn't work, do you know why?
/ocabot merge nobump
Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 18.0-ocabot-merge-pr-1429-by-pedrobaeza-bump-nobump, awaiting test results.
@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 18.0-ocabot-merge-pr-1429-by-pedrobaeza-bump-nobump.
After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.
@benwillig , I think the JS tests aren't passing, could you check it?
@benwillig , I think the JS tests aren't passing, could you check it?
@lbarry-apsl tests with OCB seems to failed because of other modules, and it's in the case in other PR in 18
I updated the styles of the button to match the default one
Also added pos_session_id on sale.order
Thanks @benwillig for the PR updates! The following OCB tests do fail, though:
test_frontend.TestDivideOrderSummary.test_divide_order_summarytest_frontend.TestLotScanning.test_scan_lot_numbertest_frontend.TestLotScanning.test_scan_to_input_lot_numbertest_frontend.TestDisplayOrderNumber.test_display_order_numbertest_frontend.TestDisplayTotalQty.test_display_total_qty
However, all such errors are similar, for example under log line 145 for test_divide_order_summary:
2025-09-26 14:12:38,558 251 INFO odoo odoo.addons.base.models.ir_model: Access Denied by ACLs for operation: read, uid: 10, model: ir.module.module
2025-09-26 14:12:38,562 251 ERROR odoo odoo.http: Exception during request handling.
Traceback (most recent call last):
File "/opt/odoo/addons/point_of_sale/models/pos_session.py", line 181, in load_data
response[model] = self.env[model]._load_pos_data(response)
[…]
odoo.exceptions.AccessError: You are not allowed to access 'Module' (ir.module.module) records.
This operation is allowed for the following groups:
- Administration/Settings
Contact your administrator to request access if necessary.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
[…]
File "/opt/odoo/addons/point_of_sale/models/pos_session.py", line 185, in load_data
'fields': self.env[model]._load_pos_data_fields(response['pos.config']['data'][0]['id']),
TypeError: IrModuleModule._load_pos_data_fields() takes 1 positional argument but 2 were given
Then the browser-side script gets stuck and eventually killed.
The code under PosSession.load_pos_data has changed a bit. Maybe rebasing/force-pushing can fix the issue? :shrug:
Update 2025-12-02: The PR is already on top of the latest commit, please disregard my suggestion to rebase/force-push.
The errors that I listed above can be pinpointed respectively to these modules: pos_divide_order_summary, pos_lot_barcode, pos_display_order_number, pos_display_total_quantity. They do also trigger when run with a brand new DB and no trace of this PR's code. The tests of the pos_order_to_sale_order module added by this PR do succeed when run in isolation on a new DB, however.
@pedrobaeza, should the other modules be fixed first, before this one can be merged? I understand that merging this one is kind of ugly as the "default" ensemble of tests run by oca_run_tests does not pass. Thanks!
Which tests are failing here in GitHub?
/ocabot merge nobump
On my way to merge this fine PR! Prepared branch 18.0-ocabot-merge-pr-1429-by-pedrobaeza-bump-nobump, awaiting test results.
@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 18.0-ocabot-merge-pr-1429-by-pedrobaeza-bump-nobump.
After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.
@pedrobaeza: The tests that fail are the ones that I listed in https://github.com/OCA/pos/pull/1429#issuecomment-3528186982. They fail both in GitHub's CI and when run locally.
But it's due to this module or they are failing in general?
The tests that I mentioned from modules pos_divide_order_summary, pos_lot_barcode, pos_display_order_number, pos_display_total_quantity are failing when I run them in a local Odoo 18 installation, even if I do not enable the pos_order_to_sale_order module from this PR, so I guess that the former ones do have issues of their own. When I run the tests only for pos_order_to_sale_order locally, they pass just right.
Sorry if I didn't explain myself more clearly. :slightly_smiling_face:
Then they should be fixed before merging this.
@pedrobaeza @benwillig: I traced back the errors in the other modules to a bug introduced in upstream Odoo 18 in commit https://github.com/odoo/odoo/commit/282a667bae54: a new IrModuleModule._load_pos_data_fields(self) method was introduced (then called) in module point_of_sale having only the self parameter, while code elsewhere in Odoo defines and uses _load_pos_data_fields(self, config_id) instead. Then PosSession.load_data() ended up calling it with the extra argument, which causes the errors.
The following changes fix the issue:
diff --git a/addons/point_of_sale/models/ir_module_module.py b/addons/point_of_sale/models/ir_module_module.py
index fcae0cad27a1..32c81bd36724 100644
--- a/addons/point_of_sale/models/ir_module_module.py
+++ b/addons/point_of_sale/models/ir_module_module.py
@@ -5,7 +5,7 @@ class IrModuleModule(models.Model):
_inherit = 'ir.module.module'
@api.model
- def _load_pos_data_fields(self):
+ def _load_pos_data_fields(self, config_id):
return ['id', 'name', 'state']
@api.model
@@ -14,8 +14,8 @@ class IrModuleModule(models.Model):
def _load_pos_data(self, data):
domain = self._load_pos_data_domain()
- fields = self._load_pos_data_fields()
+ fields = self._load_pos_data_fields(data['pos.config']['data'][0]['id'])
return {
'data': self.search_read(domain, fields, load=False),
- 'fields': self._load_pos_data_fields(),
+ 'fields': fields,
}
I don't have time right now to work on a new PR for that, if anyone wants to use the patch to create the PR, be my guest. Thanks! :slightly_smiling_face:
(I may be wrong, but I the existing bug may be blocking all future PRs to this repo as well since it will make their tests fail.)
Hello,
On my local I have a warning : Component 'CreateOrderButton' does not have a static props description