Commit Graph
17 Commits
Author SHA1 Message Date
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Pierre Pulinckx (pipu) c07181b20b [REF] *: Replace env._t() by _t()
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :

<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>

task-3292454

closes odoo/odoo#131390

Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-18 19:17:16 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Mathieu (mano) 4e48c6d6de [IMP] sale,purchase: product matrix revamp v16
The product matrix was recently converted to OWL but the design was not
adapted to v16 style.

This commit revamps the table to better fits Odoo 16 design.

The previous table had issue with wrong color in dark mode and the
table head title were not aligned with the inputs.

task-3074063

closes odoo/odoo#107102

Related: odoo/enterprise#34743
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-15 12:37:01 +01:00
Valentin Chevalier c27bdaf863 [IMP] (sale_,purchase_)product_matrix: use OWL Dialog system
Product configurators were migrated to Owl, but some legacy code was
kept as not urgent to migrate (not required to drop the compatibility
layer of views).

This commit focus on the 'matrix' (or grid) configurator.

task-3056594

closes odoo/odoo#105841

Related: odoo/enterprise#34401
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2022-11-25 17:55:59 +01:00
Victor Feyens 99b2095f97 [REM] product_matrix: previous javascript logic based on section&note
Widgets have been converted to owl and use a different logic to apply
changes from the SOL to the SO level.

Task-2918791

X-original-commit: 87c5f6f2007ca71a14f58bab10bb1637d3647921
Part-of: odoo/odoo#101352
2022-09-28 11:14:36 +02:00
stefanorigano (SRI) bd2a1110a0 [REM] *: drop o_cursor_default & o_cursor_pointer classes
Drop custom cursor classes in favor of Bootstrap default ones.
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:12 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
stefanorigano (SRI) c9d58ecca4 [IMP] web,*: o_cursor_default utility-class
This commit is part of v16 overall restyle, task-2704984.

task-2797245

closes odoo/odoo#86626

Related: odoo/enterprise#25365
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-03-21 14:01:03 +01:00
Kamen Zhekov 2b832269f4 [IMP] sale*: merge configuring products and opt. products modals
The changes concern the following modules:
- sale
- sale_product_configurator
- website_sale
- website_sale_product_configurator

When optional products are enabled and a user adds an item to the cart, the
modal popup does not allow further modifications to the main product based
on its template. If the user wants to change the color or the material, they
have to close the popup, modify the product and open it back up.

The same is applied when Add to Cart is active, and the user cannot configure
the product at all after clicking the add to cart button.

This change will make it possible to change the product variants without having
to close the modal, and configure the product when using the "Add to cart"
button when it's enabled.

The added configuration step is needed for some cases like the following:

1. When adding a product that had variants directly from the /shop page before,
the first variant was added by default and configuring it was impossible without
explicitly going on the product's page and configuring it from there. This 
behaviour made no sense, and it's the reason the "optional products modal"
(which should no longer be called that) is opened when the product is not 
configured even if there are no optional products.
2. When going through the product's page, and there are optional products enabled
for the product getting configured, then it's nice but not necessary to be able to 
configure the product further while choosing and configuring the optional products.
This doesn't add an extra step in any case, it just makes it possible to still configure
your product in the modal.
3. If there are no optional products, the configuration made on the product's
page is taken into account and the product is directly added to the cart without 
opening the modal, which is the same behaviour as previously.

Only one modal is shown, depending on the situation:

- For the website flow, if the product is not configured and has variants or has
optional products (or both), a popup shows that allows for configuration + 
choosing and configuring optional products.
- For the sales flow, there was already a configuration popup, so the optional
products modal is only shown when there are optional products and replaces
the first instead.

Some tests were adapted to function with the new product configuration modal:

- The steps checking for the text mentioned above are removed
- Triggers were adapted to the modal for products that were previously added to cart
  with their default variant
- Various other small adjustments

task-2541663

closes odoo/odoo#73086

Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-08-30 13:27:44 +00:00
Xavier Morel 618562802e [IMP] [sale_]product_matrix: remove t-raw
Using `sale_product_matrix`'s tour as `product_matrix` doesn't
actually have any test for this.

Remove t-raw from the product_matrix(.extra_price) template, by moving
the formatting to the client side (unclear why it was done by the
server in the first place).

Also fixes a bug where a negative price_extra would have *two* `-`
signs: one before the currency, and one after the currency: the price
being formatted should be abs'd to avoid a negation being generated by
the monetary formatting. Also uses non-breaking spaces everywhere
where the server-side formatting mixed breaking and non-breaking
spaces. Keeps from the original the peculiarity that the extra price
should always have a sign positioned before prefix currency signs.

Also changes the calling conventions of `product_matrix.extra_price`:
instead of being called with a formatted `price` it's now called with
the entire cell object.
2021-07-20 05:41: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
Victor Feyens 42fc0f4910 [FIX] product_matrix: matrix edition on a new record.
Probably since recent js framework changes, when trying
to modify the matrix of a product on a new SO (not saved),
a js error was raised (wrong qweb template rendering).

This is due to a wrong check when loading the matrix data,
in the case of a new record, the data wasn't correctly updated
on all widgets, resulting in an opening of the matrix with the results
of the last matrix changes (since the information is transferred in the same field).

This commit:

* Ensures that the correct data is taken to open the matrix (solving the main
problem of matrix update on new records)
* Improves test coverage to cover untested buggy situation
* Fixes another error found while improving test coverage:
The edition of existing quantities was wrongly creating new lines, instead of updating
existing ones.  Simplify lines comparison to ensure the matrix won't generate two lines
for the same variant combination.

closes odoo/odoo#54917

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-07-29 13:46:46 +00:00
Victor Feyens d0d52743b7 [FIX] web,product_matrix: Do not trigger event on parents.
X-original-commit: 127a75ed5c746291f9b0b7466d8935c83abc32a0
2019-11-21 15:31:30 +00:00
Victor Feyens 21bcafc053 [FIX] product_matrix: ensure the data is taken from a targeted widget.
X-original-commit: 44462e11ddba648d64fb75997e3f87a877c642eb
2019-11-21 15:31:30 +00:00
Victor Feyens 3c6437710a [IMP] *_product_matrix: UI 2019-08-20 14:02:29 +00:00
Victor Feyens e6c2975e76 [ADD] (sale/purchase)_product_matrix 2019-08-07 12:50:09 +00:00