Commit Graph
154650 Commits
Author SHA1 Message Date
std-odoo f5c7555d1b [IMP] web, base: shorten generated property names
Purpose
=======
Shorten the property name to take less space in database (while keeping
a very low probability of collision).

E.G.: "aa34746a6851ee4ea1f8d95746e45788" -> "aa34746a6851ee4e"

Automatically generate property name in python if they are missing.

Task-2965523

X-original-commit: d597083ff5e0a4abde67a450a61e04e6bf119c26
Part-of: odoo/odoo#101487
2022-09-28 19:31:51 +02:00
std-odoo 9e2a3ff662 [IMP] web: clean the code about property attributes reset
Purpose
=======
When changing the type or the model of a property, the name is
re-generated, so the others record values are reset. If we change back
to the original model / type, the original property name is restored.

This is a super important behavior of the properties component and
it should be fully tested.

Reset the model and model description when changing the type.

Now that the form view is always in edit mode, even if we changed the
model / type of a properties, then save, we are able to restore the old
properties as long as we don't refresh the page.

Task-2965523

X-original-commit: 54ae82974b836a0badab3c4c767916a1daf88f76
Part-of: odoo/odoo#101487
2022-09-28 19:31:50 +02:00
std-odoo 3c356808c0 [IMP] web: remove the properties formatters from legacy
Purpose
=======
Move the the properties formatters from legacy
to the new formatters file.

Task-2965523

X-original-commit: 6e8b49ba8a213bc2dd600fd91b7acd4a38147926
Part-of: odoo/odoo#101487
2022-09-28 19:31:50 +02:00
std-odoo a631a333b0 [FIX] web: fix the properties field test about many2many
Purpose
=======
The many2many properties have "res.users" as model, but the model and
records were missing in the test data.

Task-2965523

X-original-commit: 974999d32e14fcfca94b327fb8d6efa06d6bf06e
Part-of: odoo/odoo#101487
2022-09-28 19:31:50 +02:00
std-odoo 7a135ff585 [IMP] base: prefetch the properties definition
Purpose
=======
Most of the time we will need to read some field on the definition
record when we read the record itself (e.g. fetching some project
information on a task).

Because of this, it makes sense to prefetch by default the properties
definition, and it reduces the number of queries as well.

Task-2965523

X-original-commit: 1295e76f0dc3f3162a1b81a58ed1dc73d0fce3e7
Part-of: odoo/odoo#101487
2022-09-28 19:31:50 +02:00
std-odoo 17335f13fd [IMP] crm: add a properties field on lead
Purpose
=======
To be able to customize the working flow on the lead, based on their
team, we add a properties field on leads, whose definition is stored
on their team.

Include the properties value in the merge message to keep the history
of the properties value if they have been overwritten during the merge
process.

Task-2965523

X-original-commit: 4722cc4b1fb027b7b9d731c3b206656588071360
Part-of: odoo/odoo#101487
2022-09-28 19:31:49 +02:00
std-odoo ce29b305b9 [IMP] project: add a properties field on task
Purpose
=======
To be able to customize the working flow on the task, based on their
project, we add a properties field on tasks, whose definition is stored
on their project.

Task-2965523

X-original-commit: 2f244769cbb1512875ae197aa8adc3efd34fd54b
Part-of: odoo/odoo#101487
2022-09-28 19:31:49 +02:00
Benoit SociasandAntoine 1139ad7aff [IMP] web_editor, website, website_sale: hide block in desktop display
Since [1] it is possible to request that some blocks are not displayed
on mobile devices.
This commit adds a similar option to prevent blocks from being displayed
on desktops (i.e. on non-mobile devices).

[1]: https://github.com/odoo/odoo/commit/9463f0f889f9dd8da6077895c125da4998a933c0

task-2900730

closes odoo/odoo#101483

X-original-commit: 3103e0553011b5c1f4078972d7a88fa3fd4068b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Antoine (anso) <anso@odoo.com>
2022-09-28 19:31:39 +02:00
maximilien(malb) c6fa784c43 [FIX] account: Holes in sequences warning
The warning should be displayed only on sales journal
Also added the fact that the warning now depends on the lock date, if there is a lock date the warning is displayed for entries post lock date, otherwise it's for all the entries

Same for the color of the name of the entry, it's now red only if it's post lock date

closes odoo/odoo#101442

Task-id: 2993833
X-original-commit: c668d777a5984d1cdcfd45a90ec39e1a5a2e0a55
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2022-09-28 17:55:09 +02:00
Tomas Alvarez af37445f35 [FIX] website_sale_delivery: default to 0 in recordset len check to prevent warning
closes odoo/odoo#101411

X-original-commit: f0085db5575f1589a2c7958f4c29a53ad0056c91
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-28 15:28:28 +02:00
aliya a3f3a130ca [IMP] account: add amount to quick search in payment list view
It should be possible to quickly search by `amount_company_currency_signed` and `amount` in `account.payment` view.

closes odoo/odoo#101404

X-original-commit: 95af911eee4ecdfacc18f55e5bc923f04bc97453
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2022-09-28 15:28:22 +02:00
Victor Piryns (pivi) d00471fdb4 [FIX] sale_timesheet: show date fields in invoice wizard
Current behaviour:
If you have an SO, with an SOL that is a service invoiced based on Timesheet's task,
with some logged hours (therefor it can be invoiced), the wizard wasn't showing the
date range fields to allow user to specify a begin and end date for invoicing.

Expected behaviour:
You should be able to choose a date in the wizard when you have a service based on timesheet,
and "normal invoice" is chosen as a radio option.

Steps to reproduce:
- Install Sale and Timesheet
- Create a Product of type service, invoiced on timesheet, on create task, chose a project (doesn't matter), unit = hours
- Create an SO and sell 50 hours of the newly created service, confirm the SO
- Log 20 hours on the task related to the sol
- Return to the SO and click on "Create Invoice", normally 2 fields for "Date Begin" and "Date End" should be present,
but it is not the case. You can test the desired behaviour in version 15.3 and before.

Reason for the problem:
The xml view was attaching itself after a field `deposit_taxes_id` which is inside a group that is invisible if there
are no downpayment.

Fix:
Attach the xml view after the before mentioned group (`down_payment_specification`), in a separate group of its own,
with visibility that depends on `invoicing_timesheet_enabled` field.

Affected versions:
- 16.0
- master

opw-2994036

closes odoo/odoo#101406

X-original-commit: 3eb1660e7bee4c5b2fe63f82daad5f4acbea2dd2
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2022-09-28 14:19:14 +02:00
Renaud Thiry 0553e16dbd [FIX] mail, web_editor: dialog file update event
An event was not called on uploading files in a media dialog.
This meant the parent of html field didn't know of the new attachments
which resulted in attachments being linked to no record at all
and  not being garbage collected later.

This adds a reference inside the media dialog file input so that it can
trigger that event on behalf of the html field.

The attachments newly uploaded in media dialog are uneditable
to prevent users from unlinking attachments
that are still used in the body of the composer (causing the same issue)

Task-2860761

closes odoo/odoo#101405

X-original-commit: f4dd1eb3f25672e7309759c347e2b552c5652b2f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-28 14:19:11 +02:00
Julien Alardot (jual) c96c8b27f7 [FIX] account: Disable aggregation on amount_currency
When account.move.line are aggregated (such as
in journal items) we do not want to see an
aggregated value as it would either be 0 or
a possible mix of currencies

closes odoo/odoo#101373

X-original-commit: 9e1dcbfe31e9d3faf0023f04979409ae7889e5f4
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2022-09-28 12:30:03 +02:00
8787031cd9 [FW][MERGE][REF] sale,purchase,*: migrate SO & PO form views to OWL
Adapt (part of) the `sale.order` & `purchase.order` custom javascript logic to the new OWL framework.

1) `product_configurator_widget` -> `sol_product_many2one`
Impacted modules: sale, sale_product_configurator, sale_product_matrix, event_sale, event_booth_sale, sale_renting

2) `matrix_configurator` -> `pol_product_many2one`
Impacted module: purchase_product_matrix

3) `product_discount` -> `sol_discount`
Impacted module: sale

4) Custom js_class for SO form view is no longer necessary (and legacy js_class removed from the PO form view)

Task-2918791

COM PR: #101304
ENT PR: odoo/enterprise#31854

closes odoo/odoo#101352

Forward-port-of: odoo/odoo#101304
Related: odoo/enterprise#31886
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Horacio Tellez Perez <hote@odoo.com>
Co-authored-by: Morgane Demesmaeker <edm@odoo.com>
Co-authored-by: Valentin Chevalier <vcr@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2022-09-28 11:14:38 +02:00
ada5c5dfe8 [FIX] *: adapt tours to sale order view conversion to OWL
X-original-commit: f23215c1cbae6f177d8c7863d493c1ffcf82e9da
Part-of: odoo/odoo#101352
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Morgane Demesmaeker <edm@odoo.com>
2022-09-28 11:14:37 +02: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
Victor Feyens 5f621c9fe2 [IMP] purchase(_*): convert order view to OWL
Task-2918791

X-original-commit: b2457fbc45aa8a2714c92ea48333fa8108acf405
Part-of: odoo/odoo#101352
2022-09-28 11:14:36 +02:00
Victor Feyens da71f04db3 [REF] event_sale: convert configurator to OWL
And stop relying on dumb event_ok field, when the product_type already
holds the information (recently moved from sale_stock to sale).

Task-2918791

X-original-commit: 10255e549d071c1ceee5faae7be0e1a0486a3639
Part-of: odoo/odoo#101352
2022-09-28 11:14:36 +02:00
Victor FeyensandValentin Chevalier 49a6cc42f1 [REF] event_booth_sale: convert configurator to owl
Task-2918791

X-original-commit: 5563c5dd56114ea02be9f034dc7650e2d1ba62ff
Part-of: odoo/odoo#101352
Co-authored-by: Valentin Chevalier <vcr@odoo.com>
2022-09-28 11:14:36 +02:00
Victor Feyens 268797286a [REF] sale_product_matrix: convert configurator to OWL
Task-2918791

X-original-commit: 737bdc0b103df96813dc45feaa4e9c0c9136faf0
Part-of: odoo/odoo#101352
2022-09-28 11:14:35 +02:00
Victor Feyens 7f4013fc30 [REF] sale_product_configurator: convert configurator to OWL
Task-2918791

X-original-commit: ab3e2c9b129e2cf74e9341b49bc0d15fb971ea33
Part-of: odoo/odoo#101352
2022-09-28 11:14:35 +02:00
Victor FeyensandHoracio Tellez Perez ab7846be8e [REF] sale: convert sale order view to OWL
* Configurators (sol_product_field)
* Discount (sol_discount)

Task-2918791

X-original-commit: 27ee2899cbec65b05135d3f12bcf8f6fc8adc241
Part-of: odoo/odoo#101352
Co-authored-by: Horacio Tellez Perez <hote@odoo.com>
2022-09-28 11:14:35 +02:00
Victor Feyens 33d86f6b6d [FIX] sale_stock: warehouse_id not present in view
Task-2918791

X-original-commit: 76e88d35d7d4fad62920da53501b4462c633e108
Part-of: odoo/odoo#101352
2022-09-28 11:14:35 +02:00
Victor FeyensandHoracio Tellez Perez f05c4ae9c8 [IMP] web: util method to apply multiple changes on a x2m field.
X-original-commit: 429357c706c43a67febec05e84b290decf542427
Part-of: odoo/odoo#101352
Co-authored-by: Horacio Tellez Perez <hote@odoo.com>
2022-09-28 11:14:34 +02:00
Victor FeyensandValentin Chevalier 673b784f86 [FIX] web: magic commands in search domain
Before this commit, when we used a domain on many to many relational
fields, the `dataContext()` returned the context of the field, which
contained a command tuple.

This causes an error server side, when a domain [('id', 'in', [[6,
False, [3,4]]])] is provided to search available records to fill the x2m
field.

Now, it returns the `currentIds`, which correctly gives the id(s) of the
records.

Approved by SAD

X-original-commit: 5653e23a333262683257575d071575a63981ca33
Part-of: odoo/odoo#101352
Co-authored-by: Valentin Chevalier <vcr@odoo.com>
2022-09-28 11:14:34 +02:00
Victor FeyensandSamuel Degueldre 80b19b11d6 [IMP] web: make addNew return the newly created record
used in product configurator logic

X-original-commit: 40cfbf35985422a9415e6ab225d037f7393d3842
Part-of: odoo/odoo#101352
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2022-09-28 11:14:34 +02:00
Nemael 6d834e2b9e [FIX] mail: emoji button stay grey when opened
This PR makes it so that the button to open emojis stays grey
when the emoji popover view is opened.
The focused behavior of the button is also disabled

Task-2998149

closes odoo/odoo#101348

X-original-commit: d022939ed1ed29d2e93a05c6c408ac65e8fb704e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-28 11:14:20 +02:00
Nemael 81ed7cb4ca [FIX] mail: fix horizontal scrollbar of emoji popover on windows
On windows, displayed emojis are bigger than the expected size
This commit removes the horizontal scrolbar that would appear
on Windows

Task-2991415

closes odoo/odoo#101347

X-original-commit: 578157fbbae92afa1581193df9173fd085fd9f09
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-28 11:14:17 +02:00
shsa-odoo ed024f741a [FIX] web_editor: shift enter must call oShiftEnter
Current behavior before Fix:

when we hit shift+enter the oShiftEnter doest not trigger

Desired behavior after Fix:

now when we hit shift+enter oShiftEnter gets triggered.

Task id-2991164

closes odoo/odoo#101345

X-original-commit: d1808c8d50372a5e7e0063634037e069aa7fc55a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-28 11:14:12 +02:00
Antoine Guenet b78385c02d [IMP] sms, mass_mailing_sms : port sms widget field to OWL
This ports the `sms_widget` field to OWL.

closes odoo/odoo#101350

X-original-commit: 89109de6d3752388f0b2f976c8a32588f760ec48
Related: odoo/enterprise#31882
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-28 09:38:56 +02:00
Antoine Guenet 57a7b6064e [REF] mail: move sms widget to component directory
This moves the sms widget to the new components directory.

X-original-commit: f10a74dcff28eb74923743fadf61ad0ebbc9c2ab
Part-of: odoo/odoo#101350
2022-09-28 09:38:55 +02:00
Antoine Guenet 9dbbaa7a09 [IMP] mail, mass_mailing, im_livechat: port emoji fields to OWL
This ports the `text_emojis` and `char_emojis` fields to OWL.

X-original-commit: 65b3e551aee0ea451a7f48c6778ce78931bff3e8
Part-of: odoo/odoo#101350
2022-09-28 09:38:55 +02:00
Antoine Guenet 9d156f289f [REF] mail, sms: move and rename emojis char/text fields
This moves the emojis char and text fields to the new fields directory,
and renames them to follow the new naming conventions.

X-original-commit: 92488725a608a2e14297228ebccddc5cc2ee5d6d
Part-of: odoo/odoo#101350
2022-09-28 09:38:55 +02:00
Camille Spiritus 0c55bc83ac [FIX] account: fix mixed early pay payment term with multi lines
Some payment terms with early payment cash discount weren't giving out the correct computation.

Example of a problematic set up :
Payment term with multiple lines (percentage X, percentage Y, balance)
Cash Discount tax computation : mixed

The journal items of the invoice and the total amount wouldn't correctly take into account the different discount percentages of the payment term lines.

Fixed it by applying the line percentage to the epd lines computation.

closes odoo/odoo#101341

X-original-commit: 4af4d0e3bc25a5f81eabd1c2068fd6bf6a25621d
Related: odoo/enterprise#31874
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
2022-09-28 08:40:24 +02:00
JF Aubert bb42ac4396 [FIX] stock: fix replenishment report
Make the choice of available stock effective
(previously the total quantity was always applied).
Show warehouses with the most available stock first.
Show quantity warning only when appropriate.

closes odoo/odoo#101010

Task: 2985735
X-original-commit: 483764412985163168333e2731bed359cc588bbb
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Jean-François Aubert <ajf@odoo.com>
2022-09-28 08:40:21 +02:00
Damien Bouvy d10d80608e [FIX] web: make invalid field borders visible all the time
Not only on hover - otherwise it makes it very difficult for users
to find what field is missing content.

closes odoo/odoo#101349

X-original-commit: b674e81b7ca7e553f593cef1bc1a9f94cd58e3d3
Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-09-28 07:39:11 +02:00
Aaron Bohy a076fc14e2 [REM] web: remove two unused field widgets
closes odoo/odoo#101351

X-original-commit: 577e9898029b84a70c85f2eefa68d02e265dd4fd
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-27 22:03:00 +02:00
FrancoisGe 71c6eb1134 [FIX] web: required field compute by another
Before this commit, if an invalid field was completed when editing
another field using an onchange, the field was always considered invalid.
It was not possible to save the record.

Why:
Fields modified by an onchange were not removed from the list of
invalid fields.

Solution:
Remove all fields modified by an onchange from the list of invalid fields.

How to reproduce:
- Create a new record in a form view with a required field
- Click on save (the required field appears as invalid)
- Edit another field that causes a change to the invalid field (onchange)
- Click on save

Before this commit:
    The record is not saved and the required field is still invalid.

After this commit
    The record is saved.

closes odoo/odoo#101343

X-original-commit: 46074244798d2e447f4e5cf174244ea263563b1d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-27 21:08:54 +02:00
maximilien(malb) 435e470968 [FIX] account: Bill payment flow
1. Link to payment not clickable since the owl migration, the click method in xml wasn't there anymore

2. In the past, the view given in the context was problematic, so now we let the orm pick the view

Also removed the function open_move and open_payment which was useless since action_open_business_doc_from_aml do the job. I also moved the function in account.move

closes odoo/odoo#101342

Task-id: 2988037
X-original-commit: 739ea262b821a71dcb9c7d61d6bd179a4996de0e
Related: odoo/enterprise#31876
Signed-off-by: William André (wan) <wan@odoo.com>
2022-09-27 20:15:35 +02:00
Sébastien Theys 7621343501 [IMP] mail: create kanban and list activity field components
closes odoo/odoo#101330

X-original-commit: 069220ac94b3e33201991aa04506f1aa4227be1d
Related: odoo/enterprise#31869
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-27 19:14:51 +02:00
Philippe Wauthy d7e0760ce8 [FIX] barcode: set the max_time_between_keys_in_ms to 100 by default
The default value of max_time_between_keys_in_ms in barcode is 55 ms.
The default value of 55 ms is too low and creates an issue for RFID readers.

The default value of max_time_between_keys_in_ms is increased to 100 ms.

task-2996072

closes odoo/odoo#101331

X-original-commit: 9eda9679bd51b63bbc7b796419b3efdec4ba99bb
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
2022-09-27 18:15:00 +02:00
momegahed 1c5dc8128e [FIX] l10n_in: wrong state used
Issue :
- `account.move.state` has only 3 possible values cancel, draft, posted
- the wrong value was used

Fix:
- Use the correct value `posted`

OPW-2991389

closes odoo/odoo#101324

X-original-commit: e33acb06c90cf9cab93471e1019d092478db35d4
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2022-09-27 18:14:57 +02:00
William Braeckman 6a0efdb7c4 [IMP] web: expose before and after execute action on controllers
Make it possible to override both before and after execute actions on
all view controllers using `useViewButtons`.
This avoids having to change a value in the env to override the function
being called when clicking on a button.

closes odoo/odoo#101310

X-original-commit: 9f6c2b8e969635f35786d58ee89ca767ff57144d
Related: odoo/enterprise#31860
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-27 18:14:49 +02:00
William Braeckman dc930e8e2a [IMP] web: add afterExecuteAction to view_button_hook
The function will be called after the action has been executed.

X-original-commit: 1e4c6e457a9c42da76c647ca0972b06e6d838349
Part-of: odoo/odoo#101310
2022-09-27 18:14:49 +02:00
csnauwaert e854fe7421 [FIX] hr_expense: fix company expense could not be posted
When creating an expense paid by the company, we want the expense
to be on a bank journal. This is currently incompatible with the
current constraint we have that force expense of type 'in_receip'
to be on a purchase journal. Since expense only behave like type
'in_receipt' we can ignore that constraint.

closes odoo/odoo#101307

X-original-commit: f95eb814166646ec3113d35b910a677b21737cd1
Signed-off-by: William André (wan) <wan@odoo.com>
2022-09-27 18:14:45 +02:00
FrancoisGe cb022c00a3 [FIX] web: discard invalid input field
Before this commit, in a form view, discarding a record with an invalid
field containing an input does not restore the original value.

How to reproduce
- go to a form view with an integer field
- edit the integer field with an invalid value ("blabla")
- click outside the field (the field is displayed as invalid)
- click on the discard button

Before this commit:
The integer field always displays the invalid value.

After this commit:
The integer field displays the value before the edit.

closes odoo/odoo#101316

X-original-commit: f81e4019ca00953d9624557c98033aef46efc47a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-27 17:11:53 +02:00
Lucas Lefèvre 04892cc17e [FIX] spreadsheet_dashboard_*: adjust some spreadsheet dashboards
This commit fixes/improves spreadsheet dashboards.

closes odoo/odoo#101315

X-original-commit: 7e4cc7cf7be6c196abf0e467630dd5cd86bf15a7
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-09-27 17:11:51 +02:00
Simon Genin (ges) a105e8b3cb [FIX] web: pager offset in list interprets 0 as falsy when it shouldn't
If a view with groups and pager, going next then previous (back to the 0
offset) doesn't work.

The pager offset and limit were used in an conditional expression.
If the value was 0, it was considered falsy and set to a default value
while the 0 was actually a valid and expected value.

closes odoo/odoo#101314

X-original-commit: 5c9173241dbe55007c3a84fe078d21ea733e9046
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-09-27 17:11:48 +02:00
qsm-odoo 954e690edd [FIX] website: restore SCSS edition of auto-edited SCSS files
If an user modifies a theme value through the "Theme" tab of the website
builder, a custo of the related SCSS file is made. To make a SCSS custo,
the related python methods need to know for which bundle the custo is
made. This is to ensure that if a file appears in multiple bundles, the
custo targets the right one (amongst other things). For those automatic
SCSS custo made via the website builder, the given bundle does not
matter as those are custo made in variables SCSS files, which appear in
all bundles, more precisely in a sub-bundle included in all bundles. The
code should be more robust to leverage that fact.

When the "assets_frontend" received all "assets_common" files in order
to only use one unique bundle for main frontend pages with [1], it was
though smart to leave that given bundle to "assets_common" although
"assets_common" is not used on the frontend anymore as it would allow
to not care about migration of those automatically edit SCSS files and
it was also "not wrong" as you effectively cannot edit those files
without impacting all bundles.
It was although very wrong as editing those variables files via the SCSS
editor automatically considers them as part of "assets_frontend" and not
"assets_common". So editing them via the SCSS editor would create/update
the files relying on the fact the related bundle is "assets_frontend"
but the website builder would create/update them relying on the fact the
related bundle is "assets_common". This would lead to creating two
ir.asset records trying to replace the same file in the sub-bundle which
is used by both those assets... and thus to make the database crash.

The work done at [1] actually forgot about other things related to all
this. Those will of course be fixed but they are less urgent. This
commit here just fixes the SCSS edition issue described above for now.

[1]: https://github.com/odoo/odoo/commit/08dcbc8f1def06476d025b110049ee596e906816

task-2994071

closes odoo/odoo#101312

X-original-commit: 15e503a841d757e622c8ef2070043b766b28bfde
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-09-27 17:11:45 +02:00