Writting a view arch will trigger check_xml, which is
quite expensive.
Avoiding to write user_groups_view when arch didn't changed
will slightly improve performance by avoiding to check
already validated views.
In most case, except_orm.value is empty, leading to a str
representation of the args, which is a repr of each element
of the tuple in the case of exept_orm:
(repr(name), repr(value)) -> ('name', None)
In this case, the None value is just noise and the name will be repr
causing "'" to be escaped and replacing carriage return
by "\n" making it difficult to read and to compare.
- resume_line_view_search was not used and line_type
isn't a valid field (should be line_type_id)
- there is no field customer or supplier on res.partner
Introduced by https://github.com/odoo/odoo/commit/ab483a3a6610a09391ec00e9c1c49489ca4a4f12
There was no way to exit the 'cancelled' state of an account.payment.
The new live-cycle is:
- draft -> posted -> sent -> reconciled -> cancelled
- action_draft to move the account.payment from ('cancelled', 'posted', 'sent', 'reconciled') -> 'draft'
- cancel to move the account.payment from 'draft' -> 'cancel'
closesodoo/odoo#40193
X-original-commit: 53e83ae9e68d418bf7322374815b942309bf7fef
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
The leave description is now replaced with a compute method in order to
obfuscate the description based on the user's group.
closesodoo/odoo#38995
Taskid: 2088559
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
self.env.user returns the current user but browsed with the superuser:
- self.env.user == current user
- self.env.user.env.user == administrator
get_context uses self.env.user to retrieve the context of the user.
Before this patch, the name of the filters was translated in the
language of the administrator instead of the current user.
Closesodoo/odoo#40086closesodoo/odoo#40170
X-original-commit: b39c8da2a49e43cc1bd7c837bf0e99ad437992ff
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
In IE Edge async and await are supported, but guardedCatch is added to
polyfilled MyPromise object and async methods return original Promise so
depending of chain guardedCatch can cause en error or not.
It seems that historically, the MyPromise patching has also had issue in
firefox with it sometimes working or not.
In this changeset we completely remove it (which will have the drawback
of more error shown in console in firefox).
opw-1964486
opw-2116839
closes#39953closesodoo/odoo#40154
X-original-commit: 5ca38da66de00ca6efef307bcb39fc5037903221
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
* In a pos-session with table management create a new order with products
and go back to the floor-plan.
* The order is sinced to the back-end.
* Open the table again, remove all products but keep the order.
* Go back to floorplan to trigger syncing again.
* Open the table again.
behaviour before fix:
* The empty order is not loaded in the frontend anymore.
* To close the session the order has to be manually removed in the backend.
After fix:
* The order is still visible in the frontend and can be removed or finalysed as expected.
closesodoo/odoo#40165
X-original-commit: 3add8dd226f39d5166873a575b858694eeb2e6ee
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Add the id of the current company to the evaluation context for ir.rule
domains
closesodoo/odoo#40162
X-original-commit: 8bf4b8e015fa61f3929dbb8f1d81e1127272cfbb
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Fine tuning of this commit: f93fcaffb5
Steps to reproduce the bug:
- Open runbot v11
- Restrict Demo's access to Sales Manager for sales and employee for Employee
- Try to create a new quotation
Bug:
- You got Odoo server Error
Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:
- Inventory/User
- Accounting & Finance/Billing
- Purchases/User
- Purchases/Manager
- Other Extra Rights/Portal
(Document model: purchase.order.line) - (Operation: read, User: 5)
opw:2120692
closesodoo/odoo#40153
X-original-commit: 1b14af28fec3cae0efc4438e77e6e0925e487b89
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
A journal entry must always have the same currency as the account when
a secondary currency is set on this one.
closesodoo/odoo#39844
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
When using the flamegraph module from a parent directory of odoo, the
dirname method returns a relative path, leading to a traceback.
With this commit, the odoo_path is enforced to be an absolute path.
closesodoo/odoo#40147
X-original-commit: 75efe4b4ca6c0ccef6ec592b317e7c2b572f28fc
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
When assigning a default value to a computed monetary field, if self
contains records with different currencies, the assignation will fail
when trying to round the value (because self[currency_field] is a
recordset of multiple currencies).
Globally, assigning a monetary value to records in different currencies
should never happen. The only case we want to support is defaulting a
computed monetary to 0.0.
Add clear error when trying to set monetaries in multi-currency.
closesodoo/odoo#40155
X-original-commit: 3a58dfa1e51702a659e9113271f19d087e3ec349
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
The original goal was to not have any pre-installed theme by default
and to force the user to consider installing one through the customize
dialog.
Now that we have a system to allow switching theme, it is better to have
one installed by default and allow the user to switch theme from the
customize dialog (note that last part was made in the parent commit with
the merge of website_theme_install into website).
Note: theme_default is purely empty, it is only installed by default for
clarity in the theme selection screen, for the default website.
Commit 5fcf891e07 introduced optimizations for
name_search in several models. However, that produces some counter-intuitive
searches.
In a DB with project and custom data:
>>> Project = self.env['project.task']
>>> Project.search([('user_id', 'ilike', 'demo')]).mapped('user_id.name')
['Marc Demo']
>>> Project.search([('user_id', 'not ilike', 'demo')]).mapped('user_id.name')
['Marc Demo']
The projects returned with 'not ilike' are a super-set of those returned with
'ilike':
>>> Project.search([('user_id', 'ilike', 'demo')])
project.task(22, 21, 20, 16, 14, 13)
>>> Project.search([('user_id', 'not ilike', 'demo')])
project.task(22, 21, 29, 28, 27, 26, 25, 20, 16, 14, 13, 31, 30)
This commit fix this behaviour by choosing '!=' instead of '=' whenever the
operator is a negation operator.
The 'res.users' is more exposed than the other models touched by
5fcf891e07, because user may search for 'Created
by' in the web client.
closesodoo/odoo#40140
X-original-commit: b3c539b09a0bd462309a10c565cb91375a7011b9
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The self don't contain 'interface_protocol'.
The 'interface_protocol' is in self.dev because we add this in 'supported' function.
closesodoo/odoo#40132
X-original-commit: 6963a016385c4310dd547ae2d0d7e1d5cb4fab67
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
commit 89f20d2c29 removed thumbnail but didn't adapt the views that used it.
Adapt the view and directly use the datas and not the thumbnail.
Close#38747closesodoo/odoo#40126
X-original-commit: e73b468135d27ce8c1e84c3ecf2d0b3af176d760
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
In 12.3 there was a number of changes in source mode. This was reverted
before 13.0 and somehow it seems the source mode was lost between the
12.3 editor changes and its revert.
With this changeset, we introduce back source mode as it was in 12.
opw-2091649
opw-2116960
closes#40026closesodoo/odoo#40120
X-original-commit: e29c08969f6e7ad981e9b7b79027d84dc89fbca2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Fixes https://github.com/odoo/odoo/issues/39358
Before this commit Internal user (With no other Rights) cannot perform any activity on Reminder Popup due to missing rights to set calendar_last_notif_ack field.
With this fix, we are now using sudo to write calendar_last_notif_ack
closesodoo/odoo#40104
X-original-commit: 91560fae56f1cba09141eefa1d0da03f4a7b3f72
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Reproduce this issue
- Install CRM & Sales
- Create 2 sales team in CRM settings
- Create some invoices and register payments for the 2 teams
- Go in CRM > Sales > Team pipelines
The invoicing amount is still 0 for both teams.
Cause
- The `_compute_invoiced` method in `CrmTeam` models use a SQL
query to retrieve the invoices lines but it returns an empty
recordset because the dates are not right ordered.
- The line balance are negatives values, doing a SUM() will always
returns 0
This commit re-order the dates and invert the sign of line.balance.
OPW-2119819
closesodoo/odoo#40115
X-original-commit: 578dacc3af04996754d1ec67108106379a9c3c38
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
Some tests (test_00_workorder_process, ...) are executed several times, only
because we extend a test class to retrieve the setUp (or setUpClass) instead
of creating a common class.
This could lead to issues, (like for test_00_workorder_process) depending on the
installed modules.
Purpose
=======
This module contains tests related to base automation. It makes no
sense as they have no business value.
Specification
=============
Move all the tests to a separate module as it contains models used only
to perform tests independently to functional aspects of other models.
A patched method was not unpatched. Which triggered issues in a staging
master branch trying to untie a bit mail tests.
closesodoo/odoo#40099
X-original-commit: 5dbf4c56765c3661eb2dca24e90bc0b420918e9a
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Install stock and sale. Create a sale with 2+ products, save and
confirm.
Look for the created picking.
There will be no source doument, because of
cb618e9a99
the behavior has changed when there are multiple source
document, possibly to avoid displaying the wrong source if they
differ.
Adding the possibility to display multiple source documents, eventually
truncating the list
opw-2117886
closesodoo/odoo#40098
X-original-commit: baad02d01b86a8d036524b789f046a54a878a729
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Purpose
=======
Steps to reproduce:
- Configure a product of type service to create a task on a
sales order validation, without configuring a project template
- On the SO confirmation, the project is generated without any stages
Additional issue:
- go to the Kanban view of the Project
- filter on something that doesn't give any result
- The kanban switches to edit mode, even if there is
a task
This commit solves both issues.
closesodoo/odoo#40057
X-original-commit: e2de6331f7f75c9c9b086e57b88f6d25a2cd303d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The icon of the 'Vendor Bills' stat button isn't displayed
so fix the icon class.
Task-2115206
closes odoo/odoo#40050
Closes: #40006
X-original-commit: 5a595c5931a87129283c3bb258e0e1169506b628
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
=======
If the user creates a task and if the project isn't set, then all the
stages that are not linked to a project are displayed, which is polluting
the form view.
Specifications
==============
If no project is set on the task form view, do not display any stages
in the statusbar.
closesodoo/odoo#40041
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
In 13.0, we use the IoTBox which handle https correctly
12.0 was still a transition version but people should have switched in
13.0
closesodoo/odoo#39845
X-original-commit: 5d44adcd173cc750b72feb2888613204db5684b4
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Task 2076244
Commit 4a1bbbf added that but it had to be reverted because it didn't
take into account the periodicity of the tax return of the company and
because it added the period for all mail.activity
closesodoo/odoo#38199
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
In case of a multi-record and multi-page (i.e. 2 pages per PDF) report
the assertion is triggered b/c we have 4 pages and only two records with
a PDF of 2 pages each, so the outline_page needs to be unique before
assertion.
len([0, 0, 2, 2]) != len([record_id1, record_id2])
len([0, 2]) == len([record_id1, record_id2])
closesodoo/odoo#40076
X-original-commit: 573e57773b78a5bcac97c9dab4f531a5826e94c0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Activate Google Synchronization, create on OE a recurrent event,
synchronize the calendar, then delete an event of the recursion on GC,
sync again on OE.
The event will be deleted from GC but not from OE after sync.
This appens because of this "rewrite" rule
https://github.com/odoo/odoo/blob/12.0/addons/calendar/models/calendar.py#L918
that occur on event creation from OE, altering the event parameters when
is marked "allday".
When an "allday" event is deleted from GC the unlink is triggered in OE with the
default time "00:00:00". During the creation of the exclusion '
_inverse_dates' will be called altering start and stop datetime but not
recurrent_id_date, so the new record will not match the event generating
the recursion and the exclusion will not occur. The problem require
particular carefulness because when a recurrent event is fetched from
google the '_inverse_dates' is not called, so in that case the default
time is fine.
opw-2060526
closesodoo/odoo#39662
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Prerequisites
- Configure a mail server (incoming)
- Enable leads in CRM app
- Create a sales team with a mail alias (ex: testcrm@odoo.com)
and check "Pipeline" and "Leads"
- Set a partner email with one of yours (ex: bob@odoo.com) /!\
- Send a mail from bob to testcrm
- In the incoming mail server click on "Fetch"
Reproduce the issue:
- Convert the generated lead to an opportunity
- Choose "Existing customer" and set another one than the actual
- The opportunity is created but the customer is the old one
Cause:
The given partner_id is overriden by the old one in the
`handle_partner_assignation` method.
This commit gives the priority to the new partner_id.
OPW-2089404
closesodoo/odoo#40031
X-original-commit: e1833936255839cd34eba5758ca4c3124fd2522c
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>