Many localization modules adds field 'l10n_xx_country_code' on
Company/Settings views with the purpose of using it to hide that
particular localization's fields from other country's users.
So, it is better to add a common field in account module so that
other localization can use that field instead of adding a new one
where ever it is required.
Also, one such field was already added from account_check_printing
module, so we removed it from there as it is not needed anymore.
Task: 2049977
Closes: #35755
Related: odoo/enterprise#5158
PURPOSE
Perform some code cleaning in mail module
SPECIFICATIONS
mail.address.mixin is used only for mail.thread.blacklist mixin. Let us
merge those two and simplify class organization.
LINKS
Task ID 2222033
closesodoo/odoo#48115
Related: odoo/upgrade#967
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
before this commit, email widget was not trimming value and due to which
space aroung email value remain as it is added by user.
after this commit, email widget will trim the value and remove leading/trailing
space.
task-2197432
closesodoo/odoo#47470
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
PURPOSE
Allow to use UTMs directly in event, notably to be able to sort or make
statistics on registrations.
SPECIFICATIONS
Move all UTMs fields definition to event. In base event module they are
set by hand or through links (when using mass mailing for example).Shared
links with utm bits defined in it allows to track marketing statistics
on registrations.
In event_sale registrations can be linked to a sale order. UTM information
are copied from the sale order to the registration itself. Order defined utm
always erase default one coming from event.
LINKS
Task ID 2212297
Community PR odoo/odoo#47229
Related: odoo/upgrade#913
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose is to allow the batch create on those models that may be created
in batch, notably through import.
LINKS
Task ID 2212297
Community PR odoo/odoo#47229
Origin is a char field holding the registration "source name". Its only use
is to copy the sale order name when registration is linked to a sale order
in event_sale. As we can filter / group / search on sale order or sale order
line directly instead of the origin there is no need to keep this char field.
If necessary to some internal reasons it can simply be added through studio.
LINKS
Task ID 2212297
Community PR odoo/odoo#47229
PURPOSE
Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.
USE EDITABLE STORED FIELDS
Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.
Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.
Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.
CLEAN CRM CONVERT WIZARDS CODE AND FIELDS USE
In this merge we also rewrite code located and/or used in convert or merge
wizards. Indeed it holds unnecessary variables, dictionaries manipulation
that hides the real business flow, badly named variables, unclear methods, ...
Logic of those wizards seem quite simple but is hidden behind a wall of
bloated code.
CLEAN CRM.TEAM MODEL
Clean statistics fields definition on crm.team. Future tasks will improve
the use of sales team in crm and first steps is to clean a bit models linked
to sales team.
LINKS
Task ID 2088565 (crm: from onchange to compute)
Community PR odoo/odoo#41955
Enterprise PR odoo/enterprise#7322
Upgrade PR odoo/upgrade#781
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Commit 60106cf2 (task 2082503) introduced some changes on server
actions and automated actions, some changes were applied on server
actions but via the base_automation inherited view.
This commit move those change so they are directly applied on the server
action form view.
closesodoo/odoo#40964
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Steps to reproduce:
- install sales
- go to sales > go to any list view (SO for example) and group by
anything (customer for example)
- click on action > export > add ID to the exported columns
- click export
Previous behavior:
you get a traceback: "Invalid field specification '.id'."
Current behavior:
ids are exported as intended
opw-2194233
closesodoo/odoo#48222
X-original-commit: c8217080d960ec3f8436111ce60a17754fe64f2d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
PURPOSE
Purpose of this commit is to clean statistics fields definition on crm.team.
Future tasks will improve the use of sales team in crm and first steps is to
clean a bit models linked to sales team.
SPECIFICATIONS
New statistic fields
* ``lead_all_assigned_month_count``: all assigned lead and opportunities
in the last 30 days; used notably for scoring mechanism;
Renaming performed on some statistic fields
* ``unassigned_leads_count`` -> ``lead_unassigned_count``;
* ``overdue_opportunities_count`` -> ``opportunities_overdue_count``;
* ``overdue_opportunities_amount`` -> ``opportunities_overdue_amount``;
All those fields are used for display and management purpose, and are
computed not stored fields. No migration is therefore required.
LINKS
Task ID 2088565 (crm: from onchange to compute)
Enterprise PR odoo/enterprise#7322
Upgrade PR odoo/upgrade#781
PURPOSE
Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.
SPECIFICATIONS
Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based coputation.
Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.
Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.
SPECIFICATIONS: FIELDS RENAMING
In this commit we also rename ``date_assign`` to ``date_partner_assign``. There
are already ``date_open`` (crm_lead) and ``assign_date`` (website scoring)
fields available. It may be confusing. The field is therefore renamed to better
indicate it is linked to partner assignment.
LINKS
Task ID 2088565 (crm: from onchange to compute)
Upgrade PR odoo/upgrade#781
PURPOSE
Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.
SPECIFICATIONS
Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.
Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.
Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.
SPECIFIATIONS: CONSTRAINT USER_ID / TEAM_ID
In this commit we also remove all the better implementations of "not really a
constraint" constraint about user_id and team_id. Indeed as this is a computed
field normally we should not have to call the onchange manually, even through
a hackish call to a falsy constraint (see fdc8749, 222cca2, 4e8ebc7 ). You are
all inferior to SM team.
SPECIFIATIONS: DATE_OPEN
Assignment field, namely ``date_open``, has a random definition as it seems
linked to assignation, with several behaviors intended
* ce39ca8a97 : reset only when going from
no salesman to a salesman (aka, keep assignation when changing)
* 8e540558ee: reset when changing salesman
We choose to keep first implementation as it seems a bugfix broken again
by second commit. It will also replace the ``assign_date`` defined in
``website_crm_score`` module.
SIDE EFFECTS
Several side effects occur with this commit. Indeed behavior is not always
exactly the same, notably as code rewriting allowed to fix some issues,
incoherent behavior or was simply not able to achieve exactly the same
result. Notably
* at lead creation: default probability is the one coming from PLS and not
0.0 anymore, since field is already computed. Synchronization with PLS
still works the same way (change probability, you are out of syn);
* various user_id / team_id combinations notably in convert / merge wizards
may change, notably we do not reset team_id if user_id is reset. We
consider we could keep a team_id set without user_id;
LINKS
Task ID 2088565 (crm: from onchange to compute)
Upgrade PR odoo/upgrade#781
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Florent Lejoly <fle@odoo.com>
SPECIFICATIONS
Improve heuristic used to find lead to convert duplicates
* check email_normalized instead of email_from, as it may contain formatted
emails. Normalized email are sanitized and normalized version of emails
and ease comparisons;
* use lead email if its customer has no email;
* if no email is available but a customer is set, use it anyway;
This notably reverts 2917b38f28 . Indeed no reason has been found why
this fix is necessary.
LINKS
Task ID 2088565 (crm: from onchange to compute)
SPECIFICATIONS 1: FORCE_ASSIGNATION
Move and rename force_assignation in convert wizard. Purpose is to move the
force_assignation field from mass convert wizard to its base convert wizard
used through _inherit. It allows to avoid relying on context propagation in
some methods. This field is also renamed as assignation as other meaning in
English.
SPECIFICATIONS 2: OPPORTUNITY_IDS
Improve search of duplicate by always ensuring duplicated are computed using
active_test. Also add the active_test on the field as otherwise computed
results are actually not visible to the user.
Generic opportunity_ids field is also renamed to better indicated it is used
to store duplicates and avoid thinking it holds data related to batch convert
or merge.
LINKS
Task ID 2088565 (crm: from onchange to compute)
Upgrade PR odoo/upgrade#781
PURPOSE
As CRM is going to be updated (onchange -> compute, code improvements, better
management of sales teams) cleaning and improving code is a necessary first
step.
SPECIFICATIONS
Purpose of this commit is to rewrite code located and/or used in convert or
merge wizards. Indeed it holds unnecessary variables, dictionaries manipulation
that hides the real business flow, badly named variables, unclear methods, ...
Logic of those wizards seem quite simple but is hidden behind a wall of
bloated code.
Notably for wizards
* try to set explicit arguments in methods;
* less use of context values, replaced by arguments when possible;
* try to make better use of lead2opportunity wizard in its mass wizard that
inherit from it, notably by correctly calling super;
Notably for tools
* ``get_duplicated_leads`` was just a shortcut to ``_get_duplicated_leads_by
_emails``;
* ``_get_duplicated_leads_by_emails`` is renamed to ``_get_lead_duplicates``
because email is not the only way of finding duplicates;
* try to make better use of record sets instead of propagating ids, notably
for partner. For example input of ``_get_lead_duplicates`` or output of
``_find_matching_partner``;
* ``_create_lead_partner`` rename to ``_create_customer``, and its sub
method ``_create_lead_partner_data`` to ``_prepare_customer_values``;
* ``handle_partner_assignation`` was difficult as its use is not documented
and its docstring was not updated. Parameter have been renamed to be more
explicit about what it does. Method is renamed to ``handle_partner_
assignment`` as assignation has other meaning in English;
* ``allocate_salesman`` is renamed to ``handle_salesmen_assignment`` to match
the partner assignement and code is slightly cleaned;
No functional change should occur with this commit. Tests have been gradually
added to try to ensure behavior does not change.
LINKS
Task ID 2088565 (crm: from onchange to compute)
PURPOSE
As CRM is going to be updated (onchange -> compute, code improvements, better
management of sales teams) ensuring data integrity in tests is necessary to
avoid having hidden issues or tests difficult to debug.
LINKS
Task ID 2088565 (crm: from onchange to compute)
in several models the 'color index' field shows up in the pivot measures,
color field in pivot measure doesn't make sense functionally, so remove
it from measure list, to remove it, add field explicitly in view and set
invisible attribute on it to remove it from measure list.
task-2153090
closesodoo/odoo#47485
Related: odoo/enterprise#9183
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Fixes#33309
Before this commit, Traceability report displays raw datetime.
This commits consider User's TZ + Datetime format configured in language.
closesodoo/odoo#47827
X-original-commit: 324db18dc9d5774d714c4b178468971b8bb36d6c
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
With the introduction of `new`, the use of `resolve_2many_commands` is
redundant, as it accomplishes the same function with the added benefit
of returning a record-like object whose API is more familiar than
`resolve_2many_commands` API.
closesodoo/odoo#37290
Related: odoo/enterprise#9409
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This code adapts all business code instances of calls to
`resolve_2many_commands` and replaces them by calls to `new` which
returns a record-like object whose api is more familiar than the
`resolve_2many_commands` api.
When `mrp` or `mrp_subcontracting` are uninstalled, the routes used as
'Picking Before Manufacturing Route' and 'Resupply Subcontractor' are
kept active. When the modules are re-installed, the routes are created
again, and appear duplicated.
The routes should be deleted if they are not used anywhere else.
opw-2222895
closesodoo/odoo#48206
X-original-commit: ce219b8375dc14daf9d380433d254b622a947773
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
To avoid having to fixup half a dozen places where we're creating PDF
writers, and possibly ending up with new ill-configured writers in
the future, patch PyPDF2's own writer with a subclass setting /Creator
and /Producer.
Note that this will not affect non-post-processed PDFs generated by
wkhtmltopdf. wkhtmltopdf does not allow setting these properties[0][1], so
to fix this issue we'd have to alter _run_wkhtmltopdf to pass the
result through PyPDF2 in order to alter its metadata.
[0] https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2000
[1] https://bugreports.qt.io/browse/QTBUG-44451closesodoo/odoo#29460
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Issue
- Install Calendar, HR Recruitment & Studio
- Go into Calendar
- Create a recurring event
- Edit it with Studio
- Add a related field
- Select Applicant > Assigned
Traceback
Cause
Applicant > Assigned is a stored field.
Adding a stored field seems to triggers
something that recomputes all models
odoo/odoo:odoo/modules/registry.py@12.0#L307
Then it calls the _write method of models.py
which uses self.ids (which contains virtuals ids)
for a SQL query.
odoo/odoo:odoo/models.py@12.0#L3428
Solution
Avoid all the virtuals ids to be retrieved
when we have "update_custom_fields" in
the context.
OPW-2214170
closesodoo/odoo#48208
X-original-commit: 112f976eb193020c093068fd30a004be3f5e9254
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Before this commit there was no Domain on field `task_id` on this form view. (This was already present on `Before this commit there was on Domain `)
After this commit user can select the Task of the Selected Project only.
closesodoo/odoo#48170
X-original-commit: 3c5a23118138bedb3d956f98ec8e48357ca201e2
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Deprecate MPD integration for Six payment terminals and replace it
with TIM because:
- MPD broadcasts connection messages to the network so having
multiple terminals and MPD servers in the same network results
in connection issues
- TIM has a JS SDK so it doesn't require an IoT Box.
- MPD supports only Yomani and Yoximo terminals while TIM also
supports Ingenico.
closesodoo/odoo#46789
Taskid: 2188566
Related: odoo/upgrade#903
Related: odoo/enterprise#8994
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This reverts commit 9d43308a8f6b521d3d18f7fc472303f58f56a0c3.
No one should be using MPD in production at the moment but
we'll still leave it in the buiold of the Box, just to be sure.
X-original-commit: 129101815d5846d5b53148546b19bdd791f22aac
The modification introduced in 5307f47d975c3b3ebd87c7f7e2248802a1aa5be7
was not properly managing the 'force_create' argument. When it is set to
false, we only look for existing accounts with the current cursor and
end up returning an empty recordset when the account was created during
the same transaction. Ex:
// Do stuff
IapAcc = self.env['iap.account']
IapAcc.get('my_service')
IapAcc.get_credit('my_service')
// Other stuff
closesodoo/odoo#48201
X-original-commit: c78070dc22f99867b4b1f3a52cd11543da571fe4
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
stdout:
stderr:
closesodoo/odoo#48197
Error: could not apply b0c5370fd25... Revert "[FIX] web, purchase, sale: fix no currency in calendar view"
Hint: after resolving the conflicts, mark the corrected paths
Hint: with 'git add <paths>' or 'git rm <paths>'
Hint: and commit the result with 'git commit'
X-original-commit: e8d6f1eae0f4f9c0f4df78553b7d51a03087940f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Get the elements size also on mousedown. Because before that, the
size was only obtained on the start method when some elements did not
yet have its actual size. Example: elements in inactive slides in the
carousel snippet.
task-2162952
closesodoo/odoo#48193
X-original-commit: 2a36c684bb33704e46a6f30b5c501043683da67d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
before this commit:
when manually adding field in export wizard, string has extra space in
begining.
after this commit:
manually added field in export field list doesn't contain any extra
spaces.
task-2065433
closesodoo/odoo#36759
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit adds a warning banner near the bottom of the uninstall
wizard warning the user of the consequences of module uninstallation and
advising him to try it first on a duplicate database so as to avoid
borking the database.
The Cancel/Confirm buttons were also swapped and the Cancel one was
made primary to avoid mindless "next-clicking"
closesodoo/odoo#33396
Task-id: 1824392
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
before this commit:
actions are not showing as per the sequence, like:
1) Other actions (delete, duplicate)
2) Windows actions
3) Server actions (without sorting by sequence)
After this commit:
Server actions are sorted by the sequence, like:
1) Other actions (delete, duplicate)
2) Windows actions
3) Server actions (with sorting by sequence)
task-2005419
closesodoo/odoo#39872
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Before this change, if an error occurs while trying to match / import
a sub-field e.g. order_line/product_id, only the name of the top-level
field is showing when displaying the error e.g. "Order Line", which
lacks precision and makes understanding and fixing the issue more
complicated.
After this change, the entire field path should be displayed, e.g.
"Order Line / Product" in the example above.
Task-1906700
closesodoo/odoo#33031
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Before this commit, when user attempts to edit or delete a private
event without being an attendee, it raises an access right error.
This commit disables edit and delete buttons in this case, in
addition to hide event details.
task-2151150
Closes https://github.com/odoo/odoo/pull/42569closesodoo/odoo#42569
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
- Activate SIPS
- Make a payment of 263.90 on the eCommerce
The SO is not confirmed because there is 0.01 of difference.
This is due to the fact that 263.90 * 100 = 26389.9999...
Using `round` instead of `int` prevents truncating the value.
opw-2179123
closesodoo/odoo#48169
X-original-commit: 60f9cea444df37e685b7f4312c9ff28c395822b3
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Because CacheMiss calls str() on the record it's given, it's not
possible to override __str__ and get field values: on the first cache
miss (= the first field access) we're going to blow the stack:
* any random field is accessed
* and faults
* which creates a CacheMiss
* which stringifies the record
* which accesses a field
* which faults
* which creates a CacheMiss
* etc...
Fix:
* move the basic Model's stringification to repr(), which is
implicitly called on str() if no __str__ is specified, for historical
reasons we were doing the opposite
* use repr() when initialising CacheMiss
closesodoo/odoo#42966
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
As the crm.lead.tags model shall be used in CRM and/or Sales apps,
it has been moved to the sales_team module, which is a depedency
of the CRM and Sales apps.
As these tags becomes more generic than just "lead tags", the model
has been renamed from crm.lead.tags to crm.tags.
Tags on sale orders were already present but not visible. They are
now visible in the "Other Info" section, and optionally in sale order
tree views.
When a quotation is created from an opportunity (CRM app), existing tags
are populated from the opportunity to the sale order (Sales app).
Views and demo data of several modules have been updated accordingly.
Task ID 2191276
Currently,the action_reset_password is only available at form view
of res.user under the 'Send reset password instructions' button.
The purpose of this task is to allow admins to send password reset instructions
to multiple users at once from list view.
In this commit, we make action_reset_password available in the action menu of
list view with label 'Send password reset instructions' and relabel the form
view button to 'Send password reset instructions'.
As when the user is created at that time it will send the 'accept invitation'
mail so here from list view we will always send the 'change password' mail even
user is never connected(state='new').
closes odoo/odoo#47454
Taskid: 2076526
Closes: #47454
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The "Create Sales Order" button was not displayed again when the
original SO was deleted. Thus, it was not possible to link a new SO to
the project.
closesodoo/odoo#47397
Taskid: 2206862
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The use case is a cache miss of a stored field with compute on a new
record with origin. The field should be computed only when explicitly
triggered, i.e., when a dependency has been modified. Otherwise it
should be fetched from the origin record.
closesodoo/odoo#47353
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Purpose Of the task is, we need a visual cue on those fields to let
the user know that their value is company-specific.
So, in this commit On company depedent field we added a building
icon with title 'Values set here are company-specific' next to the
label in the form view.
closes odoo/odoo#47178
Taskid: 2001748
Closes: #47178
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
PURPOSE
Remove dead views to clean dead records
SPECIFICATIONS
Find unused views and remove them, notably specific views that
are not used anymore because generic one is always taken. In
this merge we remove dead views linked to Social/Marketing
applications.
LINKS
Task ID 2196317 (Social/Marketing specific)
Community PR odoo/odoo#48086
Upgrade PR odoo/upgrade#966
Followup of odoo/odoo#46435 (actions cleaning)
Followup of odoo/enterprise#8846 (actions cleaning)
Followup of Task ID 2196183 (actions cleaning)
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Remove dead views to clean dead records
SPECIFICATIONS
Find unused views and remove them, notably specific views that are not used
anymore because generic one is always taken.
LINKS
Task ID 2196317 (Social/Marketing specific)
PURPOSE
Remove dead views to clean dead records
SPECIFICATIONS
Find unused views and remove them, notably specific views that are not used
anymore because generic one is always taken.
LINKS
Task ID 2196317 (Social/Marketing specific)
PURPOSE
Remove dead views to clean dead records
SPECIFICATIONS
Find unused views and remove them, notably specific views that are not used
anymore because generic one is always taken. Notably
* view_partner_short_form: a short form view on partner that is not used
anywhere anymore. Indeed it has a priority of 2 whereas default form view
has a priority of 1 (lower better). It is not referenced in actions
anymore. It is therefore dead.
LINKS
Task ID 2196317 (Social/Marketing specific)
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>