Commit Graph
5 Commits
Author SHA1 Message Date
wan fa034b2a64 [IMP] *: product back2basics 15.0
Rework the whole view, generally.

task-2605931

Part-of: odoo/odoo#75862
2021-09-07 15:50:00 +00:00
Antoine Vandevenne (anv) 897a4baecf [IMP] product(_matrix): clean demo product for matrix
Before this commit, the product 'My Company Tshirt' had too much PTAL and PTAV which lead to an overloaded matrix.

This commit removes the 'Sleeves' attribute, reorder the other attributes and remove the Size attributes '2XL' and '3XL'.

task-2052537

closes odoo/odoo#37543

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-09-30 11:57:18 +00:00
Antoine Vandevenne (anv) 06bd183ec2 [IMP] product(_matrix), *: add configurator hint to template name
Before this commit, it wasn't easy to find a demo product template that opens either with the product configurator or with the matrix from a list view.

To fix that, this commit appends '(CONFIG)' to the name of all demo product templates that open with the product configurator and '(GRID)' to all demo product templates that open with the matrix.

task-2052537
2019-09-30 11:56:24 +00:00
Sébastien Theys 22a11a6f4d [REF] product, *: save product.template.attribute.value on variants
* account, hr_expense, mrp, sale, sale_product_configurator, stock_account,
  website_sale, website_sale_comparison

Before this commit, the `product.attribute.value` were stored on the variants.
This required filtering of attribute lines to find the appropriate matching
`product.template.attribute.value` that were used in most of the business code,
such as when computing the `price_extra`.

This also prevented to have multiple attribute lines for the same attribute,
which is needed to handle use cases such as grape varieties for wine products.
This will be done in the following commit.

After this commit, the combination of `product.template.attribute.value` will be
directly stored on the product variant.

Other changes
=============

Add `combination_indices` on product, which allows to quickly find a variant
matching a combination (1 simple indexed equality query as opposed to 1 query
with as many joins as there are attribute lines), and to add an easy
SQL constraint to ensure active combination uniqueness.

Add active field on `product.template.attribute.line` and
`product.template.attribute.value`, with the same behavior as variants:

They become archived if they can't be unlinked. This allows to keep the database
consistent, such as archived variants correctly keeping all their values, sales
order lines keeping their custom and no_variant. This is done with the help of
`ondelete=restrict` on the corresponding m2m fields, and the `unlink` methods
falling back to archiving when `unlink` is restricted.

Part of task-1912579

PR: #32946
2019-08-26 13:01:13 +00:00
Victor Feyens e6c2975e76 [ADD] (sale/purchase)_product_matrix 2019-08-07 12:50:09 +00:00