Purchase - Product variants
purchase_variant_configurator · OCA/product-variant
purchase_product_variants (9.0) · purchase_variant_configurator_on_confirm (16.0)-
Security25/25No findings
-
Activity20/25Last human commit 7 months ago
-
Required by5/250 modules depend on it
-
Maturity25/25In 7 Odoo series since 9.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `UPDATE purchase_order_line AS line SET product_tmpl_id = product_product.product_tmpl_id FROM product_product WHERE line.product_id = product_product.id;` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
This module allows you to create the product variant when a purchase order is confirmed. It adds to the purchase line a product configurator, so that selecting a product and its attributes can be created a new product variant.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 2
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
purchase_order_extended_form_view |
purchase.order.extended.form | purchase.order | form | Inherits purchase.purchase_order_form |
res_config_settings_view_form_purchase |
res.config.settings | form | Inherits purchase.res_config_settings_view_form_purchase |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 7
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (2)-
search(self, args, offset=0, limit=None, order=None)@api.modelHACK: With NewId, the linked product_tmpl_id won't be a proper interger that we can use in a search. As we need it to get the proper pricelists we'll be passing it by context. The propper solution would be to use `self.product_tmpl_id._origin.id` in `_prepare_sellers`: https://github.com/odoo/odoo/blob/13.0/addons/product/models/product.py#L588 -
sorted(self, key=None, reverse=False)
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (2)-
button_confirm(self)Create possible product variants not yet created. -
copy(self, default=None)Change date_planned for lines without product after calling super
-
product_idMany2onerequired=False -
product_id_is_requiredBooleancompute='_compute_product_id_is_required' -
product_uom_idMany2onecompute='_compute_product_uom_id'readonly=Falsestore=True
-
create(self, vals_list)@api.model_create_multiCreate variant before calling super when the purchase order is confirmed, as it creates associated stock moves.
-
po_confirm_create_variantBooleandefault=Truehelp='Create product variants when confirming'string='Create variants on confirm'
No public methods.
-
po_confirm_create_variantBooleanreadonly=Falserelated='company_id.po_confirm_create_variant'
No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…