This commit fixes the crm.lead form view to always display UTM information when
the lead is of type "opportunity".
Before this change, the UTM information (as well as the 'referred' field) were
only displayed for members of the 'base.group_multi_company', which did not
make sense on a functional point of view.
The 'company_id' field however, that is in the same form group, is still
correctly displayed only for members of the 'base.group_multi_company' group.
Task 2237318
closesodoo/odoo#50337
X-original-commit: d5b07b7c16cf7129f3231985ef607f02fb0c6475
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
Handling of escapes (`\`) was performed during evaluation rather than
parsing, so strings in the AST stored the escaped form (rather than
the proper one), and _formatAST had to mess around in order to try and
get it back into a semblance of relevance (especially as the AST would
store the escaped string without delimiters).
Fix: perform the escapes handling (aka normalisation) during
tokenization where it belongs. This means the AST formatter can now
just JSON.stringify the data. Until and unless we decide to produce a
cpython-compliant
repr (https://github.com/python/cpython/blob/0169d3003be3d072751dd14a5c84748ab63a249f/Objects/unicodeobject.c#L12902-L13006)
which is unlikely.
closesodoo/odoo#50236
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Before this commit, if a many2X field with a big comodel was added
in a search panel, the view using it would crash. For instance that
problem occured in the kanban view for hr.job, where res.users
appears as the comodel for the field user_id.
Now, we fix an arbitrary limit of 200 to the numbers of values to fetch
for each many2X fields in the search panel. This avoid the problem
mentionned above.
Furthermore, in case the limit is attained for a field used
as select="one", the values are displayed without being hierarchized.
Indeed the limit can leads to gaps in the knowledge of the hierarchy
and consequently to a bad representation of it.
Task ID: 2154668
closesodoo/odoo#50334
X-original-commit: 8d57153b34c04952a85f6642951cb2697016da84
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Commit 8c1bb22ec0222dca652e0649454b986c06cb1368 forgot to take into
account migrations, during a migration it is possible that some modules
need to be uninstalled because the target version may have removed /
moved them and since during a migration all modules are set `to
upgrade`, the previous condition made this impossible for migration
scripts that use the ORM for module uninstalls (not Odoo's case, mind
you)
With this commit it is again possible to uninstall modules from a
migration script during a migration.
closesodoo/odoo#50322
X-original-commit: a7c90a6d080a77316924cec9d3c64f9662ac7436
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
- Install PoS and "l10n_fr_pos_cert";
- Erase the country in the current company;
- Open a PoS session;
- Click on any product.
Before this commit, a JavaScript traceback was raised: TypeError: Cannot read property
'code' of null.
Now, an error message is raise, that informs the user that the company don't have country
setted.
opw-2241993
closesodoo/odoo#50320
X-original-commit: 5ed4b0cb54a20756e44c492cb5a67ff7d40f452c
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Update to the version **1.0.7** of the Owl framework.
Some code conflicting with the new behaviour of `mount(target, { position: self })` has been slightly tweaked to work as expected.
closesodoo/odoo#50240
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
account.fr.fec model needs to have write access as it
explicitely calls write() on its records.
closesodoo/odoo#50081
X-original-commit: f02a783be445238b9497ebd55838143945c99d2d
Related: odoo/enterprise#10162
Signed-off-by: Josse Colpaert <jco@openerp.com>
Purpose
=======
We should not be able to duplicate the link trackers (as it
makes no sense from a functionnal POV).
Task-2090344
closesodoo/odoo#50303
X-original-commit: c236b976f6a1bfa92fa6cd6325f652eec461c805
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Section and note invoice lines are now account.move.line objects with a distinct value in display_type field. When restricting the use of accounts on a payable/receivable journal and making an invoice in it with at least one section or note, and only using legal accounts, it always failed, as the note/section account was empty, hence not in the allowed accounts.
closesodoo/odoo#50297
X-original-commit: 28cd50f203c019b78f55fc16120af81c901caef2
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Steps to reproduce:
- install account
- print any invoice
Previous behavior:
the css rule and classes are ignored on the total table
Current behavior:
displays as intended
This PR fixes two issues:
1/ class attribute was not taken into account anymore ( table-sm )
2/ page-break-inside didn't work
closes#48682
opw-2229181
closesodoo/odoo#50259
X-original-commit: d8bfae0a641f43455b594e8ab2b22ce52cd98d70
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Purpose
=======
For a tag to be displayed on a kanban card, it needs to have a color set.
We won't be changing that behaviour, since it would mean having
two options > the color, and whether or not to show it in the kanban
The purpose of this task is to set a color on new tags to make the user
save a bit more time, set a color for him as he might not find the feature,
and make sure the tag will be on the kanban cards.
Specification
=============
For each of the following models, at creation, set a random integer between
1 and 11 in field 'color'
Models:
res.partner.category
crm.tag
project.tags
hr.applicant.category
helpdesk.tag
hr.employee.category
event.track.tag
mrp.eco.tag
repair.tags
closesodoo/odoo#49967
Taskid: 2234527
Related: odoo/enterprise#10112
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Impacted modules: account_analytic_default, crm, event,
hr_recruitment, maintenance, mass_mailing, project,
purchase_requisition, stock_picking_batch, website_slides
The default image displayed when the record is unassigned is
confusing, so we are removing it.
FP request
Task 2234524
closesodoo/odoo#49333
Related: odoo/enterprise#9834
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Currently, Some filters of the 'My Timesheets' menu do not make
proper sense So purpose of this task is to remove those filters
from the 'My Timesheets' menu.
In this commit, we remove the following filters from the
'My Timesheets' menu:
-Employee
-Department
-My Timesheets
-My Team
Also, rename the 'My Project' filter into 'My Projects' and that
filter is inside the my timesheet menu so also filter the line for
current user.
closesodoo/odoo#48663
Taskid: 2224472
Related: https://github.com/odoo/enterprise/pull/9564
Related: odoo/enterprise#9564
Closes: 48663
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The population of res users was emptying the list of populated partner
ids.
The lunch.supplier population was crashing because no partner id was
present in the partner population registry to use as `partner_id` for
the generated lunch suppliers.
closesodoo/odoo#50266
X-original-commit: a2adc346906ee753df6d8e49caa4ee5381629695
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
* = mass_mailing, web_editor, website_crm, website_event, website_form,
website_forum, website_hr_recruitment, website_mail_channel,
website_mass_mailing, website_sale, website_slides
When an outdated snippet's option are activated we display a warning
in the left panel that inform the user about the potential
malfunctions.
To do so the snippet's template key is added to the snippet as
data-snippet.
If a snippet is "t-call" inside another snippet, it will need to use
t-snippet-call instead of t-call to have the key on himself.
Those unique keys are used on snippet selection to retrieve the
snippet's version in the left panel and compare it with the currently
selected snippet's version. Versions are describe with data-vcss,
data-vjs and data-vxml. If a snippet's key is not in the left panel we
consider that snippet as outdated.
Added some tests to ensure that t-snippet and t-snippet-call really have
their template key as data-snippet
Adapted the views to the data-snippet changes adding
data-snippet="tmpl_key".
Part of: https://github.com/odoo/odoo/pull/44569
task-2189669
closesodoo/odoo#50254
X-original-commit: 28a6cd49b6e87b75c2e70771e241c41778bf9e87
Related: odoo/enterprise#10236
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The web_editor snippet_options were duplicated
Part of: https://github.com/odoo/odoo/pull/44569
task-2189669
X-original-commit: c8ec4ca2bb12e3a65665f5bdd7ad079243e030bd
When the PostgreSQLHandler is used to store some logs in the ir_logging
table of a database, the log record pathname is truncated to keep only
the relevant part of the path. In some circumstances, the path is
wrongly truncated, leading to totally invalid paths.
e.g.: When using an addon-path like `/data/build/enteprise` the removed
part correspond to the length of `/data/build/odoo/`. The resulting path
is `prise/....`.
With this commit, the full path is kept.
This commit is mainly a fix for the runbot logs and should not have an
impact on existing databases.
closesodoo/odoo#50246
X-original-commit: f3c96aa21ad0d8756fadc1608107438ba8cd6c05
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Part of task-2211013 which optimizes performances, this PR focuses on `/blog`, `/blog/post` performances.
For a database with 20 blog posts & 20 tags, based on 50 tests, this is the optimistic stats:
```
| /blog | Query | Time | Remaining Time |
| --------------------- | ----- | ------ | -------------- |
| Before | 136 | 0.055 | 0.200 |
| Now | 26 | 0.015 | 0.090 |
```
/blog/post from 60+ query to less than 30
task-2211013
closesodoo/odoo#48552
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Followup of 73dc42d6d5: catchall or bounce alias reset to the same value
should not raise an UserError. This happens for example when reinitializing
mail module.
Also enable batch write again.
closesodoo/odoo#50248
X-original-commit: 00709025a9436b35744908481c5e5faa1e3ef655
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Avoid messing up with style by translating it
closesodoo/odoo#50251
X-original-commit: 6151757a8357693e189ff1ab31ece5efdbac65d6
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
The name was autogenerated to "XMas Promo 2020-04-27 09:15:11" (which
is rather technical)
Make a static one to avoid changing it everytime the translations are rexeported
X-original-commit: 52a630eb28ead7b21f39dccbbff628ea594c7099
Add in one shot all the states (active or not) for all keys of customize_view
task-2211013
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Followup fix of #48912
The multi-company group should be given to users if they have access to
multiple companies and do not already have this group.
closesodoo/odoo#50233
X-original-commit: 0c721d90c5cd428ef8d51f195da8e02ee91d4364
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
- In a res.partner;
- Schedule activity;
- Choose 'meeting' as activity;
- Set a summary : 'test summary';
- Open Calendar;
- Chose a date and an hour;
- Edit the meeting;
- Add a description with a line break;
- Save the meeting;
- open the res.partner view;
Before this commit, the note on the planned activity lack the line
break.
Now, the note in the planned activity has the same output as the
description of the calendar meeting.
opw-2236838
closesodoo/odoo#50226
X-original-commit: 2e9cc92fb45f9328c45520275ab11c7a486a2590
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Avoid extra call to session_store.save if we don't touch to the session
Use an explicit name to storage post_viewed in the session
task-2211013
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Http routing and websits module will already do it later and handle the case.
The only ModelConverter used that will be impacted is:
/web_editor/attachment/<model("ir.attachment"):attachment>
that is a json controller called with eisting data
task-2211013
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
We use `author_id` (res.partner record) to instanciate our frontend widget
address so it can be changed through left panel in a searchable list.
This require a read on res.partner to get his name, even for visitors.
Using a related will have the same result for visitors while it won't need to
query res.partner table.
task-2211013
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Without this commit, if `lang_code` or `env.context.get('lang')` was set, we
would still access `env.user.company_id.partner_id.lang` to fill the loop array
even if we break and don't need that value.
Switching from loop to if conditions prevents that.
task-2211013
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Without this commit, a simple search like:
`env['blog.tag'].search([('website_id', 'in', (1, False))])`
would generate 4 SQL queries instead of 1.
3 requests would be done on `blog.blog`, see `right_ids` at ORM level.
task-2211013
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
`tags_list()` is called in loops to get nicely formatted URL in blog tag button
but doing an exists here will do everytime an SQL query regardless of the
cache.
We can safely remove the call to `exists()` as the `tag_ids` parameter is
coming from the controller `active_tag_ids` key which is already ensuring the
exists condition.
It make also the number of requests determinists for test with a random number
of tags. From between 200 ~ 300 queries (depending number of tags)-> 116
task-2211013
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Most of the website rendering process depends of customize_show views which are
part of a configuration setup.
Once it has been setup, it will most likely never change afterward.
It makes sense to orm cache those infos to avoid having to query ir.ui.view
table everytime we render something.
Note that just store basic and small infos used for customize_show case.
task-2211013
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
The (private) Rule.build method takes a values *dict* parameter. From
the start it was called with an invalid argument, but before 0.15
`append_unknown` would lead to just not using the argument at all
unless the rule is dynamic (aka has converters)[0].
In 0.15 the code was refactored and the `values` mapping is now used
in every case[1], leading to a pretty systematic error when calling
`search_pages`, which occurs any time an auto-completed URL field gets
used on the website e.g. when converting text to a link using the page
editor or when trying to update menu items.
Fixing this in 13.0 because while the current debian stable ("buster")
still bundles 0.14, the soon-to-be-released Ubuntu LTS (20.04) updates
werkzeug to 0.16. Debian Testing (bullseye) also bundles 0.16 but
isn't expected to get released for another year so it's less of a
concern.
Fixes#47356
Relates to odoo/docker#299
[0]
https://github.com/pallets/werkzeug/blob/c769200d1dcf1e21daaa2781f0c5109586daad42/werkzeug/routing.py#L797-L828
[1] https://github.com/pallets/werkzeug/blob/048cdfd9b969c0c3a133d7ff43b8ad1ad6a673ec/src/werkzeug/routing.py#L1020-L1032closesodoo/odoo#50194
X-original-commit: 4f1589075d2aae65c67a01c5c0f75c19c50a61d6
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
8b921471e4c11575b64d6e5e84508fc625dd2b07 has introduced wrong context key which replaces `res_partner_search_mode` with the depricated `search_default_customer` which was breaking search functality added by 8766f388da
In this commit we correct context's key.
closesodoo/odoo#50222
X-original-commit: 2e309d41cd7e7f22343379bd8a6b397b7d8684fd
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Prevent unexpected country creation when creating a state. Indeed,
there is usually no reason to create a new country.
opw-2239697
closesodoo/odoo#50210
X-original-commit: a502a404b18a0946d9ff64de9e05c28737e82c57
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Users (res.users) and Partners (res.partner) are two main models of Odoo.
This PR aims at improving the performance of their creation:
* Records creation in batch
* Code optimizations to reduce number of queries when possible
Task Id - 2229358
closesodoo/odoo#50209
Forward-port-of: odoo/odoo#48912
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Instead of triggering one has_group by user (one sql query/user if not already ormcached),
and potentially filling the `has_group` cache with new users data (we don't know if and when this data
will be used anyway), compute this field from the groups information already in cache.
X-original-commit: d771d7e9c8503543d29fdbf2ab961c2a32cc3bac
Improve the performance of the default method for user groups by avoiding a `ref` call,
using the group in cache instead.
Calls to ref always trigger one SQL query to verify record still exists
This means that creating 10k user would trigger 10k queries only for the default.
X-original-commit: e67efb88338ef669059591728e7722fe1dff4bf0
The main classes of partners and users support batch creation, but
the majority of their overrides doesn't support creation in batch.
Adapting those overrides to support records creation in batch shows
great performance gains:
* On `res_partner` : 2 to 3 times faster
* On `res_users`, with the inherited `res_partner` created in batch:
up to 10 times faster.
Tests done with 500 to 4k records:
* `res_partner` with only a name provided
* `res_users` with a name and login
X-original-commit: 9c3c5f161580039c1fe50f68acac808c18817997
State field is present twice and statusbar widget is not usable.
Let us fix it by ensuring field is present once and widget is
clickable.
closesodoo/odoo#50207
X-original-commit: 5644eb335e82c7184c27b540fc89ae6e77460992
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>