The logic not identical in BS4 -> BS5
The color contrast system in BS5 relies on WCAG 2.0 contrast algo.
So color-yiq is converted to color-contrast.
Note that there are some "texts/buttons/other visuals" elements
which will not have the same contrast as before.
$yiq-text-dark and $yiq-text-light are respectively replaced with
$color-contrast-dark and $color-contrast-light.
Note that we had to use '$min-contrast-ratio: 2.2' for .o_tag_color_X badge.
Task ID: 2766483
Part-of: odoo/odoo#95450
Co-authored-by: Stefano Rigano <sri@odoo.com>
This commit is a hack for Bootstrap 5
In Bootstrap 4 these variables was used with map-merge()
In Bootstrap 5 these variables has set only if they don't exist before
PS: Another fix will be to reorder all bundle to follow Bootstrap
documentation and do another logic that wasn't use before.
Ref:
https://getbootstrap.com/docs/5.1/customize/sass/#colors
Task ID: 2766483
Part-of: odoo/odoo#95450
Add the new helper `.text-bg-#{$color}` to restore the old behaviour like in
BS4 for the `.bg-#{$color}`
In short, in BS5 `.bg-#{$color}` don't change anymore the text color but
only the background. `.text-bg-#{$color}` change both color text and
background.
Task ID: 2766483
Part-of: odoo/odoo#95450
mixins:
* make-container-max-widths
* text-emphasis-variant
variable:
* $modal-footer-margin-between
we had to forward-port the BS4 variable `$modal-footer-margin-between`
to avoid error between px and rem calc :
e.g. of error:
Error: Incompatible units: 'rem' and 'px'.
padding: $modal-inner-padding - $modal-footer-margin-between * .5;
This is because BS5 now uses 'rem' but Odoo still continue to use 'px'.
Therefore, the calculation can't be processed.
Task ID: 2766483
Part-of: odoo/odoo#95450
* = base,http_routing,hw_drivers
- Update Bootstrap from 4.3.1 to 5.1.3
- Update PopperJS to version 2 for Bootstrap 5 (JS part)
Some code was for PopperJS V1, but it's not compatible anymore.
- Remove some BS5 classes utilities backport
- Fix path for BS5
Task ID: 2766483
Part-of: odoo/odoo#95450
- Fixes the RegEx that insert our internal structure path
for some assets like image font...
BS5 uses inline SVG and the function `escape-svg` to escape some
characters in HTML. But we can't add the path as the image is inline.
- Don't include Bootstrap in LESS assets;
Since Bootstrap 4 (and also in 5) there are no more LESS files for
Bootstrap. So, there is no reason to include the path when we compile
LESS assets.
Task ID: 2766483
Part-of: odoo/odoo#95450
Convert the onchange on `picking_type_id` to a compute field
This allows to create a `stock.picking` record without
the need to specify the locations during the creation nor calling the onchange
method. The locations defaults from the picking type locations.
This way, if the database is not configured to use multi locations,
the users do not have the specify the UOM to use.
For instance during an XMLRPC call to create a picking.
closesodoo/odoo#95423
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
This allows to create a stock.package_level record without
the need to set the `location_dest_id` during the `create` call.
For instance, this makes easier to create a package level
using XMLRPC when you do not use multiple locations.
closesodoo/odoo#95361
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
This allows to create a stock.warehouse.orderpoint record without
the need to call the onchanges to set the warehouse and location
or to set it manually during the `create` call.
For instance, this makes easier to create orderpoints
using XMLRPC when you do not use multiple locations.
closesodoo/odoo#95352
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
This allows to create a stock.move record without
the need to call the onchanges to set the uom
or to set it manually during the `create` call.
This allows to create a stock.move.line record
without the need to call the onchanges to set the uom and locations
or to set it manually during the `create` call.
For instance, this makes easier to create stock moves
using XMLRPC when you do not use multiple UOMs or multiple locations.
closesodoo/odoo#95332
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
This allows to create a purchase.order record without
the need to call the onchanges to set the suggested packaging
and quantity.
For instance, this makes easier to create purchase orders
with suggested packaging using XMLRPC.
closesodoo/odoo#95306
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Convert the onchange on `product_id` to a compute field
This allows to create a `mrp.bom.byproduct` record without
the need to specify the uom during the creation nor calling the onchange
method. The uom defaults from the product uom.
This way, if the database is not configured to use multi UOMs,
the users do not have the specify the UOM to use.
For instance during an XMLRPC call to create a byproduct.
closesodoo/odoo#95270
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
To reproduce
============
Have two companies with different currencies,
Create a lead in the first compnay => the expected revenue has the company's currency
Create a lead in the second company => the expected revenue doesn't have the currency
Purpose
=======
in v15 the `company_id` has became computed, but the compute method in some scenarios
doesn't set the `company_id`.
`company_currency` is related to `company_id`, so when `company_id` is not set `company_currency`
is also not set which occures this issue.
Specification
=============
To solve the issue, the field `company_currency` is computed now, and we give it the value of the active
company if `company_id` is not set.
opw-2862410
closesodoo/odoo#95484
X-original-commit: de59391caede72624fddcb01ba3565884c4e5574
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before the commit
Go to Email Marketing > Mailing Lists
The kanban cards are visually misplopped.
After the commit
Style is fixed
closesodoo/odoo#95387
Related: odoo/enterprise#29152
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When accessing the job positions page, country is detected automatically
to filter only those jobs whose country match current one + the ones
available in any country. However, when job positions have no specific
country, they're being excluded due to the usage of an old API
(expecting relational fields as `None` when they're empty), so only
positions with country are being taken into account.
This commit fixes the above by expecting the correct value (an empty
recordset) when an address is not set.
closesodoo/odoo#95454
X-original-commit: 65a285124bc0833c511905719da1712b0c747e24
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
There are situations where a message view is re-used in a different context
where the isSquashed value has to change.
For example a message being starred could be squashed in its original thread but
not squashed in the starred box, leading to a crash before this fix.
closesodoo/odoo#95403
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
This commit fixes the css rule for the class `o_kanban_attachment` that
was broken for owl kanban views since f795af0160ed7977d07041d1bb1923598df48320.
closesodoo/odoo#95444
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Before this commit, a form view with an empty button box would
produce a crash, in the ButtonBox component, because it assumed to
have slots. This commit prevents this from happening as we no
longer put a ButtonBox component in the template if there's nothing
in it.
closesodoo/odoo#95427
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Before this commit, the user could try to install a language without
specifying which language he wanted to install, resulting in a TB. This
commit forces to specify which language you want to install. The bug
appeared with this commit [1] which allows to install several languages
at the same time.
[1]: https://github.com/odoo/odoo/commit/47041f2d45915e2ed74c4317f9aafe3dfa840f0a
task-2878405
closesodoo/odoo#95426
X-original-commit: bc083e6616859d51364b90ad4d0c6f0d99e34631
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the context parameter "form_view_initial_mode" was
ignored by the form views, so that the form view would not be always
initialized in the appropriate mode.
closesodoo/odoo#95413
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Problem:
Have
- a slow network
- a kanban view grouped
then move a given record from a column to another twice quickly.
An error occurs.
This is due to the way the transaction system in kanban model works:
the first move done in the first transaction being not yet finished,
no other transaction can begin and an error is thrown.
Solution:
Subclass Error and catch the specific transaction error at the
appropriate time to cancel the second order.
Note that the problem does not occur in a not grouped kanban view
because the hook useSortable prevent asking again a resequencing via
a proper management of the class o_record_draggable. That class is also
used in the grouped case but a rendering of the kanban view takes place
possibly before the end of the transaction: the record is moved in any
case to the targeted column and moved back if the overall operation
fails for some reason.
closesodoo/odoo#95235
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*: test_website
Issue: The url is cached and no longer depends on the url. This part
should not be cached.
closesodoo/odoo#95222
X-original-commit: 4b255ed129b0e458d3cf7f432d076913b14d5450
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Issue introduced by commit b0a2a41
The template's "flags" value was not in the t-nocache values to use when
rendering languages.
X-original-commit: 7827d2dbc1fbef3cc0dc898baa0af30ed1f23fca
Part-of: odoo/odoo#95222
Before this commit, the reference of a validation transaction followed
this format: “validation-20220222072710”, which did not match the
standard format for refund transactions (”R-S000001”). Moreover, some
providers limit the length of transaction references which forced us to
truncate the quite long reference.
With this commit, future validation transactions will have a reference of
the format: “V-20220222072710”.
task-2830826
closesodoo/odoo#94921
Related: odoo/enterprise#29076
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Currently, in demo data (or data) of some surveys, there are records of
'survey.question' having 'is_page' field value as true and 'question_type'
is not defined. When question type is not defined, default value
'simple_choice' is assigned to the 'question_type' field. Now when we
create a live session of that survey and go to the page, it tries to read
the data for bar chart but data is not available (undefined) and the
traceback is thrown. This happens because question types 'simple_choice'
and 'multiple_choice') are expected to load a bar chart.
It used to work before commit[1] where default 'question_type' value was
being set to 'text_box' (so attempt to load bar chart was not made).
This commit improves the behavior by adapting data/demo data/test cases
and by adding a python constraint that prevents question creation of
page type if there is a question type set, and compute `question_type`
based on `is_page` field. Now that we have python constraint and a
compute method, we no longer need the `default_get` method, so it is
also removed.
commit[1] - https://github.com/odoo/odoo/commit/1fb99d79b1567d4c150dc07f309ce54a3beea8e3
taskID-2841582
closesodoo/odoo#93414
Related: odoo/enterprise#28305
Related: odoo/upgrade#3600
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit removes the unnecessary measures(like partner latitude/longitude)
from the lead related graph views. Also, we try to order the measures and keep
time related measures(Days to Assign, Days to Close, Exceeded Closing Days, etc)
first and revenue related measures(Expected Revenues, Prorated Revenues, etc)
last.
Note that with this commit, recurring revenue related measures will be displayed
only when the feature is activated.
ent PR: https://github.com/odoo/enterprise/pull/21981
Task-2674367
closesodoo/odoo#79167
Related: odoo/enterprise#21981
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Fixes 38bfbed
We cannot create a `set` from `None`
```
File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 225, in <listcomp>
delivery_ids.update(*[set(delivery_by_lot.get(lot_id)) for lot_id in (producing_move_lines.produce_line_ids.lot_id - next_lots).ids])
TypeError: 'NoneType' object is not iterable
```
Small optimization: no need to create a list that's immediately unpacked.
This error was detected during upgrades.
upg-360084
closesodoo/odoo#95398
X-original-commit: 1870ef4cf4c177846fce72325ff3f2fa97224417
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
Rewrite _find_delivery_ids_by_lot to reduce the number
of recursive calls by grouping the producing move lines
together before each recursive calls. This reduces
the number of search calls, speeding up the whole method.
Add a unittest to check if the delivery_ids field
of a lot recordset is properly computed.
opw-2824464
X-original-commit: e7b9f14d4a9ce4ed61451b24b567f751fb4bcbe2
Part-of: odoo/odoo#95398
In an x2many sub view, the attribute "force_save" on a field
indicates that the field value must be saved, even if the field is
readonly. Before this commit, this attribute was ignored by the
new views. In the BasicRelationalModal, we only needed to propagate
this attribute to the fieldsInfo given to the BasicModel. In the
RelationalModel, we needed to take the attribute into account.
closesodoo/odoo#95396
Signed-off-by: Géry Debongnie <ged@odoo.com>
During the wowl refactoring, the colorpicker field was converted into a
new field component and the colorlist that allows to pick the color was
extracted into a new component with its own style. While doing so, the
stylesheet for the color picker was reworked into the stylesheet of the
colorlist, which is ultimately what we want, but in the mean time, the
legacy colorpicker widget no longer has the style it needs to be
displayed properly. A partial fix was applied previously by resoring
part of the scss directly in the colorpicker field css which is a
mistake.
This commit simply restores the old colorpicker scss file so that the
legacy field displays properly and removes the parts of it that had been
copied over to the new color picker field.
closesodoo/odoo#95392
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Step to reproduce:
- Create a SO, save and confirm it
- Create an invoice, on edit mode, change the journal and click on save
Issue:
- If the invoice is the first one in the current month, a sequence
number is automatically assigned and an error is displaid.
forwardport of https://github.com/odoo/odoo/commit/b8328e45d526d276b5781da3523a0d5874da64bd
opw-2660571
opw-2879716
closesodoo/odoo#79084closesodoo/odoo#95386
X-original-commit: 7b296982139518460405fa63eca6774bd82ba7b1
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Minet Adrien (admi) <admi@odoo.com>
This commit adds the ability to pass a placeholder to all fields
containing an input.
This commit tests the ability to use a placeholder in all fields
containing an input.
closesodoo/odoo#95309
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In case we change the employee on an expense and in case expense has
sheet which has only one expense_line_ids, then changing the
expense.employee_id triggers changing the sheet.employee_id too.
In case there are more than one expense linked to the report, then we
unlink the expense line from sheet, (so that the user can create a new report).
task - 2890095
closesodoo/odoo#94424
Signed-off-by: Kevin Baptiste <kba@odoo.com>
When a widget is detached form the DOM, we manually set the owl status of
the corresponding node to 0 (new), but we before this commit, we didn't reset it
to 1 (mounted) when the widget was re-attached. As a consequence, event handlers
were not bound anymore.
Steps to reproduce:
- Open Inventory
- Click on Products > Lots/Serial Numbers
- Open a product
- Click on the Traceability smart button
- Click on a reference (eg: Inventory Adjustment)
- Click on the Traceability Report breadcrumb
-> Breadcrumbs are not working anymore
opw-2838994
closesodoo/odoo#95375
X-original-commit: 7945f7c40045def5e46e8a2f91bdfcc3a42d9f78
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
If we use the auto-complete feature to add PO's lines to an bill or we select multiple PO's then use
'create bill' button, the generated invoice line will copy the sequence line from the PO's line. This
can lead to situation where we will have all the first lines of each PO then all the second, etc, ending
with a mix of all PO's in the bill.
Example:
Purchase order 1
- seq 10 line A
- seq 11 line B
- seq 12 line C
Purchase order 2
- seq 10 line A'
- seq 11 line B'
- seq 12 line C'
Invoice created from those PO's
- seq 10 PO1:line A
- seq 10 PO2:line A'
- seq 11 PO1:line B
- seq 11 PO2:line B'
- seq 12 PO1:line C
- seq 12 PO2:line C'
After this PR this PR the lines from the same PO's will be contiguous like:
Invoice created from those PO 1 and 2
- seq 10 PO1:line A
- seq 11 PO1:line B
- seq 12 PO1:line C
- seq 13 PO2:line A'
- seq 14 PO2:line B'
- seq 15 PO2:line C'
opw-2749682
closesodoo/odoo#95343
X-original-commit: cafe5c1aff1ca1632ce4924a6b027629c283a5e9
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Beckers Thomas (tbs) <tbs@odoo.com>
Rationale
Due to business decisions mass mailing themes are moved to community repository.
As some other moves are planned, notably coupon or mobile UI that are coming
to community repository, this makes sense to have mailing templates along
with the mobile UI.
Having a responsive and mailing-friendly mailing is now part of community
standards.
For any questions please refer to decision makers.
Task-2903948
closesodoo/odoo#95379
X-original-commit: 58ec2382e4e16ca8cff468a7d731d1de84df66ff
Related: odoo/enterprise#29142
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Complement of this commit 7d7c53edf714a07409316750b2b09deaa089a12d
because added records were missed during fw-port.
opw-2862296
opw-2877133
closesodoo/odoo#95374
X-original-commit: 0ec6629de721042ed215e0e011fe38daddccb0d5
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
Before this commit
There is an issue about the translatable field button not properly
shown.
A translatable field <input/> or <textarea/> should have a right padding
in order to ensure its text content does not go behind the translate
button.
After this commit
Existing style regarding this is reapplied.
Part-of: odoo/odoo#94952
Before this commit
On an empty kanban having a record in quick creation, if a user manage
to give the focus somewhere inside the bottom-left zone of the control
panel (or inside the searchview input) WITHOUT closing the form of the
record in quick creation, and then press the ArrowDown key on its
keyboard, a traceback appears.
How to reproduce?
- i.e. go to "Social Marketing > Campaigns"
- change the filter to show no records
- click on create
- make the record dirty BUT invalid (no value for the Responsible field)
- click on the search input
- press arrow down
- => traceback
After this commit
The traceback is not shown anymore because the kanban renderer makes a
safer check before trying to focus a kanban card.
Part-of: odoo/odoo#94952
Before this commit
When defining a view button in some view arch, the combination of its
class attribute with a `t-attf-class` is not correctly handled.
After this commit
This is fixed.
Part-of: odoo/odoo#94952
Before this commit
The view compiler and the kanban compiler both have code to handle
string interpolation.
After this commit
The code is reworked and factorized in a single place.
Part-of: odoo/odoo#94952
For the few remaining uses of the legacy kanban view, the utm addon
style wasn't applied.
This is due to the fact that the legacy kanban view does not have a
"o_kanban_renderer" class.
Part-of: odoo/odoo#94952