In the customize theme modal, if one option enabled views which were
a subset of the views which are enabled by another option, both options
would be checked on modal opening if all the related views were active.
This is the case for the "choose an image" and the "choose a pattern"
options: the first one enables a view which adds an image on the body
and the second one enables the same view but also another which enables
the fact that the image must be repeated.
This commit solves the issue by always selecting the option enabling
the most views among the checked options in a same set.
opw-1958395
closesodoo/odoo#35465
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Allow to see the lot/serial number on the order form, only for the users
with group group_production_lot.
opw-2037285
closesodoo/odoo#35443
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
- Set the user language to a RTL language, e.g. Arabic
- Open a list view containing float or monetary fields, e.g. the invoice
list view
The numbers are left aligned while the corresponding columns headers are
right aligned, making the list view confusing.
The header alignment is hardcoded at rendering rather than in the SCSS.
Therefore, `rtlcss` doesn't affect it.
Instead of hardcoding the alignment, we use a proper CSS class so it is
adapted by `rtlcss`.
opw-2044019
closesodoo/odoo#35414
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce the bug:
- Install stock_dropshipping module and enable Routes on SO lines
- Create a storable product P with a supplier S
- Create a SO with P and set this line with the route dropship
- Confirm the SO ( a PO has been created to S with P)
- Change P on the SO with an other product
Bug:
The product P stayed on the PO.
So a product linked to a PO line cannot be changed on a SO.
opw:2040249
closesodoo/odoo#35383
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Mass mailing themes are redefining some bg-* classes their own way...
unfortunately that way was not working anymore with BS3. This commit
adapts the CSS code to solve the problem but ideally, themes should be
refactored to be more BS4 compliant.
opw-2032131
closesodoo/odoo#35333
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this patch Amount currency was always +ve and doesn't care about about Debit/Credit values.
See _check_currency_amount constrains.
Fixes: #35403closesodoo/odoo#35422
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
It was not possible to manually set a default analytic account as it was
overriden by the onchange, even if no account was returned by account_get
Apply the same logic as in _prepare_invoice_line on sale.order.line
closesodoo/odoo#30282
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
An user with portal access puts a product into the wishlist.
The same product is "unpublished" from the site backend, while still
into the wishlist of the user. The user now cannot access the website,
because because of the record rule website_sale.product_template_public
which prevent the unprivileged user from accessing the products.
OPW-2042511
closesodoo/odoo#35397
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
This commit intend to allow better inheritance in the
account_move_line_creation_process
The new _prepare_account_move_and_lines method only prepare
the move and the lines but does not write and post them.
This is done by the former _create_account_move_line method.
Needed to fix pos_sessions with unbalanced journal entries
caused by round globally option with taxes included in price
I.E. opw-2038814
closesodoo/odoo#35351
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Go to CRM/Sales/Team Pileline. Place your cursor on the chart, a tooltip
appears, move your cusror away, the tooltip disappear. Now clic anywhere
on the interface so the page change (i.e. on "x Open Opportunities") and
quickly while the page loads place your cursor on the tooltip, it
appears but when the page change it doesn't disappear.
The problem here is that the graph element is removed from the DOM which
prevent the correct handling of the `mousehover` event used internally
by nv.d3 to show/hide the related tooltip.
The solution is to manually hide the tooltip when the graph element is
removed from the DOM.
opw-2042286
closesodoo/odoo#35172
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The menu Timesheet / Configuration / Settings should only be displayed to the group Administration / Settings.
Without admin access, an access error is raised when clicking on the menu item.
The equivalent menu item in other apps is restricted to Administration / Settings.
closesodoo/odoo#35388
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
When setting the authorization code, a refresh token is generated in
the background and stored in a system parameter.
However, when saving the general settings (res.config.settings)
without changing the authorization code, the refresh token is deleted.
The refresh token should only be deleted if the authorization was
removed.
This was not the case as the set_param is always called and a value is
only computed when the authorization code has changed. The current
value was never retrieved.
Set a ir.config_parameter only when it a value has changed.
closesodoo/odoo#35028
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
When duplicating a record, the language is set to None in the context
when copying a record
new = self.with_context(lang=None).create(vals)
self.with_context(from_copy_translation=True).copy_translations(new, excluded=default or ())
In mail.thread, the usecase of no language in the context was considered
if 'lang' not in self._context:
track_threads = threads.with_context(lang=self.env.user.lang)
but not the case of a language explicitly set to None
This means that, when duplicating a record, the tracked fields mesages
were untranslated.
Fixesodoo/odoo#35213Closesodoo/odoo#35331
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Steps to reproduce:
1. Go to "My Website".
1. Click *New > New Page*.
1. Page title: "hello", add to menu: yes.
1. Add a snippet, write "hello 1", save.
1. Go to "My Website 2".
1. Click *New > New Page*.
1. Page title: "hello", add to menu: yes.
1. Add a snippet, write "hello 2", save.
1. Go to *Pages > Edit Menu*.
1. Edit the "hello" menu.
1. Change URL to `/hello-world` and save.
1. Click on the "hello" menu.
1. A page with "hello 2" appears.
1. Go to "My Website".
1. Go to *Pages > Edit Menu*.
1. Edit the "hello" menu.
1. Change URL to `/hello-world` and save.
1. Click on the "hello" menu.
Current behavior: Error 404
Expected behavior: A page with "hello 1" appears.
closesodoo/odoo#34913
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
When creating a res_partner company, with "Auto-populate company data",
if there is 'Insufficient Credit', AccessError, ConnectionError are caught,
but not UserError.
The user can therefore gets a vague js error
"Uncaught TypeError: Cannot read property 'type' of undefined"
We thus add exceptions.UserError among the caught exceptions.
opw 2040646
closesodoo/odoo#35366
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Have an inherited view replacing a node in its parent
namely:
```
<view name="1">
<world/>
<world/>
<world/>
</view>
```
Inherited by
```
<view name="2" inherit_id="1">
<xpath expr="//world[1]" position="replace">
<world/>
</xpath>
</view>
```
Before this commit, the resulting xpath branding of the nodes
(useful for web_editor, to know where it is supposed to anchor new elements)
was incorrect. Note that there is the branding attr data-oe-view_id which specifies in which view they are
The 2nd and 3rd world in view #1 were numbered respectively world[1] and world[2]
which is incorrect since we *know* those should be world[2] and world[3]
(in their own view, i.e. in view #1)
This was because when replacing the node, the code lost track of what it replaced
and that it attributed the inheriting branding to the replacing nodes
After this commit, the 2nd and 3rd world nodes are numbered
world[2] and world[3] respectively
OPW 2007312
closesodoo/odoo#35134
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Steps to reproduce the bug:
- Set your user in multi company
- Create two companies C1 and C2 where C2 is a child of C1
- Create a job position JP in company C2
- Create an employee E in company C2
- Log in company C1
- Try to archive E
Bug:
An access error was raised due to ir.rule "Job multi company rule" saying that
you can only see the job position in your company or in your company's childs.
The same logic must be applied for the hr.employee to avoid access rights error
in multi company.
opw:2044018
closesodoo/odoo#35370
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
-- Create a new bank statement;
-- Add a transaction;
-- Reconcile;
-- Create a write-off with tax.
Before this commit, the tax journal item's label only contains the name
of the tax.
Now, the tax journal item's label contains the write-off label and the
tax's name. This is the same behaviour as it was in version 11
(https://github.com/odoo/odoo/blob/11.0/addons/account/models/account_move.py#L1259).
opw-2025480
closesodoo/odoo#35348
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This reverts commit 7273719b88.
Reply to header of templates should be used only for mass mailing purpose.
It is a known limitation and should not be changed in table without more
in-depth testing.
closesodoo/odoo#35354
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
If in web_studio we:
- duplicate "Invoices" report
- delete "Invoices" report
The duplication will not work anymore, since the report class
report.account.report_invoice_with_payments is shared but requires
account.report_invoice_with_payments (original report).
With this changeset, we forgo checking model type of report since it
should always be account.invoice anyway.
opw-2045435
closes#35349
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When the scheduler needs to create a new PO to resupply a product,
it tries to use the 'supplier currency' on the vendor if set,
and defaulted to the currency of the current user's company.
However the scheduler is run in sudo, so the user is OdooBot,
which means that the currency is incorrect if OdooBot is in another company.
The company that should be used is the one that is used everywhere else.
opw 2041798
closesodoo/odoo#35285
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Before this commit, the duration (days/hours of the leave) wasn't
compute when importing leaves.
opw-1916913
closesodoo/odoo#35167
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
When using the "test import" feature to import leaves request
allocations, odoo fails with a 500 error and no error message.
The only difference with an actual import is that the test dry-runs by
roll-backing. The issue here are that mails are sent *after* a commit
is done hence crashes because they do not exist any more.
Fine-tuning of c7b6fcb9f2 for
hr.leave.allocation
opw-2041872
closesodoo/odoo#35166
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Unset the default sale tax on the company
Make a customer invoice
Add a line
Before this commit, the tax on the line was the purchase tax
because of a funky "if"
After this commit, no tax is set on the line
It is worth noting that archiving taxes shouldn't affect this flow
as it is the user's reponsibility to di his set up correctly
OPW 2043477
closesodoo/odoo#35271
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
In some cases, when changing in the inventory setting from tracking lots and
serial numbers to not tracking, an issue could occur when trying to close the
MO with processed work orders and lots.
opw:2040752
closesodoo/odoo#35250
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
In saas-14, 36fdb2ff49 was recently added to fix the flow where an empty
pricelist code being submitted in the cart input should reset the pricelist.
But we waited 12.0 to add an easy test, as we have `MockRequest` to easily
mock and simulate frontend context to test controller in python tests, see
6ebcb1db80.
Following #34711closesodoo/odoo#35253
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, the amount total of an order in round_globally
was simply the sum of all taxes amounts, then rounded
This is plain wrong, as the accepted semantics of round globally is that:
- each tax for each line is computed without rounding
- then each taxes is summed across all order lines
- then that amount is rounded
- then all those rounded tax amount are summed together
After this commit, this semantics is implemented
closesodoo/odoo#35211
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Since f98470e6cf, the 'user_email' field on project.task is
'related_sudo=False', checking access rights when fetching the field. For performance issue,
we need to keep this fix (as badly explain in commit above).
But, this causes multi company problem. Here are the steps to reproduce:
1/ User 1 (in company A) creates a task in a project (all in company A)
2/ user 1 switches to company B
3/ user 2 (in company A) tries to access the task and get an error, as it tries to access
a field 'email' of 'res.users' as himself (not 'sudo'), but the user is in a company that
user B can not access, hence the error.
The fix is quite simple here, as the problematic field is not used in the kanban view. It
does not solve the source problem, but the user is not blocked anymore.
opw-2041982
closesodoo/odoo#35243
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Before this commit, it was not possible to install website_forum if the 'Main
Frontent Layout' had been COW'd.
When loading Forum Layout view which is a primary child view, it would crash
during view validation, not finding the element to xpath.
Triggering COW instead of copying fix the issue.
opw-2036119
closesodoo/odoo#35138
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Enable the rtlcss library, translate the website into arabic, add a
carousel. The previous left appears right on the screen and the next
right arrow on the left.
This fix is to invert the two value (left arrow/right arrow) when the
screen in RTL-ed.
rtlcss documentation is available at:
https://rtlcss.com/learn/usage-guide/value-directives/#tip
opw-2041898
closesodoo/odoo#35220
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, the placeholder for the website was incorrect, it
missed the protocol. This could lead to a confusion to the user who
could add a website without protocol. A website without protocol will be
open in the browser as a page of the same website and not as an
independent website.
Now, the placeholders have the correct protocol.
opw-2042816
closesodoo/odoo#35217
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
In particular, the problem forbids a user to lower quantities on a SO
if the responsible is currently in another company.
- Install sale_stock and sale
- Activate Multi-companies
- Create Company A and Company B
- Admin in A and B
- Other user U (e.g. duplicate of Admin) in B only
- U creates a SO with a product, confirms it
- Admin connects to Company A
- U decreases product_uom_qty in a line
- U gets an AccessError
When decreasing the quantity, in sale_stock,
_log_decrease_ordered_quantity is called and calls stock's _log_activity,
that needs access to the responsible or the superuser's partner.
If that user is in another company, this raises an AccessError.
Because it is when accessing the partner that the AccessError is raised,
we cannot cleanly use a check_access_rule to determine when to use sudo.
OPW 2036879
closesodoo/odoo#35132
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Spec
====
Before this commit if a user has access to a document thanks to an access_token,
he would already be able to see the chatter for the document, but he would not
be able to download the attachments that are shown to him on that same chatter.
The goal of this commit it to let the user download those attachments. This
makes sense especially since messages publicly posted in the chatter might
generate emails to the user, and the attachments will already be attached to
those emails, so this PR is not actually granting access to more information to
the user in a typical flow.
The only difference is when said user was added as a follower after the
attachments have been posted in which case he will be able to read them even
though he didn't get the original emails, but this is consistent with how he
will also be able to read the existing messages even though he didn't get them
by email.
Technical
=========
To solve this issue we could have used the access_token of the main document,
but this would allow any user with the token to access all attachments of the
document, including those he should potentially not be able to see such as those
from internal notes.
Instead we ensure a different access_token is properly set on each of the
attachments that are going to be shown and we update their links accordingly.
This allows for a more granular access control, and it also takes advantage of
the existing /web/content route without having to adapt it.
opw-2040455
Also discussed in task-37264
closes#34384closesodoo/odoo#35121
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Co-authored-by: Pratima Gupta <pgu@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
In the editor, when you write a letter at the end or beginning of a link
it is written outside the link. But if you press "Enter", we get on a
newline with an empty link duplicated on the new line.
This is caused by the custom code handling "Enter" keypress.
With this changeset, in this situation we place the range just before
the beginning or after the end of a link.
opw-1724606
opw-2042097
closes#35188
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Running the following 12.0 tests: https://github.com/odoo/enterprise/blob/b7768337d88990e403338c39e461ecb1796413ab/l10n_mx_edi_landing/tests/test_landing.py#L126
raise the following error using anglo-saxon:
```bash
File stock_account/models/account_invoice.py, line 60, in invoice_validate
File stock_account/models/account_invoice.py, line 89, in _anglo_saxon_reconcile_valuation
File 10n_mx_edi/models/account_move.py, line 12, in reconcile
File account/models/account_move.py, line 957, in reconcile
File account/models/account_move.py, line 948, in _check_reconcile_validity
odoo.exceptions.UserError: ('Account Mercancías en tránsito (115.05.01) does not allow reconciliation. First change the configuration of this account to allow it.', '')
```
closesodoo/odoo#34463
Signed-off-by: Josse Colpaert <jco@openerp.com>
The production.move_raw_ids usually contains only one move per bom_line_id;
it might not always be the case, as ccbd6712f6 used move[0] to get a singleton.
The following calls to _get_document_iterate_key, _log_activity_get_documents,
also require move to be a singleton, so we use replace move by move[0].
opw 2042099
closesodoo/odoo#35206
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Before this commit, the unit price in the so's portal, had the same
decimal precision as the currency and not the one specified for the unit
prices.
Now, the portal shows the unit prices with their specific decimal
precision.
related to : a1e6a0f0c5
opw-2042089
closesodoo/odoo#35171
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
The "lots & serial numbers" feature can be deactivated at any point.
If there are active products that are tracked, either by lot or serial number,
it can be confusing since deactivating it will hide the relevant fields.
Therefore we raise a warning at onchange if there are tracked active products.
opw 2036173
closesodoo/odoo#35108
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>