Skip to content

Conversation

@benwillig
Copy link

No description provided.

legalsylvain and others added 30 commits July 17, 2025 16:54
* [ADD] new module pos_order_to_sale_order
…ion of this module (price unit loss, and pricelist) if pos_pricelist is installed
[FIX] Remove console.log ;
[IMP] Do not import js files in backend
[IMP] apply new readme structure
[FIX] remove useless demo file
[FIX] some pylint issues
[REF] add maintainers and developpment status
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-8.0/pos-8.0-pos_order_to_sale_order
Translate-URL: https://translation.odoo-community.org/projects/pos-8-0/pos-8-0-pos_order_to_sale_order/
Co-authored-by: Iván Todorovich <ivan.todorovich@druidoo.io>
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-12.0/pos-12.0-pos_order_to_sale_order
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_to_sale_order/
Currently translated at 100.0% (23 of 23 strings)

Translation: pos-12.0/pos-12.0-pos_order_to_sale_order
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_to_sale_order/es/
Currently translated at 100.0% (23 of 23 strings)

Translation: pos-12.0/pos-12.0-pos_order_to_sale_order
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_to_sale_order/pt_BR/
Return module's javascript widgets to make them extendable for other modules.

Same idea as OCA#535
…) is null, that occures if pos_restaurant is installed
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-12.0/pos-12.0-pos_order_to_sale_order
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_to_sale_order/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-12.0/pos-12.0-pos_order_to_sale_order
Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_to_sale_order/
@lbarry-apsl
Copy link
Member

@pedrobaeza , It didn't work, do you know why?

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

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.

OCA-git-bot added a commit that referenced this pull request Sep 22, 2025
Signed-off-by pedrobaeza
@OCA-git-bot
Copy link
Contributor

@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.

@lbarry-apsl
Copy link
Member

@benwillig , I think the JS tests aren't passing, could you check it?

@benwillig
Copy link
Author

@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

@benwillig
Copy link
Author

I updated the styles of the button to match the default one

image

Also added pos_session_id on sale.order

…ale order + changed the way to display buttons
@benwillig benwillig force-pushed the 18.0-mig_pos_order_to_sale_order-bwi branch from f87a9f3 to ec17e81 Compare September 26, 2025 14:09
@ivilata
Copy link

ivilata commented Nov 13, 2025

Thanks @benwillig for the PR updates! The following OCB tests do fail, though:

  • test_frontend.TestDivideOrderSummary.test_divide_order_summary
  • test_frontend.TestLotScanning.test_scan_lot_number
  • test_frontend.TestLotScanning.test_scan_to_input_lot_number
  • test_frontend.TestDisplayOrderNumber.test_display_order_number
  • test_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? 🤷

Update 2025-12-02: The PR is already on top of the latest commit, please disregard my suggestion to rebase/force-push.

@ivilata
Copy link

ivilata commented Dec 1, 2025

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!

@pedrobaeza
Copy link
Member

Which tests are failing here in GitHub?

Copy link

@fabiandumaguala fabiandumaguala left a comment

Choose a reason for hiding this comment

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

LGTM

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-1429-by-pedrobaeza-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Dec 1, 2025
Signed-off-by pedrobaeza
@OCA-git-bot
Copy link
Contributor

@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.

@ivilata
Copy link

ivilata commented Dec 2, 2025

@pedrobaeza: The tests that fail are the ones that I listed in #1429 (comment). They fail both in GitHub's CI and when run locally.

@pedrobaeza
Copy link
Member

But it's due to this module or they are failing in general?

@ivilata
Copy link

ivilata commented Dec 2, 2025

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. 🙂

@pedrobaeza
Copy link
Member

Then they should be fixed before merging this.

@ivilata
Copy link

ivilata commented Dec 3, 2025

@pedrobaeza @benwillig: I traced back the errors in the other modules to a bug introduced in upstream Odoo 18 in commit odoo/odoo@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! 🙂

(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.)

@niboo-ave
Copy link

Hello,

On my local I have a warning : Component 'CreateOrderButton' does not have a static props description

@niboo-ave
Copy link

After some test we also notice that when a pos order customer have a price list with discount, and that we create a SO from the pos: each SO have the unit price = to price with the discount and that discount is at False.
This seems to come from the POS order serialisation that is not precise enough.

I do not have any solution so far for this. But I guess it's worth it to let you know

@niboo-ave
Copy link

After some test we also notice that when a pos order customer have a price list with discount, and that we create a SO from the pos: each SO have the unit price = to price with the discount and that discount is at False. This seems to come from the POS order serialisation that is not precise enough.

I do not have any solution so far for this. But I guess it's worth it to let you know

After longer investigation, this make sens that odoo standard do it this way because it's easier to apply a discount per line that is not "cumulated".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.