odoo-shopinvader icon indicating copy to clipboard operation
odoo-shopinvader copied to clipboard

[13.0][IMP] shopinvader_product_variant_selector: multi_variation

Open qgroulard opened this issue 3 years ago • 2 comments

The goal of this PR is to achieve something similar to amazon's feature

multi_variation is a way to inform the customer that a combination does not exists and will need other attributes to change in order to satisfy his request.

I.e. considering the example given in the readme:

Imagine a case where you have shoes with - 6 sizes: 15, 16, 17, 18, 19, 20 - 3 colors: Green, Red, Yellow

and some exceptions: - Green is available in size: 18, 19 - Red is available in size: 15, 16, 17 - Yellow is available in size: 18, 19, 20

size : 15, 16, 17, [18], 19, 20
color : Green, (Red), [Yellow]

[] mean selected
() mean not available

In this case, size 16 is multi_variation=True, indicating that if you select size 16 not only the size will change but also the color since the shoes don't exist in Yellow 16.

qgroulard avatar Nov 10 '21 14:11 qgroulard

@sebastienbeau

This PR makes me question the point of selected_values: https://github.com/shopinvader/odoo-shopinvader/blob/d7e743ec32f8502b1698fae67bada8f3829bdfa8/shopinvader_product_variant_selector/models/shopinvader_variant.py#L75

In the example above:

size : 15, 16, 17, [18], 19, 20
color : Green, (Red), [Yellow]

[] mean selected
() mean not available

Why is Red unavailable ? Why couldn't we select Red and automatically switch to size 15, 16 or 17 ? This is exactly the same as selecting Yellow 16 which turns into Red 16.

IMO we could get rid of this constraints, even more with this PR which clarify such situations.

qgroulard avatar Nov 10 '21 14:11 qgroulard

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar Mar 24 '24 12:03 github-actions[bot]