-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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
[FIX] pos_self_order_sale: check if the field really exists #161921
[FIX] pos_self_order_sale: check if the field really exists #161921
Conversation
@@ -9,5 +9,9 @@ class ProductProduct(models.Model): | |||
def _get_product_for_ui(self, pos_config): | |||
self.ensure_one() | |||
product = super()._get_product_for_ui(pos_config) | |||
|
|||
if "optional_product_ids" not in self.env["product.product"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be better but I'm not sure
product_configurator = self.env['ir.module.module']._get('sale_product_configurator')
if product_configurator.state != 'installed':
return product
``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me if there is no better way
the clean way to do this would be to have a bridge between pos_self_order
and sale_product_configurator
and do this override in that bridge but it would mean adding a new module (that I think needs an exception and so on)
the other nearly clean way would be to:
- add a method
_get_product_for_ui
returning eg. empty dict inpoint_of_sale
- transfer this override to
pos_sale_product_configurator
- modify the method in
pos_self_order
so it calls the new method from point_of_sale and extend the dictionary
but maybe it's too many changes not worth the hustle.
When the module "sale_product_configurator" is not installed, an AttributeError is raised Steps to reproduce: Install the "point_of_sale" app, the "pos_self_order_sale" module and remove the "sale_product_configurator" module Go to settings -> point of sale -> Self ordering: QR Menu -> preview web interface Cause: The field "optional_product_ids" is provided by the module "sale_product_configurator" which is not a dependency of this module opw-3850421
dce8b99
to
a1d697c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
robodoo r+
When the module "sale_product_configurator" is not installed, an AttributeError is raised Steps to reproduce: Install the "point_of_sale" app, the "pos_self_order_sale" module and remove the "sale_product_configurator" module Go to settings -> point of sale -> Self ordering: QR Menu -> preview web interface Cause: The field "optional_product_ids" is provided by the module "sale_product_configurator" which is not a dependency of this module opw-3850421 closes odoo#161921 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
When the module "sale_product_configurator" is not installed, an AttributeError is raised
Steps to reproduce:
Cause:
The field "optional_product_ids" is provided by the module "sale_product_configurator" which is not a dependency of this module
opw-3850421
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr