Skip to content

Commit

Permalink
exclude no variant attributes from simple variant wizard
Browse files Browse the repository at this point in the history
reason: attributes with detailed type set as multi are
cosidered as no variant, hence no variants are created
for them. This ensures variants products purchased are
aligned with SOs.

without this fix, product variants including multi type
attributes results in received stocks for POs not being
consumable by SOs sharing matching configurable options
  • Loading branch information
ofelix03 committed Nov 7, 2024
1 parent ff40606 commit a6aeda2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def _onchange_product_tmpl(self):
if self.product_tmpl_id:
lines = line_model.browse()
pending_variants = self.product_tmpl_id.attribute_line_ids
pending_variants = pending_variants.filtered(
lambda tmpl_att_line: tmpl_att_line.attribute_id.display_type != "multi"
)
for line_data in [
{
"attribute_id": attribute_line.attribute_id.id,
Expand Down Expand Up @@ -142,7 +145,9 @@ class WizardCreateVariantLine(models.TransientModel):
required=False,
)
attribute_id = fields.Many2one(
comodel_name="product.attribute", string="Attribute", required=False
comodel_name="product.attribute",
string="Attribute",
required=False,
)
attribute_value_ids = fields.Many2many(
comodel_name="product.attribute.value",
Expand Down

0 comments on commit a6aeda2

Please sign in to comment.