-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
[16.0][MIG] sale_variant_configurator: Migration to version 16.0 #353
[16.0][MIG] sale_variant_configurator: Migration to version 16.0 #353
Conversation
This comes from module sale_product_variants from odoomrp/odoomrp-wip.
- saleable products for Sale Orders. - purchable products for Purchase Orders.
Depending on the onchange order loaded in runtime, description put in the SO line might be the one got from the regular way. With this, we assure we get the proper description, and also in the partner language (using the trick with the partner field).
* Use generic method for creating the variant if needed * Create the variant when the sales is already confirmed
for some reason, after the creation of the product, the sale.order.line was emptied (e.g. product_tmpl_id was False) -> the onchange would do nothing. I split the test in two, and in the second test, I create the product before creating the sale order line.
…omer language As the model `sale.order.line` doesn't have `partner_id` field, the description is not populated in the customer language, as the automatism put in product_configurator makes use of this trick. For not adding such field that can conflict with other parts, let's overwrite the methods that populate the description and pass upstream the customer language in the context. TT33029
b7a0cb3
to
56719b7
Compare
56719b7
to
8fe21e7
Compare
8fe21e7
to
2310a93
Compare
24ce980
to
3abf68d
Compare
On v16, AFAIK, there are no more onchanges in |
ea65719
to
75bf84c
Compare
The only one missing was _compute_name, could you please check it now? |
052e9f7
to
511e6a6
Compare
/ocabot migration sale_variant_configurator |
@@ -48,6 +49,7 @@ class ProductConfigurator(models.AbstractModel): | |||
) | |||
def _compute_can_be_created(self): | |||
for rec in self: | |||
rec.price_extra = sum(rec.mapped("product_attribute_ids.price_extra")) |
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.
A computed can't assign other value outside of their definition.
511e6a6
to
2351a7b
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.
/ocabot merge nobump
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 652eb8d. Thanks a lot for contributing to OCA. ❤️ |
…lly bump versions Changes have been merged with nobump in PR OCA#353
@Tecnativa
TT46599
@pedrobaeza @pilarvargas-tecnativa