Commit Graph
14 Commits
Author SHA1 Message Date
Achraf (abz) d907f86b4e [FIX] purchase_product_matrix: Allow to change PO lines order
What are the steps to reproduce your issue ?

    1. Install 'purchase_product_matrix'
    2. try to edit a PO with more than one line
    3. try to change the order of a product line

What is currently happening ?

    Traceback: TypeError: Cannot read property 'data' of undefined

What are you expecting to happen ?

    Change order lines without traceback

Why is this happening ?

    There is a function 'reset' that checkes if 'ev' exists:
    https://github.com/odoo/odoo/blob/e0af10ccc92cb3b07f0eea6fa44ebf5a1bdc86aa/addons/sale/static/src/js/product_configurator_widget.js#L119

    And in 'purchase_product_matrix' there is a override of this same function that calls it
    and then tries to use an 'ev' attribute without checking it before

How to fix the bug ?

    Check 'ev' before accessing it

opw-2513061

closes odoo/odoo#69856

X-original-commit: 25312bc576b9e0330eb316e77d8a177ee0434832
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-04-26 15:26:39 +00:00
Andrea Grazioso (agr-odoo) b937c3fdfa [FIX] purchase_product_matrix: avoid crash on product reorder
Open a purchase order with several lines
Switch to Edit mode
Use the movement arrow on the left of a line to move it upward/downward
At the end of the operation a traceback will popup

opw-2508480

closes odoo/odoo#69724

X-original-commit: 0d7c9db6d17e3268ae01a5b2d79b513c5b24a34f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-04-22 17:51:47 +00:00
Anh Thao Pham (pta) 30879f9ff1 [FIX] purchase_product_matrix: fix product onchange on PO form
- Install purchase_product_matrix
- Go to Purchase and create a PO
- In PO Line, type a text (i.e. test) in product field and use quick create option
Description and UoM fields should be updated following product creation, but they are not.
"onchange_product_id" is not triggered.

"purchase_product_matrix" module overrides "purchase.order" form view by replacing product_id
field by product_template_id field.
"_onFieldChanged" function should execute "_onTemplateChange" when product_template_id is changed
and if id is set, which would trigger "field_changed" on product_id, but it cannot be done after
a quick create as id is false.

opw-2462538

closes odoo/odoo#67605

X-original-commit: 3c082b9a47be35579a454f13edc230ac3029922d
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-03-10 15:43:06 +00:00
Aaron Bohy 665e25c2de [FIX] (purchase|sale)_product_matrix: adapt tour
In the same spirit as [1], this commit removes a non deterministic
cause of product_matrix tours fail. Since the enabling of the quick
edit feature, the 'Add a product' link is also present in readonly.

[1] https://github.com/odoo/odoo/commit/e167f4aeae877e1a6ea82415467e82249328b1e4
2021-02-12 06:36:36 +00:00
Aaron Bohy ce3c743299 [FIX] web, purchase_product_matrix: can open twice the matrix
Let's assume the following scenario with 'purchase_product_matrix'
module installed:
 - create a new Purchase Order
 - add a line in the one2many
 - select "Customizable desk" as product
 - [the desk matrix opens]
 - close the matrix
 - select "Conference chair" instead
 - [the desk matrix opens, whereas it should be the chair one]

It didn't work because of a small bug in the FieldOne2Many. This
field is configured to be reset when any other field in the view
changes. The product configurator feature relies on that. However,
when another field changes, the One2Many didn't update its internal
state with the new record (and it skipped the rendering, which is
fine). The matrix product configurator thus read an obsolete value
in the internal of the one2many.

Since the internal state is now always up-to-date, we can directly
read there the grid information, instead of looking inside other
fields that have been updated (attempt done in [1])

It would be nice to rethink the whole product configurator stuff
in master, to make it more robust, maybe when converting it to owl?

[1] https://github.com/odoo/odoo/commit/21bcafc053be7f80eed7a684fee2dc1e3caaafa5

opw~2421798

closes odoo/odoo#64683

X-original-commit: 69cadbe1be6320d96fe9bc5bf8dd808f87d735c0
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-01-18 12:39:24 +00:00
yhu-odoo 2c5ce41c42 [IMP] uom: change default rounding to two
Change the default rouning digits of all UoMs to be two, also change the
decimal.precision of UoM to be two. Adapt all the tests.
Also to avoid hardcoded digits in `should_consume_qty` widget.

PR #56000

X-original-commit: 460ec0402a2352a5b179d81935f7230f6bc97cb7
2020-09-09 09:21:12 +00:00
Yannick Tivisse 1ba9bef148 [FIX] purchase_product_matrix: Fix product creation from PO line
closes odoo/odoo#49829

Taskid: 2234570
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-21 08:19:20 +00:00
Sébastien Theys ff912bf520 [FIX] *_product_matrix: properly wait edit mode before clicking
Backport of e167f4aeae
And also applied to purchase.

closes odoo/odoo#49802

X-original-commit: e2672f1b60575f03cbbf5d64cf3901ebcc49a2ea
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-04-20 15:16:49 +00:00
Romeo Fragomeli ab2e3fdb7d [REF] *: add tour steps utils
This commit moves some step utils in a dedicated file and add new ones.
These steps will be very useful for the Main Flow Tour to avoid
duplicated code.

To do this, we also had to transform it into functions to allow
utils to call each other. Existing one are converted for
standardization purpose.

Note that 'WEBSITE_NEW_PAGE' wasn't considered as an util.
This is a very simple step only used twice.
2020-03-11 10:10:16 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
Victor Feyens c32e9a4788 [ADD] (*_)_product_matrix: test tours
closes odoo/odoo#40971

X-original-commit: d729460f5fc72aa70e0a024e1dff281299eed0e3
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-11-27 15:49:57 +00:00
Victor Feyens 6c80003208 [ADD] purchase_product_matrix: tests
as we cannot do the test in product_matrix, add the purchase equivalent
in purchase_product_matrix to also test the matrix in this case.

X-original-commit: 9d7024a5327939de3c145928782936000d26bd33
2019-11-21 15:31:30 +00:00
Victor Feyens e6c2975e76 [ADD] (sale/purchase)_product_matrix 2019-08-07 12:50:09 +00:00