Not entirely sure about TestAllocationRights. For TestEsEdiCommon
issue is quite obviously that it's inherited by tests which are
external, so when the `post_install_l10n` tag gets applied those tests
get run during "normal" l10n and they break.
closesodoo/odoo#98814
Related: odoo/enterprise#30825
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
`_post_dispatch` is a late addition to the httpocalypse. It can be used
to alter the response object e.g. to inject headers or cookies. The
function is automatically called for regular, fallback and error
responses. On the other hand, `_dispatch` is only called when an
endpoint is matched and might not return a response in case of error.
task-2839031
closesodoo/odoo#96651
Related: odoo/upgrade#3710
Signed-off-by: Julien Castiaux <juc@odoo.com>
With commit[1], we added `o_text_overflow` classes at several places to avoid
long names going out of the boxes. However, for the name/title fields in the
form views, we should always show the full name.
So this commit replaces `o_text_overflow` class with `text-break` from
name/title fields in the form views to display full string in the read
only mode, but also keep them from going outside of the form view.
Below are the modules affected:
- base
- coupon
- crm
- event
- mass_mailing
- mass_mailing_sms
- project
- sales_team
commit[1] - a0ebb46
task-2889845
closesodoo/odoo#96132
X-original-commit: 4a74c7af6b54bd771f50d3885813f4aae442c9e7
Related: odoo/enterprise#29552
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
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
This commit makes various adapations in addons with respect to
the introduction of the owl kanban view. Mainly, some selectors
in scss and in tests needed to be adapted. Moreover, in some tests
that we haven't adapted yet, we must ensure that legacy form and
list views are still used (useLegacyViews).
It also contains some adaptations in kanban templates, e.g. the
replacement of moment by luxon, the removal of underscore...
Part-of: odoo/odoo#92475
Remove most values uselessly specified because giving the same value as
the default one (see _DEFAULT_MANIFEST in odoo/modules/module.py)
* auto_install is Falsy by default
* author is Odoo SA by default
* summary & description are empty strings by default
* application is False by default
* test, demo, depends and data are empty lists by default
This will reduce noise/inconsistencies between manifests specifications,
simplify analysis of manifests content, ...
closesodoo/odoo#90209
Related: odoo/enterprise#26807
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is the 14th commit of a comprehensive refactor of our HTTP
framework. See odoo/odoo#78857 for complete historic, discussions and
rationnals.
* `request.uid = x` => `request.update_env(user=x)`.
* `request.context = x` => `request.update_env(context=x)`.
* `request.context = dict(request.context, x=y)`
=> `request.update_context(x=y)`.
* `request.cr = None` => `request.cr.close()`.
* `http.mono_db()` => `request.db`.
* `http.dispatch_rpc()` => `service.dispatch_rpc()`.
* `@service.model.check` => `service.model.retrying()`.
* `request.endpoint`
=> `env['ir.http']._match(request.httprequest.path)[0].endpoint`.
* `request.routing_iteration `=> `removed`.
* `request.jsonrequest` => `request.dispatcher.jsonrequest`.
Note that `request.params` is now set much later in the process. If you
are in a situation where you values from the query string or the
http body you can use `request.get_http_params()`.
Note that using the new `request.future_response`, it is possible to
add headers and cookies on the response object before the response
object is initialized. Please note that headers/cookies saved on
the future response will NOT be injected in case of error.
PR: odoo#78857
Task: 2571224
Purpose
=======
Ensure that the names of the UTMs models (campaign, medium and source)
are unique.
If not, generate automatically an unique name.
The name field is no more translatable; it makes no sense to translate
a technical which will be added in the URL, and can even cause issues
(the UTM record is not recognized because of the translation).
For the campaign, we keep a "translatable" name which is called
"title".
For the UTM source, use a mixin to generate automatically the name of
the source based on the content (_rec_name) of the record. So we remove
the override of create / write / copy in the different models and
ensure consistency between those models.
Task-2245823
closesodoo/odoo#60501
Related: odoo/enterprise#21882
Related: odoo/upgrade#1863
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.
Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)
closesodoo/odoo#84280
Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
Purpose
=======
This commit cleans the UTM module and uses a different file for each model
data and demo in order to clarify organization and ease reading. Each model
owns its own demo and data file. Security file is reorganized per model.
Task-2245823
Part-of: odoo/odoo#83070
Purpose
=======
This commit cleans the UTM module and uses a different file for each model
views in order to clarify organization and ease reading. Each model owns its
own view file.
Task-2245823
Part-of: odoo/odoo#83070
Purpose
=======
This commit cleans the UTM module and uses a different file for each model
in order to clarify organization and ease reading. Each model belongs to
its file.
Task-2245823
Part-of: odoo/odoo#83070
PURPOSE
This commit consolidates UTM usage across all applications.
Global purpose is to avoid having undesired side-effects, such as unlinking an
utm.source/utm.medium/utm.campaign and at the same time cascading the deletion
to various records without noticing.
SPECS
ALLOW MORE PEOPLE TO CLEAN UTM RECORDS
Currently, not even the system administrator can delete utm.mediums and
utm.sources (he can only delete campaigns).
These were considered as "technical records", but allowing some cleanup is
a good idea since these records are often automatically generated and can
create a lot of unnecessary noise in the database.
That's why we now allow the following groups to delete all UTM records
(sources, mediums and campaigns):
- group_system
- group_mass_mailing_user
- group_social_manager (enterprise)
PREVENT DELETION
For some use cases, removing an utm.source/utm.medium/utm.campaign would
cascade delete the related record, which was unintended / hidden side effect.
These combinations were secured by preventing to unlink:
- mailing.mailing source_id field
Trying to delete the utm.source will throw an error message
- mailing.mailing medium_id field
Trying to delete the utm.medium will throw an error message
- hr.recruitment.source source_id field
Trying to delete the utm.source will throw an error message
ADDING CLEAN ERROR MESSAGES
When trying to delete an UTM record that is linked with ondelete="restrict", we
improved the error message to give a clear explication to the user, e.g:
"You can't delete these UTM sources as they are linked to the following
mailings in the Mass Mailing APP, and deleting the source would break the
statistics: Newsletter"
SPECIFY 'ondelete' strategy
For a lot of uses of sources/mediums/campaigns, the 'ondelete' strategy was not
specified, leading to the confusion of "is this really how we want to handle
this?".
A lot of ondelete="set null" have been added in various field definitions to
ensure that this is the desired and logical strategy we want for that
specific model.
PREVENT REMOVING HARDCODED UTM RECORDS
In some functional flows, UTM records are hardcoded using their direct
record reference.
This is notably the case for the recruitment process and its creation of
aliases, and for the Email / SMS Marketing flows.
As deleting them would break these flows, we prevent their deletion in a
"api.ondelete" method.
ENFORCE NEW RULES WITH TESTS
A lot of python tests have been added to make sure we enforce the decisions
taken here above.
LINKS
ENT PR odoo/enterprise#19048
Task-2459480
closesodoo/odoo#72239
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
- Currently all menus are out of order in app switcher.
- For example, Sales app is 16 menu away from Accounting,
Social Marketing app is 25 menu away from Email Marketing, etc.
So, all menus should be reordered.
- This commit will reorder the menus of the app switcher in order to reduce
the distance between correlated applications,
and bring the most common apps upward.
- And in this commit we have left gap of 5 subsequent sequence for further new menus.
PR: #69984
TASK ID: 2513082
Related: odoo/enterprise#17989
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Conversion of all modules to the new manifest assets declaration.
Part of task: 2352566
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
This commit renames the field is_website into is_auto_campaign
for clarity purpose.
The is_website field always meant that the campaigns were created automatically
in some instances. Could be created automatically via a link to the website
or even by simply creating a marketing campaign in marketing_automation.
is_auto_campaign is a better name as it does not wrongly imply that only
the website can generate campaigns automatically, while also pointing
out the automatic generation mechanism.
The utm campaigns behaviour rests unchanged.
LINKS:
TaskID: 2414694
PR: #65824
Enterprise PR: #16238
Related: odoo/upgrade#2146
Related: odoo/enterprise#16238
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Otherwise, this can raise the below issue during an upgrade (`-u`):
```
File "/home/odoo/src/odoo/13.0/odoo/modules/registry.py", line 369, in init_models
model._auto_init()
File "/home/odoo/src/odoo/13.0/odoo/models.py", line 2529, in _auto_init
new = field.update_db(self, columns)
File "/home/odoo/src/odoo/13.0/odoo/fields.py", line 2456, in update_db
return super(Many2one, self).update_db(model, columns)
File "/home/odoo/src/odoo/13.0/odoo/fields.py", line 857, in update_db
self.update_db_notnull(model, column)
File "/home/odoo/src/odoo/13.0/odoo/fields.py", line 897, in update_db_notnull
model._init_column(self.name)
File "/home/odoo/src/odoo/13.0/odoo/models.py", line 2455, in _init_column
value = field.default(self)
File "/home/odoo/src/odoo/13.0/addons/utm/models/utm.py", line 28, in <lambda>
default=lambda self: self.env['utm.stage'].search([], limit=1),
File "/home/odoo/src/odoo/13.0/odoo/models.py", line 1648, in search
res = self._search(args, offset=offset, limit=limit, order=order, count=count)
File "/home/odoo/src/odoo/13.0/odoo/models.py", line 4497, in _search
self._cr.execute(query_str, where_clause_params)
File "/home/odoo/src/odoo/13.0/odoo/sql_db.py", line 173, in wrapper
return f(self, *args, **kwargs)
File "/home/odoo/src/odoo/13.0/odoo/sql_db.py", line 250, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedColumn: column utm_stage.sequence does not exist
LINE 1: SELECT "utm_stage".id FROM "utm_stage" ORDER BY "utm_stage"
```
upg-5396
closesodoo/odoo#65135
X-original-commit: 9294c1dc4f24c23c1f81bec50d73cb594349b54b
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Colorless tags are not displayed in kanban view of utm campaigns. When creating
tags on the fly currently they have no color and are therefore not displayed
once saving the campaign. This is not really intuitive for users.
We now set a default value to color field of tags. They are now displayed
by defauklt.
LINKS
Task ID-2300385
COM PR odoo/odoo#59872
ENT PR odoo/enterprise#14031
X-original-commit: 4f83be33d4cc53d50081050b3a9dee2892c562a4
Previously, in multiple modules, long names would result in an overflow of text.
With this commit long texts should appear like this: [aaaaa...] instead of
going out of their boxes.
Various views are updated, depending on which fields we wanted to prevent
from overflowing and the probability they do so.
Task ID-2325219
PR odoo/odoo#57713
PR odoo/enterprise#13226
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Including demo data this time
closesodoo/odoo#58862
X-original-commit: 575abde110acb3d12b25f177a863374becef0894
Related: odoo/enterprise#13705
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Widget attributes have been removed from all search view archs since
they are no longer supported.
closesodoo/odoo#54107
Related: odoo/enterprise#11665
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit sets attribute sample="1" in a bunch of list and
kanban views, to enable the new sample data feature when views are
empty.
Task 2232801
X-original-commit: 5471309b35619f307242c2704c7681ba63d2be42
Multiple small changes/fixes to the hr_recruitment module to provide
a better base for later improvements.
The linkedin recruitment source is only added by default to new records,
existing records remain unchanged.
For the google map in the email template, since it requires an API_Key and
only a minority of companies will get this key, it was decided that
it is better to remove it from the template.
Now that linkedin is added to job positions by default, deleting a
job position currently does not delete the related linkedin source.
So after removing 10 job positions, there are still 10 linked in
source in the database. This commit fixes that.
Add three additionnal utm_sources.
Add linkedin as a source job to demo job position to be consistent with no-demo
data db.
closesodoo/odoo#50076
Taskid: 2196767
Related: odoo/enterprise#10778
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The purpose of task is to update the 'user/employee avatar' to the new
widget in all the kanban view across all modules.
The below new widget are introduced for avatar:
- many2one_avatar_user (for user_id fields)
- many2one_avatar_employee (for employee_id fields)
which displays the avatar (i.e. picture) of a user/employee in front
of his name and clicking on the avatar will open a chatbox to message
that specific user/employee.
So in this commit, For each kanban view with a user or employee avatar,
replaced it by the field with the new 'many2one_avatar' widget.
TaskID: 2244928
Related Enterprise PR: https://github.com/odoo/enterprise/pull/10420
closes odoo/odoo#50789
Closes: #50789
Related: odoo/enterprise#10420
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Inspired by what is done in the task kanban of the project module,
add examples of kanban stage setups for UTM campaigns, and allow users
to load them.
There have also been some minor changes to the campaigns view:
- The helper message when there are no UTM campaigns has been changed
to a more descriptive message.
- All stages that existed by default (hardcoded in the data XML) have
been removed except default New one. An user with a fresh database will
have no stages in their kanban. The old hardcoded stages have been moved
to the demo data instead, so they will still be added by default if the
user installs demo data.
- The ghost columns that appear in the kanban when no stages exist have
been renamed to match the old stages that were hardcoded.
- When the user opens the view to create a column, the 'See examples'
link will appear below the 'Column title', just like in the project
addon, and clicking it will open some examples specifically made for UTM
campaigns. Clicking on the 'Use This For My Kanban' button will load the
stages of the selected example.
- A min-height property has been given to the example modal view so that
the view does not change size depending on the number of rows in the
ghost columns.
Task ID: 2047369
PR #48299
This commit ease the creation of campaigns as
they only require a name and a responsible.
When the user clicks on create, it will display the
"Quick Create" card instead of redirecting him to a
full form view.
Task ID 2237999
closesodoo/odoo#49774
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this task is to prevent users from setting portal users on
internal documents by mistake, and preventing noise and performance
issues resulting from loading all the portal users in those fields.
This commit fixes internal many2x fields to res.users which are now
restricted to internal users by setting domain (share=false) on form view.
closesodoo/odoo#47553
Taskid: 2172779
Related: https://github.com/odoo/enterprise/pull/9204
Related: odoo/enterprise#9204
Closes: #47553
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Currently, to activate/deactivate records with the 'active' checkbox
user has to switch to edit mode of the form.
So the purpose of the task is to allow the user to activate/deactivate
records from the readonly mode of the form view.
In this commit, we set widget='boolean_toggle' on the 'active' field in form
view.
closesodoo/odoo#46567
Taskid: 2206794
Related: https://github.com/odoo/enterprise/pull/8918
Related: odoo/enterprise#8918
Closes: #46567
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Make sure `is_website` is an existing field of the model at creation.
opw-2192139
closesodoo/odoo#44870
X-original-commit: 5daf25f2c693c17e75223f8e3502d5c4121cb3b5
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Purpose of this task is to change the color of Tags field in tree view in the
same way as it show in form view.
TaskId : 2172123
closesodoo/odoo#43442
Closes: odoo#43442
Related: odoo/enterprise#7769
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
PURPOSE
Allow multi-edit for calendar event and utm campaigns. Indeed it gives
flexibility to users when they have to edit several records at once.
SPECIFICATION
Enable multi-edit in each of the following views
* calendar.view_calendar_event_tree
* utm.utm_campaign_view_tree
Set the fields not editable to be readonly.
LINKS
PR #42786
Task 2078662
Related: odoo/enterprise#7553
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
A similar fix was originally done in [1], where the access to `env` was done
before the parent dispatch.
The issue was then reintroduced with [2], where the `env` was possibly accessed
again after the dispatch. This works most of the time, but in the rare case
where the session is destroyed during dispatch, which is the case on
`/web/session/destroy`, accessing the environment after that point will crash.
This issue didn't manifest before [3], because the `env` was always initialized
during `checked_call` when calling the `clear` method on it (since `env` is a
magic property). After that commit, the `clear` is not called if not necessary,
therefore it might happen that the `env` is never initialized. This leads to the
crash when trying to initialize it for the first time after the `db` attribute
has been cleared during the destroy, since a `db` is required to initialize it.
The current fix aims to prevent the crash. As opposed to [1] that actually kept
the tracking fields by fetching them before the dispatch, it is decided on this
commit to voluntarily lose the tracking fields when destroying the session,
because keeping them would require too much refactoring for a fix in stable, but
we also feel that it makes sense functionally: those tracking fields were maybe
used for a specific purpose in the original database, but they might mean
something completely different on another database.
[1] 6780597f2d
[2] c78de22a09
[3] f6d56afba0closes#42260closesodoo/odoo#42314
X-original-commit: 2ac11ce7a3f36a1572d886bc872facf339cb6516
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>