With this commit, we make sure that all lines are fully reconciled when
reversing a move.
Steps to reproduce:
- Create a Journal Entry, with eg a line with 300$ debit/credit and two others
lines to make the journal entry fully balanced
| Account | Partner | Debit | Credit |
|-------------|-------------|-----------|------------|
| Account X | | 300.0 | 0.0 |
| Account Y | partner A | 0.0 | 100.0 |
| Account Y | partner B | 0.0 | 200.0 |
- Then reverse the move
-> Only one line is marked as fully reconciled, the other one is marked
as partially reconciled.
This is because each line was passed in the reconcile method with
all the counterpart lines, even those which didn't belong to it.
Therefore, all the firsts lines was marked as partially reconciled
until the last one, which passed with the only counterpart line
left.
With this commit, we group the lines and counterpart lines by account,
and reconcile them.
This is a correction of this commit 6481eb720f36f3e81c2ec8371cccdd893a5e8ddf
which introduced a bug in l10n_mx, when unreconciling moves with tax 0%,
here are the steps to reproduce this bug:
- With l10n_mx installed
- Create an invoice with tax 0%
- Confirm and register payment
- Try to unreconcile the payment
-> We get an UserError : "You are trying to reconcile some entries that
are already reconciled"
This happened because in the first fix, we didn't filtered the already
reconciled moves. Also, it's reproductible in 15 but change is made here
in order to keep consistency between versions.
opw-2810392
opw-2851999
closesodoo/odoo#92446
X-original-commit: 869ed09c23c0ab64b6c030a673d5f549b9b095f9
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Guillaume Vanleynseele <guva@odoo.com>
Ensure that the value of binary_field_real_user is a record before using
it.
closesodoo/odoo#92441
X-original-commit: 4ccf918c1596ac0ee104774d98d014708f03e901
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, the carousels of dynamic snippets were only
initiliazed once the controls were interacted with, making the "speed"
option useless. Now, they are initialized just like any other carousels
via the related public widget. That public widget actually does more,
like ensuring all carousel slides have the same height. That last part
was actually fixed for the 15.0 version but by duplicating the public
widget code at [1], that duplicated code is removed here too.
Note: the carousels do not start on page load but still need to be
hovered first just like normal carousels.
[1]: https://github.com/odoo/odoo/commit/c2e3fdccd84a9077b50d2fcf0dd147026cbc613a
opw-2767903
closesodoo/odoo#92148
X-original-commit: aa8a45001eb60ed5816271b6a3b008e4df19c016
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The commit related to the scss revamp
(356c51876e7ad649e0ea89920000e695fe58a2a5) added new elements to the DOM
but without the correct indentation.
This commit adjusts the indentation of the file.
task-2855553
closesodoo/odoo#91551
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
bcf665a291 introduced this deprecation warning without a stacklevel
argument. Adding it makes the error highlighted precisely where the
deprecated import occurred.
closesodoo/odoo#92420
X-original-commit: 9c01ab0deec4b82c60d8f942c39f2ca33aa42afd
Signed-off-by: Julien Castiaux <juc@odoo.com>
Signed-off-by: Paul Morelle <pmo@odoo.com>
Since [1] synonyms entered on IAP had to be lower-case to be matched by
the industry auto-complete.
After this commit the client-side of the configurator makes sure labels
and synonyms are matched without case sensitivity.
Steps to reproduce:
- Add an upper-case synonym on IAP
- Create a new website
- Search for added synonym
=> Industry associated with synonym did not show up.
[1]: https://github.com/odoo/odoo/commit/5d5d5d75d52a2a9e0d12bdb6442e006327ba9b0c
task-2835608
closesodoo/odoo#92419
X-original-commit: 1385a20c7ce22d2a68fa5d76ca8e34e4c679d402
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Having the parameter stacklevel=2 in warnings.warn() logs the warning
once per location that calls the method with the given warning. This is
what makes sense for warning calls to deprecated methods.
closesodoo/odoo#92411
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
When retrying a test, if a deprecation warning has been emitted the
first time, it will not be re-emitted the second time, and will
therefore not be shown in logs. Use warnings.catch_warnings() to reset
the "emission counter" of the warnings.
Part-of: odoo/odoo#92411
Part of the overall v16 SCSS optimization/restyle, task-2704984
This commit also uses padding instead of margin to select emojis more
easily.
task-2856230
closesodoo/odoo#91618
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit improves cross-browser compatibility for the `user-select`
property by adapting the css statement to Safari's Webkit syntax.
task-2853292
closesodoo/odoo#91483
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Follow-up of #91671 (Task-2817547)
Changes above fixed an issue with composer suggested recipient
feature not properly prompting a dialog to create new partners.
The fix was correct before #90678 (Task-2831082/Task-2849934), but
it needs to be slightly adapted for this small technical changes.
By omiting them, any change of checkbox state results in a crash.
This commit properly adapt code in `_onChangeCheckbox` to take
into account both changes.
closesodoo/odoo#92408
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Top level components should always be wrapped in containers since they have to receive
a record comming from messaging. To do that, we need to wait for messaging to be initialized.
In the PR introducing the new environment in the discuss app, some of those components will
be passed to the main_component registry, messaging won't be ready yet. In order to ease the
transition, the last components missing a wrapper have been wrapped.
task-2582313
closesodoo/odoo#92402
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The note "Quotation viewed by customer" posted when a public user
accesses an order on the portal (with a token) was translated in
the "automatic" language, i.e. the website or user (or browser language).
This doesn't make much sense since log notes are not meant to be shown to
the user, only to the internal user(s) (/salesman).
This commit makes sure that the message is not translated in the website/customer lang,
but in the salesman or company language instead.
Task - 2836421
closesodoo/odoo#90318
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
If you do not have favorite filters available in the mass mailing for
selected model, we display empty drop down, which is not ideal.
This commit improves the behavior with following changes:
- If there is no filter available (for this target) and no condition
set in the mailing domain, do not display anything
- If mailing domain is set but there is not filter available, show a
custom label "Save Filter as Favorite" save icon next to it
Ent PR: https://github.com/odoo/enterprise/pull/26308
task-2711258
closesodoo/odoo#87673
Related: odoo/enterprise#26308
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Part of the overall v16 SCSS optimization/restyle, task-2704984.
task-2859751
closesodoo/odoo#92132
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
The only mail.channel rule was that a user only had access to channels
they're members of, or can subscribe to (public, or group based).
This rule applied to admins as well, forcing them to switch to
super-admin mode in order to manage mail channels.
This is undesirable on lots of axis:
- superadmin mode is a bit of a last-ditch feature, as a result it's
somewhat hidden
- there is a much higher risk of screwing up as superadmin mode
basically lifts all the access rules, which can have correctness
implications
- auditing completely breaks down when using superadmin mode, as the
real identity of the user is lost
OPW-2857136
closesodoo/odoo#92299
X-original-commit: 1a77ab5726bbcc477d12f40f67433d474ea85316
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Timeoff is apply in the view to take effect on every view type
instead of only the calendar.
closesodoo/odoo#92027
X-original-commit: 3b89abcc3def129b91221eb983a5a936670d7b9c
Signed-off-by: Kevin Baptiste <kba@odoo.com>
'name' field not present in 'gamification.goal' model
which causes error while rendering mail template such that
object 'gamification.goal' has no attribute 'name'
opw-2844136
closesodoo/odoo#92300
Closes: https://github.com/odoo/odoo/pull/91439
X-original-commit: 0a1970e218527440debb8c75fff2fa47de5e2677
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Using customization, if you add a field on `mail.template`
with a `groups=` attribute with a group your regular users do not belong to,
e.g. `groups="base.group_system"`,
the users will have an access error when attempting to read the given
field when checking if the template is dynamic,
with the `_is_dynamic` method.
We could restrict the list of fields to read/check to the fields
the user has access, but that means a user could
duplicate a template with code in the fields he cannot see.
So, read the field has sudo to make sure they do not contain code
is the way to go.
closesodoo/odoo#92371
X-original-commit: 41cbd3fdfec8e2b7a8b22360c5bb7f7b9bab4b1e
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
The constraint is added in `hr_payroll`, checking that if `is_unforeseen`
is True, then so must be `is_leave`. To reproduce the error simply install
`hr_payroll`, edit Work Entry Type Attendance to set as unforeseen absence
and upgrade the module `hr_work_entry_contract`.
closesodoo/odoo#92358
X-original-commit: 5448ddcbec8a1058aa271206d5a8999b3e67dda5
Signed-off-by: Kevin Baptiste <kba@odoo.com>
following commit 55398263f9297ab2709e4c4c2a9c6c3ee7f59c8a
Introduce a new param to fix a notification issue. However
we could use the context instead of a new parameter in order
to avoid breaking the customisation.
Linked to PR #88303 discussion
closesodoo/odoo#92353
X-original-commit: 69dcdd410adcefe29bfa4fecd2e7c50fe3465b19
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This Goal will help end user to find most 404 hits and fix the
legits one...
Fixing typo, creating missing redirect, or fixing code.
We need to cast the event-name since plausible only accept 'string'
as custom event name, so if we push 404 instead of '404' the event
crash.
closesodoo/odoo#92243
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Original 14.0 commit title:
Prevent deadlock on editor save when an option is focused
See [1].
In 15.0, the code worsened... but, by chance, fixed the deadlock bug.
See adapted version via the X-original-commit.
With this master version of the original commit, it is tried to clean
the code a bit... at least around the code that was originally touched,
without starting a big refactoring that is again needed. The deprecated
(and added by mistake) 'edition_will_stopped' and 'edition_was_stopped'
events are now gone.
Hopefully, we will continue to improve that editor hierarchy (and
ultimately converting to OWL?) in future updates.
[1]: https://github.com/odoo/odoo/commit/53a08b3470d7d18488abf93b7ea6551700650460
Related to opw-2767903
closesodoo/odoo#92321
X-original-commit: 483a2d6cac1be3b40a4d1878536baea9e6098ec1
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
odoo/odoo#87522 introduced the concept to automatically
inline tree, kanban and form views under one2many/many2many fields
within form views.
The goal being for the web client to make less `get_views` calls.
However, currently, automatically inlined form views
under one2many/many2many fields leads
to more triggered onchanges than before,
triggering more field computations than before,
potentially leading to performance issues
as more fields are computed than before.
Besides, they are not visible in the tree/kanban view
and their computation can therefore be considered useless.
At worst, it can even causes bugs, by triggering computation
in places they were not used / do not handle correctly,
as explained in
https://github.com/odoo/odoo/pull/87522#issuecomment-1132554918odoo/odoo#91878
This revision reverts the behavior to automatically inline
form views, while keeping the inlining of kanban/tree views.
However, by reverting this, we re-introduce a limitation
of the web client behavior regarding onchanges,
explained in odoo/odoo#91935.
This is therefore not perfect,
but at least the previous behavior is back.
In the future, work will be done to re-introduce the automatically
inlined form view, while solving both issues:
- Do not trigger more onchanges than necessary,
- Solve the limitation of the web client shown in odoo/odoo#91935closesodoo/odoo#91968
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Current behavior:
When selling a product that have a taxe set in a PoS, the sale report
was not correct. The collumn untaxed amount to invoice would contains
the amount to invoice that includes the taxes wich is not correct.
Steps to reproduce:
- Install sales & pos
- Set the Acoustic bloc screen tax to 15%
- Open a pos session and Sell an acoustic bloc screen
- Validate the payment and close the session
- Open the sales app
- Sell an acoustic bloc screen to any customer
- Deliver it (update it's quantity if necessary)
- Sales > Reporting > Sales
- Switch to the pivot view
- On the "measures" button, check "Untaxed Amount Invoiced" and "Untaxed Amount To Invoice"
- Show the entries by Order#
- "Untaxed amount to invoice" should be the same as "untaxed total"
opw-2681477
closesodoo/odoo#92217
X-original-commit: 8c20fb4e126822d81fa7e1de6912d5c75a881b7b
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
Steps to reproduce the bug:
- Create a storable product “P1”:
- Standard price: 20$
- Add vendor in the Purchase tab:
- name: Azure Interior
- min qty: 10
- price: $15
- Create a PO:
- Vendor: "Azure Interior"
- Product line: “P1”
Automatically, the Quantity field will automatically get populated as 10 Units
and price:$15 as per the pricelist
- Confirm the PO
A picking will be created containing a stock_move with a price of $15 and a QTY of 10
- Edit the Quantity to 9 Units and save the PO
The price will be updated to $20 on the PO line, but not in the `stock.move`
Problem:
When we update the qty in the PO line, a new move with a quantity of “-1” and
a price of “$20” will be created.
Then, it will be merged with the initial move, but since they are not identical in the price,
we can't merge them, so a new picking is created:
https://github.com/odoo/odoo/blob/dda9700d8236091626cbd78efc0ca4116e1e1acd/addons/stock/models/stock_move.py#L869-L881
Solution:
when the price is updated in a PO line, the price of its linked `stock.move` must also be updated
opw-2825160
closesodoo/odoo#92208
X-original-commit: c8d74a1cb4bfed8226e52e0bc6f243b4e483fc98
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Two ACL were giving the same rights to the same group on the same model.
This commit removes the confusing one where the name targeted the
managers when the rule was targeting sales users.
closesodoo/odoo#88210
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Remove rights given to sale manager when the same rights were given to
the sale users, which is implied by the sale manager group.
Part-of: odoo/odoo#88210
Since (at least) Chrome 94+, some element's sizing computation returns a
slightly different value (in the order of a fraction of a pixel). Sadly,
due to rounding, this difference has an impact on exact sizing
assertion.
As the difference is *really* small, introducing a margin of error (i.e.
<= 1px) looks reasonnable ; as implemented in this commit. More
specifically as Element.scrollHeight can have either an int or a decimal
value (cf. fractional-scaling), this commit allows to property handle
both usecases.
Reference:
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#determine_if_an_element_has_been_totally_scrolledclosesodoo/odoo#92328
X-original-commit: 93348ae0d0b076fe2dfa094a2d7b3ef74442d390
Related: odoo/enterprise#27790
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
*: website_mass_mailing
Before this commit, some types of buttons were not managed by the
editor, only the primary, secondary and link buttons were supported.
However, if there is another type of btn in the DOM, the editor must be
able to handle it. This commit allows to manage all types of buttons in
the editor. This commit also adds a test so that the bug does not come
back.
Steps to reproduce the fixed bug:
- Drop a block with a <a> with the btn-success class
- Click on the button to edit it
- The link tool part in the editor does not work properly
or
- Drop the newsletter block
- Save and register to the newsletter
- Edit the new "Thanks" button
- The link tool part in the editor does not work properly
opw-2802139
closesodoo/odoo#92325
X-original-commit: 4c68b3e923610e1d573b4bd2b241b2fc5923c412
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is a copy of 7ddcebfc, which was reverted in dfcfe63c.
Before this commit, the menu_service was not included into the
`pos.assets_backend` bundle which was fine until we had to add
a dependency to `menu_service` in a file which is included in
`web.assets_backend`. Since pos.assets_backend imports pratically
all `web.assets_backend` bundle, there was dependencies errors.
The sublient issue is that the pos bundle was built relying on a
specific feature (the primary copy of Qweb templates) which was
dropped when we introduced the new assets manager (8cc06617).
There a two other approaches that we could consider:
- Create a new bundle `web.assets_backend_primary` that would be
called separately by `web.assets_backend`and `pos_assets_backend`,
it would mimic the dropped behaviour
- Change the `pos_assets_backend` to manually call every specific
element they need to function, which would prevent the depepdencies
issues
Unfortunately, both solutions are not realistic on a stable release,
which is why we chose to reintroduce this patch, and will fix the POS
bundle properly in master, where the side-effects can be handled.
After this commit, there are no dependency issues, and the menus
are not loaded, as expected and as before.
Part of task 2860257
closesodoo/odoo#92324
X-original-commit: b077fe72e8d9338e802cbceb580f3abcb6938462
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
Since [1], during the call of `apply_inheritance_specs` in charge of
resolving all the xpath of inheriting views and building the whole
primary view, processing instructions were added to mark the locations
where nodes were removed. Before that commit, another system was in
place where the following node next to the removal was marked via a
meta-oe-xpath-replacing attribute.
The problem with that change is that some of those processing
instructions were actually not removed once the branding was distributed
before the view was served... indeed all processing instructions which
were in the `<head/>` or a t-ignore area were ignored instead of removed.
This was actually already the case with the old system of the attribute
"meta-oe-xpath-replacing" but it was never noticed (as either the
attribute was there but had no effect or was indirectly gone if it
landed on a `<t>` node).
After [1], a bug was reported in 15.0 with the website configurator
where the processing instruction actually made some nonsense appear on
top of the page (at least without the work being discussed at [2] which
makes it so processing instructions act as HTML comments as it should
normally be the case).
[1]: https://github.com/odoo/odoo/commit/f67832a3ae0d9a3b5b53129132762e6bc1aed874
[2]: https://github.com/odoo/odoo/pull/92213closesodoo/odoo#92316
X-original-commit: 4310d012a16f982c2336d084254b5c5617794ee2
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The kanban view for sales team is defined with a progressbar widget to
indicate sales target. There was a .include of KanbanRecord to customize
the behavior of that widget whenever the target value was not set. This
was problematic for the following reasons:
1. it is a .include, so it is applied to all kanban records in odoo
2. it is a lot of code,
3. and it mostly duplicate the editing logic in the progressbar widget
With this commit, the .include is removed, and a new
'sales_team_progressbar' widget is introduced to mimic the previous
customization. This should be safer and easier to maintain.
closesodoo/odoo#92071
Related: odoo/enterprise#27747
Signed-off-by: Géry Debongnie <ged@odoo.com>
The kanban view was recently improved to add the support of 'action' and
'type' attributes on the kanban arch. This commit takes advantage of
that change to simplify a few views in various addons.
Part-of: odoo/odoo#92071