8000 [18.0][MIG] product_variant_configurator: Migration to 18.0 by BhaveshHeliconia · Pull Request #385 · OCA/product-variant · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[18.0][MIG] product_variant_configurator: Migration to 18.0 #385

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

Open
wants to merge 89 commits into
base: 18.0
Choose a base branch
from

Conversation

BhaveshHeliconia
Copy link
Contributor

No description provided.

zakmak88 and others added 27 commits March 31, 2025 15:26
This module has been ported from the odoomrp repo.
the module name in the odoo mrp repo was product_variants_no_automatic_creation
the following improvement where done while porting this module:

* Improve the readme file with a technical description on how the module should
  be used with other modules.
* Add attribute col=4 to group parent for a better desplay of product category
  for view.
* Remove unnecessary @api.multi before compute or onchange methods.
* Move product.configurator.attribute model to the new
  product_configurator_attribute.py file.
* Add unit test for product.configurator.attribute model that includes test for
  _compute_possible_value_ids and _compute_price_extra methods.
* Rename XML files in views and security folder as per OCA guidelines.
* Improve test coverage for product_configurator.
* Add unit test for purchase.order and purchase.order.line models.
* Separate the purchase.order and purchase.order.line models code into two files.
* Rename XML files as per OCA guidelines.
* product_variant_configurator: set product_tmpl_id in
  onchange_product_id_product_configurator_old_api and
  onchange_product_id_product_configurator methods for product.configurator model.
* Add unit test for onchange_product_tmpl_id and onchange_product_attribute_ids.
…doomrp repo. the following improvements were done while porting this module:

* Adapt files as per OCA guidelines.
* Add unit test
What helps is setting the many2many_tags which seems to have an
influence even though the field is invisible. Without this you sometimes
get a warning asking if you want to discard the last change.
Setting the computed field readonly is also good practice.

[IMP] new api style in onchange for updating attributes list
[IMP] better to avoid overrides of onchange method (OCA#2)
[REF] refactoring of the onchanges

This should be easier to understand and cover all cases of
changing product template and product in any order, so you
always get a consistent list of attributes.

[FIX] fix tests in purchase_product_variant_configurator

[FIX] avoid systematic warning when creating new product templates
because I don't know how to emulate a true onchange that
populates _origin
… are for sale only

plus, fix the visibility rule of the button,
to show the button if there are attributes on the product
(otherwise it would stay hidden until the first 2 variants
have been created)

[FIX] more robust configurator onchanges

[FIX] return values for onchange_product_attribute_ids
…vepoint to discard created product variant in case of exception
* Issue with cache invalidation on create
* remove unused _create_variant_from_vals
* hide price_extra not applicable to purchase for now
* remove import on removed procurement_order.py file
* Fix tests in purchase_product_variant_configurator
* Fix tests in product_variant_configurator
…elete' attribute on the field owner_id declared as Integer is required since this field is declared as inverse of the field product_attribute_ids of the abstract model product.configurator
With this, you can decide at product level which attributes are required
to be filled. Default is true for keeping the same logic with previous
version.
…_on_confirm tests

We need to add this for avoiding an odoo.exceptions.AccessError due
to some refactoring done upstream on read method + variant name_get
in Odoo. With this, we avoid to call super on the specific case of
virtual records, providing simply the name, which is acceptable.

This was used in `purchase_variant_configurator_on_confirm` module for increasing
inheritability playing the purchase.order.line product onchange on a virtual
record.
In some cases, like MTO/drop-shipping automatic purchase order line creation,
`product_tmpl_id` and `product_attribute_ids` fields appear empty, because only
`product_id` is supplied. We recreate them from the product_id overwriting
generic `create` method and providing proper values.
…tive onchanges

Use case:

* You have selected a product variant.
* Now you change one of the attributes.
* The resulting combination still has no product variant, so the field `product_id` is emptied

Before this patch:
The onchange of the product_id empties all the selected attribute values

After this patch:
The onchange doesn't modify attribute values

There's no special reason for covering the case of product_id empty and
product_tmpl_id not empty in onchanges, as they are generated in UI, and
thus the onchange of `product_tmpl_id` must be triggered for this case.
Currently translated at 100.0% (47 of 47 strings)

Translation: product-variant-11.0/product-variant-11.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-11-0/product-variant-11-0-product_variant_configurator/es/
mymage and others added 29 commits March 31, 2025 15:26
Currently translated at 20.7% (22 of 106 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/it/
Currently translated at 41.5% (44 of 106 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/it/
Currently translated at 100.0% (106 of 106 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/it/
This fix solves a recursion problem caused when the groupby refers to a
field of a many2one model, and that model also has the same field name.
In this example, the stock.valuation.layer.tree view contains a groupby
product_id, and the product.product model already has a product_id field,
relating to the same model. Without this code we would reach a recursion error
Currently translated at 100.0% (107 of 107 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/es/
Currently translated at 100.0% (107 of 107 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/it/
Currently translated at 100.0% (106 of 106 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
EDBE

Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/es/
Currently translated at 100.0% (106 of 106 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/it/
Currently translated at 100.0% (107 of 107 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/it/
Co-authored-by: Alexandra Bottemanne

TT46596
Currently translated at 100.0% (113 of 113 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/it/
Currently translated at 8.8% (10 of 113 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/pt_BR/
Currently translated at 12.3% (14 of 113 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_configurator/pt_BR/
Currently translated at 100.0% (105 of 105 strings)

Translation: product-variant-17.0/product-variant-17.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-17-0/product-variant-17-0-product_variant_configurator/it/
Currently translated at 100.0% (105 of 105 strings)

Translation: product-variant-17.0/product-variant-17.0-product_variant_configurator
Translate-URL: https://translation.odoo-community.org/projects/product-variant-17-0/product-variant-17-0-product_variant_configurator/it/
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-product_variant_configurator branch from 179ffb0 to bac776d Compare March 31, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0