Commit Graph
4859 Commits
Author SHA1 Message Date
Damien Bouvy 1e706d3069 [IMP] web, *: milk adaptations
*: hr_holidays, stock, sale, product, web, sale, purchase, stock,
   website, survey

Adapt some custom control panels (mainly for custom reports) to the
milk controlpanel.

hr_holidays:
Move the buttons to create a new time off or a new allocation to the
"create button" slot and transform it into a dropdown (creating
allocation requests is clearly a secondary action, not a primary one)

stock:
3 lines does not fit, must be on 2 lines

Part-of: odoo/odoo#116641
2023-05-12 22:59:19 +02:00
Elisabeth Dickinson b2ef35a431 [IMP] *: replace .bg-color by .text-bg-color on ribbons
Also remove unnecessary CSS on ribbons.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
Preksha Chouhan 19aef6396c [FIX] product: prevent getting value of domain from other method
While creating a new product in product category with barcode value in inventory
module, `_check_barcode_uniqueness` method is called. In which variable 'domain'
is passed, and getting wrong value.

Steps to Produce:-
1) Go to Inventory then configuration
2) Click on 'Product Categories' under products
3) Click/Create Product Category
4) Click stat button 'product'
5) Create a product
6) Then add barcode value
7) Click on Save
8) Trace-back will be generated

Reason:-

While creating new product from product category when user add the barcode value
in product form, the '_check_barcode_uniqueness' method is called. In this
method the value of 'domain' is getting updated by reference from variable
'domain' from method '_search' present in the same model.
This results in a traceback with the message

'Invalid field product.packaging.categ_id'.

Applying these changes will resolve this issue.

sentry - 4073963761

closes odoo/odoo#121072

X-original-commit: ce9889e314ae696773ce040f662569e281abe700
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2023-05-11 10:40:58 +02:00
clesgow 459760c422 [FIX] product: hide barcode when with dynamic variants
Steps to reproduce:
- Inventory -> Configuration -> [Products] Attributes
- Create new Attribute with 'Variants Creation Mode' set to
'Dynamically' with a few values
- Inventory -> Products -> Products -> New
- Set the new dynamic attribute to the product and save
- If you try to set a barcode, the field will empty itself at each save

When a product is created with 'Dynamic' attributes, the variants will
only be created once the combination of attributes is used. So initially
there is no variant, hence nowhere to set the barcode.
So we avoid letting the attribute being set when there is still no
variant.

Part of task-3218314

Part-of: odoo/odoo#119381
2023-05-09 21:04:03 +02:00
Julien Mougenot 10dc896c1e [REF] *: Adapt views to Owl DateTimePicker
This commit follows the addition of the OWL date picker and intends to:

- update views calling daterange widgets to use the new syntax (and
remove the end date field from the view in most cases);

- change the remaining components extending the previous DatePicker and
DateTimePicker components.

Part of task 3121497

Part-of: odoo/odoo#112171
2023-05-05 13:52:22 +02:00
Damhaut Florian (flda) cee32aa16e [FIX] product: Improved error message for pav deletion
What are the steps to reproduce your issue?
- Create a product with more than one attribute.
- Let say color White, black and purple
- Create a 'draft' invoice for the purple product variant
- Remove the 'purple' attribute value from the product
- It will archive that variant (because the account.move linked to it)
- Try to delete the attribute value from menu Sales > Cofinfiguration > Attribute

What is the current behavior that you observe?
- technical error message

What would be your expected behavior in this case?
- non-technical message for end-users

Solution :
- Change both message to tell user he cannot delete the value if the value has been referenced somewhere else.
opw-2623583

missing forward-port of db1e52f0234f73e1bda22a411baba7b1f0994d5a

closes odoo/odoo#120495

X-original-commit: 0c8c43d50a574d73d9d5ac925eb16faf730a76ba
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-05-04 12:15:21 +02:00
Alexandre Kühn 9f115fce17 [FIX] mail,*: fix style in 1st column of activity view
Task-3290752

closes odoo/odoo#120189

X-original-commit: a97c86a2b962f56955e3c16b7ad99cabb0b13b9c
Related: odoo/enterprise#40564
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-03 17:24:58 +02:00
Rémy Voet (ryv) 302c7baa87 [REM] core,*: remove name_get_uid parameter from _name_search.
`name_get_uid` is unused (at least since v14) and the
documentation about it, is wrong.

closes odoo/odoo#117819

Related: odoo/enterprise#39483
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-04-28 16:04:27 +02:00
Demesmaeker 4c701ab1fc [FIX] product: only activate pricelists when enabling pricelists
Following 83c52575d0 we activated or created pricelists as soon as a
currency was activated/created/deleted, for every company that might already have another
pricelist setup done, which was quite confusing.

With this fix, we ensure this will only happen:
- at company creation
- when enabling the pricelist feature
- when enabling the multi-currency setting (only the first time, unless the pricelists were
disabled manually afterward)

closes odoo/odoo#120039

X-original-commit: 4c0146d939e40e9433794802388cf06147e716f2
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-04-28 09:53:12 +02:00
niyasraphy 1e7127c92e [FIX] product: traceback on deleting category
before this commit, when deleting a product
category from a db where expense category
is already deleted before this commit [1]
is raising exception

after this commit, exception wont be shown
in existing db where expense category is
deleted.

1 https://github.com/odoo/odoo/commit/09e4b2fb586ac83adb984672e027ce6dd62affb2

closes odoo/odoo#119754

X-original-commit: 20b5518110b233ba3b59158a8362db04b9a89aad
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-04-27 10:13:10 +02:00
Julien Carion (juca) eaacaf122d [IMP] web, *: Add autoresize hooks
This commit adds two autoresize hooks for text inputs and textareas to
make it adapt their size (width for text inputs, height for textareas)
depending on their content.
The commit therefore solves the issue of several form view task titles
being restricted to 1 line while it can be annoying if the title is too
long. The autoresizeTextarea feature was moved from TextField to the
autoresizeTextarea hook and the autoresizeInput feature was moved from
the AutoresizeInput mail component to the autoresizeInput hook.
The TextField component has a new option for disabling linebreaks.

task-3138826

closes odoo/odoo#117355

Related: odoo/enterprise#39493
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-25 14:07:15 +02:00
Pierre Masereel 44f5881511 [FIX] product: give correct currency when computing based pricelist
When your pricelist item price is based on an other prcicelist in
another currency, the wrong currency is given to the function
_get_product_price. we sould give the currency of the base_pricelist
instead of the target one.

Here is a example:
We have a priclist in INR based on a pricelist in USD. And the company
currency is euro.

When we go for the first time in '_compute_base_price', where we'll call
_get_product_price to get the price from the base pricelist (the $ one)

We get as src_currency the USD and target the INR. Since we are calling
_get_product_price with INR as currency, when _get_product_price will
call _compute_base_price, we'll get EUR as src_currency and INR as
target.

This will lead to apply on the EU price (the one on the product) the
rate of EUR->INR then apply over it USD -> INR. Instead of EUR -> USD
and then USD -> INR

closes odoo/odoo#119505

X-original-commit: 8ace9942368688dc1183133f451ea788a03e0f14
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Masereel Pierre <pim@odoo.com>
2023-04-25 06:39:49 +02:00
Valentin Chevalier 17fc488e08 [IMP] product,sale(_product_configurator): refactor in OWL
The product configurator dialog was still in legacy code as it was not
required for the migration of the views to OWL. Now that we're moving
forward with the removal of other parts of the legacy code, this dialog
had to be converted as well.

Some parts of the logic have now been rewritten in OWL, getting a better
share of the logic between the server and the client.

The product configurator in e-commerce still uses the old implementation
and will be refactored in another task.

task-3056806

closes odoo/odoo#106511

Related: odoo/enterprise#39525
Related: odoo/upgrade#4550
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-04-24 08:38:11 +02:00
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Adesh JolheandManisha Tulsiyani 23cf931808 [IMP] hr_,sale_(timesheet, project),purchase: generic improvements for the project
Purpose of the commit is to do the generic improvements for project.

So in this commit did the following changes:
 - adding a label 'last update' to the stat button in project form view.
 - indicate 'my project' in the tab instead of 'project sharing view in portal' in project sharing.
 - set the first non-folded stage of the project as default on newly created tasks.
 - remove user confirming the SO as the default project manager.
 - hide fields service_tracking, service_upsell_threshold if sale_ok is false.
 - set purchase_method to purchase by default if product is of service type.
 - remove the : next to the totals labels and decrease the font-size for values of 'total hours'
   and 'remaining hours' in timesheets notebook in project task form view.

task-2897867

closes odoo/odoo#96548

Related: odoo/enterprise#29774
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Co-authored-by: Manisha Tulsiyani <matu@odoo.com>
2023-04-04 11:01:59 +02:00
Adrien Widart (awt) 03ab3a4352 [FIX] product{,_expiry},stock: print labels of GS1 lot
When printing the label of a lot, the datamatrix may overlap the
product/lot name and will overlap the 'best before' date.

To reproduce the issue:
1. In Settings:
   - Barcode Nomenclature: GS1
   - Enable "Print GS1 barcodes for lots [...]"
2. Create a product P:
   - Name: a long name
   - Type: Storable
   - Barcode: 1111111111113
   - Tracking: USN
   - Expiration Date: True
   - Dates > Expiration Date: 1 days
3. Process a receipt with 1 x P
   - The serial number should be long
4. Print Labels
   - To Print: Lot/SN Labels
   - (Confirm)
   - Format: 4 x 12

Error: the datamatrix overlaps the product name, the serial number,
and the 'best before' date

For the product/lot names, we can only improve the situation. If the
user define a too long name, the issue will still happen and nothing
can be done

For the dates, we can shorten the labels. That way, the dates will
always be correctly displayed

OPW-3193836

closes odoo/odoo#116541

X-original-commit: f175897cefd1db149e94a50882d9e7babfc6293d
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-03-24 19:21:46 +01:00
Louis Wicket (wil) 0c53d28133 [IMP] *: remove "French spacing"
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#116167

Related: odoo/enterprise#38542
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-24 12:50:13 +01:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00
niyasraphy 87fdb9aca2 [FIX] product: fix typo in subtract
fix typo in substract

substract -> subtract

closes odoo/odoo#115615

X-original-commit: 0c9cb441312959164be9ec939c88ddd456f4d6c6
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-03-17 10:38:07 +01:00
Tiffany Chang (tic) b40c72da7e [FIX] product: print all product labels when multiple tracked products
Steps to reproduce:
- Create 2 SN tracked products
- Create a receipt of the 2 products, with a demand qty of 2+ of
  each product
- Create the SNs of the incoming products + validate picking
- Print Labels > 2x7 or 4x12 (with or without price) > confirm

Expected result:
2+ labels per product printed, 1 for each SN

Actual result:
Only 1st label of the 2nd product is printed, all of labels of the 1st
product are printed

Issue:
The "quantity" in:
https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L155-L156

is structured as:
  {product, [(barcode_to_print, qty_to_print), ...], ...}
or in this case:
  {product2: [(product2_sn1, 1), (product2_sn2, 1), ...], product1: [(product1_sn1, 1), (product1_sn2, 1), ...]}

So there was a miscounting where:
https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L162-L164

Would set the current_quantity to 0 (since only 1 per SN barcode)

And:
https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L155-L156

would register the not (current_quantity=0) as true and quantity={product1: (...),...}
as true => move onto the next product rather than checking if there
are any more (barcode, qty) tuples to print, i.e. never reach:

https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L166-L167

for product2 and therefore never reach its (sn,qty) labels beyond it's
first one.

Note that this issue does not occur for the dymo or zpl labels because
they follow different, less complicated templates

opw-3199095

closes odoo/odoo#114972

X-original-commit: 54e587b272a52972a0f615a29005dcb6fdb6992f
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-14 15:52:16 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
Achraf 9154c2192d [FIX] product: Allow users to edit pricelist report
Steps:
- Open studio
- Go to 'Reports' tab
- Select 'Pricelist' report
- Error message

opw-3207593

closes odoo/odoo#115089

X-original-commit: abf3c725b17f16ec5b57ddbcf1639d60194b8bea
Signed-off-by: Achraf <abz@odoo.com>
2023-03-14 08:52:43 +01:00
Mathieu (mano) d8958a45ba [FIX] web: checkboxes design & consistency
The main objective of this commit is to make checkboxes consistent
and fix their spacing issues.

Prior to these changes, the checkboxes on the `product_view` were
too close to their neighboring option labels, making it difficult to
know which checkbox to tick.

The new changes fixes inconsistencies in general such as undesired
hovering effects and the cursor behaviors on disabled inputs.

This commit also removes the margin in the checkbox template since the
padding from the checkbox wrapper compensates for the spacing between
the checkboxes and their respective labels.

Tweaking the selector in `settings_form_view.scss` to ignore boolean
field inputs allows us to get rid of max-width and margin overrides
introduced in commit b90059e936.

Most checkboxes were already falling under their labels on mobile, but
this change impacted those that were not. To address this issue, we
decided to consistently change the position of the checkboxes left to
their labels for small devices in form view.
This required slight adjustments to the `form_group.xml` template.

Still in form_view, for some of the specific checkboxes such as
`o_checkbox_optional_field` the changes in `form_controller.scss` are
made to mimic the new behavior for mobile sized screen.

However, if they are using the form_group template, their behavior
is unchanged at the moment.

Finally, even if these changes makes it better for most of them, some
checkboxes in `settings` still require some minor adjustments and will
be addressed in task-3113372.

task-3094083

closes odoo/odoo#114612

X-original-commit: ddb7574f97f11e69f0304c8bd8d55c2c53ab53fd
Related: odoo/enterprise#37887
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-03-10 12:31:11 +01:00
Victor Feyens 24ccf7d9b0 [CLN] *: useless type info for actions
The type fields of actions already defaults to
the model name in the base model definition.

Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).

closes odoo/odoo#114539

Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 17:33:37 +01:00
Raphael Collet 6ef3772847 [IMP] *: optimize code with search_fetch() and fetch()
closes odoo/odoo#112126

Related: odoo/enterprise#36782
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-03-05 15:12:57 +01:00
Raphael Collet c161177cb7 [IMP] core: _name_search() now takes explicit order and limit parameters
This API is much more sensible for making subqueries.  Specifically, one
can generate a subquery without the clauses LIMIT and ORDER BY.

Part-of: odoo/odoo#112126
2023-03-05 15:12:54 +01:00
Raphael Collet 136eb34f07 [IMP] core: _search() no longer uses a default order
This simplifies the use of subqueries by avoiding some costly default
order on the model or the idiotic order='id'.  Method _flush_search()
has been adapted accordingly.

Part-of: odoo/odoo#112126
2023-03-05 15:12:54 +01:00
Raphael Collet 7e6cff5479 [IMP] core: search() and _search() no longer have parameter count
The parameter in search() is redundant with method search_count(), and
was making the calls less readable.

The method _search() is aimed at always returning a Query object.  The
method can therefore never return an integer, hence the removal of the
parameter.  This does not actually remove any functionality from the
method; counting result is simply given by using it differently.

Part-of: odoo/odoo#112126
2023-03-05 15:12:54 +01:00
Maruan Aguerdouh (magm) a80033415a [FIX] product: fix product dymo labels printing long titles diplayed
Steps to reproduce:

- Go to a product with a long name
- Inside the product page go to "print labels"
- Choose "Dymo" as label type and print.
(For barcode you need to add a barcode number to the product.)

Issue:

The product name is not displayed correctly on the label because
is too long.

Solution:

Removing the fixed height int he label seem to have good behavior with
sizing the text.

opw-3120807

closes odoo/odoo#114097

X-original-commit: 37b49c6ced839cd82b77819845a52ba2cf8c4ab8
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-02 11:23:47 +01:00
Bruno BoiandMathieu Duckerts-Antoine d19037e141 [IMP] web,*: better classes handling in view archs
**Before this commit**
- The optional "class" attribute set on the root node of a view arch
  is ignored, except for the kanban view which has a custom
  way of using it.
- The optional "js_class" attribute set on the root node of a view arch
  does not have any impact on the class names passed to its controller.

**After this commit**
The content of the optional attribute "class" set on the root node of an
arch like in

<list class="o_custom_class">
    ...
</list>

as well as an additionnal class derived [1] from the value of the
"js_class" attribute set on the root node of an arch like in

<list js_class="extended_list">
    ...
</list>

will both be found in the prop "className" of any view controller.

[1] a js_class value of "xyz" yields to the class "o_xyz_view"

**Note on this commit**
The kanban view was already appending the root node class attribute
to its renderer element. This is no longer the case and some styling
rules has been adapted.

closes odoo/odoo#113014

Related: odoo/enterprise#37265
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2023-03-01 17:01:03 +01:00
Victor Feyens aefbb3d17c [CLN] product: style pass on split files
closes odoo/odoo#113612

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-02-24 12:14:45 +01:00
Victor Feyens efbe5d837e [MOV] product: split product_attribute.py
Part-of: odoo/odoo#113612
2023-02-24 12:14:44 +01:00
Uttam Pragda 68ca50ce70 [FIX] product: set default uom_po_id based on uom_id
Step to reproduce issue:
- Go to sales settings, activate "Unit of Measure"
- Set user define default of field "uom_id" of model "product.template"
- install "loyalty" module.
   While loading file "addons/loyalty/data/loyalty_data.xml" file it will create product and gives traceback.
   Or
- It will also give error while upgrade database from 14.0 to 15.0 or more
Note : This error occurs while there is user-define value for uom_id is set and any module tries to
       create product from data file.

Current behavior:
- When product creates, uom_id and uom_po_id gets default uom value from
  "_get_default_uom_id" method which return "Unit" uom as default.
  But when user have default value for uom_id(let's suppose Days), it sets that default
  value and for uom_po_id we got uom value as "Unit".
- So now as uom category of Days and Unit are not same it violates "_check_uom" constraint.

Traceback: https://pad.odoo.com/p/utpr-set_default_uom

Soultion:
- When product creates, if there is default value for field uom_id in "ir.default" then
  "_get_default_uom_id" method sets same value for uom_po_id.

closes odoo/odoo#113300

X-original-commit: 33a20cf799a6cbca6a55cb82f90c4451df60fa1c
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-02-23 11:33:43 +01:00
Victor Feyens be42e8178d [IMP] product,*: privatize price_compute method
This method is not used by rpc calls and wrongly allowed users to read the standard_price
field by calling the method through rpc.

Make it private to reduce its uses and avoid this potential leak of information.

closes odoo/odoo#113234

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-02-21 21:07:34 +01:00
Victor Feyens 35e84e096b [IMP] product,sale: harmonize/clarify contextual keys for extra prices
Clarify the uses and impacts of current_attributes_price_extra and
no_variant_attributes_price_extra context keys.
Group the key specification and usage.
Provide a clear API shared by templates and variants.

Part-of: odoo/odoo#113234
2023-02-21 21:07:34 +01:00
svs-odoo 0e71e350e3 [IMP] product,stock: packaging product id
Makes the `product.packaging` `product_id` required in the model instead
of the view only, since a packaging is supposed to always be relative to
a product.
Edits some views to add the default product in the context and makes the
field readonly if there is no `product_id` (that way, the user can't
no more create packaging without product).
Also, removes the domain in the action to display the packaging list
view so the user can see if there are some packagings without product
and can eventually delete them.

task-3076044

Part-of: odoo/odoo#109511
2023-02-13 15:15:09 +01:00
svs-odoo dd42059db7 [IMP] stock: product's buttons
- Places the buttons added in `stock` before the "Print Labels" button,
  that way, the "Update Quantity" button is always the first button;

- Adds some depends on compute's methods, so that way it displays the
  "On Hand" and the "Forecasted" stat buttons, and the weight and volume
  UOM even if the product is new and the record wasn't saved yet;

- Adds the "Update Quantity" button in the product's forecasted report
  and removes useless attributes of the "Replenishment" button;

task-3076044

Part-of: odoo/odoo#109511
2023-02-13 15:15:05 +01:00
Horacio TellezandXavier ca623471cd [IMP] product: migrate product_pricelist_report to OWL
Migration of the js code of `product_pricelist_report` to OWL.

Task - 3058360

closes odoo/odoo#105341

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Xavier (xlu-odoo) <xlu@odoo.com>
2023-02-03 05:08:43 +01:00
luve-odoo ac0395a1e8 [FIX] product : UI product.product form was broken
UI improvements for the form of product.product model.

task-3043184

closes odoo/odoo#111052

X-original-commit: d8bc64e6cf04291370e577abe8c58303ae4a9741
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2023-01-26 17:33:49 +01:00
Rémy Voet (ryv) 5a870462e0 [REM] base: remove _patch_method and _revert_method
There is only one legitimate usage of `_patch_method` (base_automation)
and none of `_revert_method`. The other uses are in tests and they are
all wrong: if the test crashes between the `_patch_method` and the
`_revert_method`, the method will not be reverted.

For the only proper usage of `_patch_method`, move the code to this
place. Correct tests using `_patch_method`/`_revert_method` by calling
the `patch` method of `BaseCase`.

Also, remove the `api.returns` from the `create` method of `BaseModel`
as it is useless and confusing. In fact, we never use it because we
have a special treatment at the RPC level for the `create` method
(see `_call_kw_model_create`).

closes odoo/odoo#110370

Signed-off-by: Raphael Collet <rco@odoo.com>
2023-01-25 16:36:53 +01:00
Victor Feyens 15ab3603b1 [FIX] product: do not compute price when not needed
Little perf improvement done in e731876890
but lost with 83c52575d0

+ some little docstring fiximps

closes odoo/odoo#110879

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-25 01:54:53 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Adrien Widart (awt) 02b0264f9e [FIX] product: set barcode on archived product
It is currently not possible to write the barcode of an archived
product template. The inverse method does not consider case where
the variant of the template is archived

OPW-3109967

closes odoo/odoo#110697

X-original-commit: 968d0dff823f8e5d0871feaf8b09233fbb91b4de
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-01-23 14:25:23 +01:00
Demesmaeker 83c52575d0 [REF] product,repair,(*_)sale(_*): unrequired pricelist
Removes the constraint of using a pricelist and makes all sales flows
rely on the currency of the sale order (or repair order)

task-2735672

closes odoo/odoo#84920

Related: odoo/enterprise#24716
Related: odoo/upgrade#3642
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-01-18 21:08:52 +01:00
Victor Feyens 3ef26523fb [FIX] product: UX of advanced pricelist rules
task-3062387

closes odoo/odoo#110060

X-original-commit: f91f3db47469d4f516083f8cbcfeb0381c066844
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-17 10:21:05 +01:00
Victor Feyens be97280b82 [FIX] base,product,sale: currency checks in tests
Since https://github.com/odoo/odoo/commit/3752b3166ec6bbb5c6ea55f96bb521381bf2b2d9,
the currency of the test architecture is not fixed anymore to USD (but is by default).

Therefore, the nightly runbot tests of the localization (l10n_* modules) all fail
when verifying the company currency is USD (because the localization sets the company
currency to the country one).

This commit adapts those checks to stop enforcing the USD currency as base,
only enforcing that the currency used is the company one.

closes odoo/odoo#109807

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-12 19:09:00 +01:00
Ivàn Todorovich 2524d7bb3a [IMP] product: Use a subquery to search on product.template barcode field
closes odoo/odoo#77088

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-02 20:39:22 +01:00
Ivàn Todorovich 87bdc87d92 [IMP] product: Improve search on product.template standard_price
There's no need to use a secondary search. We can directly search on the
one2many field instead.

Part-of: odoo/odoo#77088
2023-01-02 20:39:22 +01:00
Ivàn Todorovich 0730514697 [IMP] product: Add helper methods to compute and set variant fields.
Part-of: odoo/odoo#77088
2023-01-02 20:39:22 +01:00