Commit Graph
142684 Commits
Author SHA1 Message Date
Laurent Smet f985eaa71d [FIX] account: Fix corner cases of https://github.com/odoo/odoo/pull/70303
Original issue:
Create a payment like follow:

Payment type: receive money
Partner type: customer
Destination account: whatever receivable
Amount: define an amount (i.e. 90.00)
On Save, open the draft jounral entry created.
Lower the liquidity or counterpart amount and add a writeoff
Go back to the payment, change the amount and save.
The journal entry writeoff will swap from debit to credit at every
change made to the amount. This occur also when changing currency on the
payment

opw-2475223

Otherwise, this fix is not covering all cases:
inbound with write-off in debit
inbound with write-off in credit
outbound with write-off in debit
outbound with write-off in credit

closes odoo/odoo#70903

X-original-commit: 01b9bff35e85fafb1a50bb0819123d186acf4925
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-05-21 13:33:02 +00:00
Rushi Sathawar 6b9acb23bc [IMP] base: open upgrade apps page in a new tab
Currently, clicking on the "upgrade" button from Apps in community
opens the corresponding page in the same tab. As a consequence, the
user completely leaves his database and it can quickly become tedious
to get back to it.

so in this commit, clicking on the 'upgrade' button should open the
corresponding webpage in a new tab

closes odoo/odoo#70636

Taskid: 2513785
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-05-11 10:50:23 +00:00
Mohammed Shekha ccc56e28a3 [IMP] *: replace fa-spinner with fa-circle-o-notch
Slightly improve the overall UI of Odoo with a more modern feel by updating the
current 'loading' icons that look quite old school.

Use fa-circle-o-notch instead of old style fa-spinner

task-2346142

closes odoo/odoo#59454

Related: odoo/enterprise#13908
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-21 11:48:32 +00:00
Thibault Delavallée 0ba617ca87 [FIX] mass_mailing: subject and preview should not be user translatable
Having those fields as translatable lead people to think those will be
translated into recipient's language. This is incorrect as translations
in Odoo are based on current user, not about any recipient who would
see the field value.

In this commit we therefore remove translation capabilities for
subject and preview. Indeed mailings currently offer no multi languages
support. Instead people should create separate mailings targetting
some specific recipients, based on lang or country for example.

Task ID-2535807

closes odoo/odoo#71093

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-20 10:47:03 +00:00
Antoine Guenet d934b81aaa [IMP] web_editor: move icon and image tools to snippet option
Wherever there is a sidebar, this moves all icon and image options to
their own section of it. This also enables previews.
The "spin" option was deemed unnecessary and therefore removed.

TODO: restore the link option for icons. It wasn't working properly
before this and was removed until it is fixed so as not to do any
unnecessary coding for a broken option.

closes odoo/odoo#70952

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-21 09:00:58 +00:00
Aurélien (avd) 2e527b4cac [FIX] mrp: improve perf of explode
Batch the bom_search of bom_lines in mrp_bom.explode.
If we represent the bom hierarchy as a graph, essentially
switch from a depth-first to a breadth-first search, allowing
to batch search boms for each depth level, hence improving
the overall performance.

closes odoo/odoo#71137

X-original-commit: 44ae26e4477e1b76b3dbb0f1acd50e8553b14d71
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-05-21 10:46:46 +00:00
Xavier Morel a1f45aab0e [FIX] core, mass_mailing: preserve markup status in prepend_html_content
In `prepend_html_content`, if body `html_body` and `html_content` are
`Markup` objects, the processing of `html_content` through `re.sub`
will strip away the `Markup` flag, leading to the later concatenation
of the body and content first escaping the content (to safely convert
it to a `Markup`) before performing the concatenation proper.

As a result, the `preview` of a `mailing.mailing` would be
double-escaped, and the markup hiding it would instead be printed as
part of the body.

Assume that the type of `html_content` is str-compatible, and
immediately rewrap the value after processing it through
`re.sub`. This should do nothing if `html_content` was an actual
`str`, and will re-flag it as a `Markup` if it was one.

Also change the finding of the insertion point to use `re.search`, I
don't understand why this uses `finditer`, it just makes the code more
complicated.

closes odoo/odoo#71090

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-20 10:37:09 +00:00
Mohammed Shekha 45b687ea4b [IMP] web: add icons to boolean_toggle widget
With this commit we improve boolean_toggle widget design, now widget will
display fa-check-circle icon if it is enabled i.e. it has true value, widget
will display fa-times-circle icon it is disabled i.e. it has false value.

task-2488999

closes odoo/odoo#68772

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-21 09:32:40 +00:00
Mohammed Shekha 5a0a1e76b3 [IMP] web: improve many2one_avatar widget for form edit mode
with this commit: we improve many2one_avatar widget for editable form view,
previously many2one avatar in edit mode was not displaying image, it was
displaying only many2one selection input, this commit adds image before
many2one input to have unify design with readonly form view.

This is especially motivated by the fact that we plan on getting rid of the
readonly formview to always be in edit mode.

task-2451340

closes odoo/odoo#67366

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-21 07:09:33 +00:00
Xavier Morel e0ad9dcf28 [FIX] base: confusion between werkzeug.urls and urls local
As part of the Python 3 compatibility effort,
01e3514147 moved all uses of urllib(2)
to werkzeug & requests as the packages were renamed and reorganised
between P2 and P3.

For `module.py`, it looks like I confused the `urls` local variable
for an already imported `werkzeug.urls` and just tried calling
`url_parse` on that. Which doesn't work, because `urls` is a
dict.

Fixes #71076

closes odoo/odoo#71120

X-original-commit: 0cfe528de82c1de8971e5bb5f66103447eae781c
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2021-05-20 18:27:30 +00:00
Thibault Delavallée 5d4208d44d [FIX] sms, various: fix override of sms and phone fields methods
There are two mixin involved in SMS notifications

  * mail.thread: standard SMS sending capabilities;
  * mail.thread.phone: advanced use with support of blacklist;

Both require to define fields to use when searching for phone numbers
(generally phone and/or mobile). Those are ``_sms_get_number_fields`` for
mail.thread standard implementation (in SMS module) and ``_phone_get_number
_fields`` for mail.thread.phone advanced implementation (in phone_validation
module).

In this commit we make mail.thread.phone act like a more advanced version
of mail.thread by making _sms_get_number_fields use result of _phone_get_number
_fields, and not the inverse. It allows to remove some overrides notably in
CRM having to define twice fields.

Task ID-2528169

closes odoo/odoo#71111

Related: odoo/enterprise#18428
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-20 15:02:24 +00:00
Antoine Vandevenne (anv) d118466490 [FIX] website_sale: make "Terms & Conditions" checkbox optional again
The "Accept Terms & Conditions" toggle had been mistakenly removed from
the "Customize" tab by commit 573ed74.

task-2494916

closes odoo/odoo#71102

X-original-commit: b64519c1cb15540db5343f69be501e7a6d507b06
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-05-20 13:30:15 +00:00
Odoo's Mergebot 481f181fb5 [MERGE][MOV] sale: split and reorganize python files
The `sale` code is going to experience some refactorings/improvements soon, and in preparation of those tasks, we believed it was time to reorder the python files.  Splitting files according to python classes, and using targeted names as file names will improve the clarity and maintainability of the module, easing the future work.

To conserve the blame history of the splitted files, the file split are done in 2+ commits.

* `account_move.py` & `account_invoice.py` -> `account.move{.line}.py`
* `payment.py` -> `payment_acquirer.py` & `payment_transaction.py`
* `sale.py` -> `sale.order{.line}.py`
* `utm.py` -> `utm_campaign.py`

Moved the `mail_compose_message.py` file to the `wizard` folder, since it targets a wizard.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#71041

Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-05-20 17:38:15 +02:00
Victor Feyens fbc3102b56 [FIX] sale: update test according to the file moves 2021-05-20 14:27:31 +00:00
Victor Feyens f437f4a03d [MOV] sale: wizard to wizard directory 2021-05-20 14:27:31 +00:00
Victor Feyens a9236aca16 [IMP] sale: updated __init__.py 2021-05-20 14:27:31 +00:00
Victor Feyens 78203b0543 [IMP] sale: style checks (unused imports, ...) 2021-05-20 14:27:31 +00:00
Victor Feyens 611f6447d9 [MOV] sale: split sale.py (2) 2021-05-20 14:27:31 +00:00
Victor Feyens 94cf6625bd [MOV] sale: split sale.py (1) 2021-05-20 14:27:31 +00:00
Victor Feyens 77ee991ac8 [MOV] sale: rename utm.py 2021-05-20 14:27:31 +00:00
Victor Feyens 8c285ea151 [MOV] sale: split payment.py (2) 2021-05-20 14:27:31 +00:00
Victor Feyens 03eb6f40fc [MOV] sale: split payment.py (1) 2021-05-20 14:27:31 +00:00
Victor Feyens a8076bd513 [MOV] sale: move/split account files (3) 2021-05-20 14:27:31 +00:00
Victor Feyens 15f822fa5a [MOV] sale: move/split account files (2) 2021-05-20 14:27:31 +00:00
Victor Feyens 46ac48866e [MOV] sale: move/split account files (1) 2021-05-20 14:27:31 +00:00
Prakash Prajapati 0caaa12ed0 [FIX] sale_timesheet: fix domain of project on product
Currently, create a service product and select a project or a project
template from the 'sales' tab, it is not possible to select projects
with allow_timesheets = false

So in this commit, the domain of the project_id and the
project_template_id fields should include projects for which
allow_timesheets is false except if the 'Timesheets on tasks'
option is selected as a service_policy
Also if onchage of service_policy, the project field will be empty.

TaskID-2522084

closes odoo/odoo#71099

X-original-commit: 0769a148f731188f53f1b2b3af881d88e40feb35
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-05-20 12:38:55 +00:00
Mohammed Shekha e6c2dfdf29 [IMP] web: allow user to select multiple company
Before this commit: when user selects company from company switcher, page is
reloaded, what if user wants to select multiple companies from dropdown, he
have to wait for page reload and need to do same process again.

After this commit: when user selects company from company switcher, page
will not reloaded as soon as user toggles checkbox, user will given time to
select another item or unselect other item from dropdown, so user can select
multiple companies or unselect multiple companies.

task-2467747

closes odoo/odoo#70799

Related: odoo/enterprise#18376
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-20 12:01:23 +00:00
Mohammed Shekha 28fa5bc806 [IMP] web: add basic search for binary field
With this commit: we are adding basic search feature for binary fields,
custom filter will have binary fields and selecting binary field will
display 'is set', 'is not set' operators.

with this user can at least filter records based on whether binary field
is set or not set.

task-2512226

closes odoo/odoo#70149

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-04-30 09:08:02 +00:00
Kartik Chavda fe022b74a5 [IMP] (hr, sale)_expense:replace demo expense products
Currently, in the expense module, demo expense products are more
specific to the expenses and label tooltip of the cost field doesn't
convey proper difference between fixed and variable cost of
expense products.

So in this commit, replace old expense products with new expense
products and recreate expenses and reports using these
categories(products). it will provide better experience on demo.
overwrite label tooltip of cost field in expense app to convey proper
difference between fixed and variable cost of expense products.

closes odoo/odoo#68955

Task-id: 2491238
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-20 07:12:11 +00:00
nounoubensebia 171eea3fae [IMP] mass_mailing[_sms], tools: make mass mailing form focus on body
Make the email body take the entire space to avoid having some wasted space,
this will also make the user have more focus when designing an email.

Revamp the settings notebook page in order to give more clarity to the user,
and move some fields from the main form have been moved to this section to
have more space in the bottom for the email body.

In the mailing form, when the mailing is sent or is being sent, set fields
which are no longer useful for the user to change to readonly mode.

Add a wizard that enables the user to schedule a mailing, the schedule field is
still kept in the form for the user to be able to change the date when the
mailing is in the queue (if they want to send it sooner).

Display an action helper-style content when the email is empty, because,
currently, the user is left with a big white screen when the email has no
content which is not desirable.

Update the html_empty function to take into account style attributes to better
match the editor's void content.

Hide A/B testing fields from SMS mailing form view as these are not supported
for SMS marketing.

Task-2469409

closes odoo/odoo#68882

Ent-pr: https://github.com/odoo/odoo/pull/68882
Related: odoo/enterprise#18391
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-20 09:40:40 +00:00
yograj tandel e893651cec [IMP] *: remove widget='selection' from many2one fields
Currently, across Odoo, there are around 40+ many2one fields defined with a
'selection' widget. Since the many2one widget has options to limit record
creation and opening, there is no reason to define a many2one field with a
selection widget. The selection widget does not allow for searching, and is
limited to 100 records.

PURPOSE
to update the definition of any many2one on which we applied a 'selection'
 widget, and instead use the standard many2one widget with disabled
opening/creation instead.

after this commit,
for each many2one field defined with widget="selection",  widget="selection" is
replaced with options="{'no_open': True, 'no_create': True}"

Task : 2476488

closes odoo/odoo#68387

Related: odoo/enterprise#17316
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-20 11:01:28 +00:00
Odoo's MergebotandXavier BOL 76e31d5f7b [MERGE] project: Improve task's partner_id management
Purpose
======

During the development of the task #2169100, it appeared that the synchronisation
of a task's partner_id according to its project's partner_id and its parent's
partner_id was not very clear.

A first idea was to simplify the partner_id management: as it could be annoying
for the customer to see all the task's partner_id overriden after project's
partner_id modification, the idea was to just use the parent's parnter_id or the
project's partner_id as default value of the task's partner_id. Then, if the
partner_id of the project or of the parent is changed, there is no more impact
on the task partner_id itself.

The main problem of this solution is that the management of the task's partner_id
is also extended in several others modules like sale_project and sale_timesheet.

You can find below what seems to happen with all these task partners.

Start following rules according to which module is installed.
(for the record: sale_timesheet depends on sale_project which depends on project).

Rules are applied in the order they are written.

Rules labelled "O" only apply when changing the project through the task form view.
Rules labelled "C" apply everywhere.

technical: C=compute, O=onchange

project
C.1 If parent's partner changes and the partner is not set, then set the parent's
    partner
C.2 Else if project's partner changes ant the partner is not set, then set the
    project's partner

sale_project [+ project]
C.1 If the project's sale order line's partner changes and the partner is not set,
    then set the project's sale order line's partner
C.2 Else apply (project.C) rules

sale_timesheet + [sale_project + project]
C.1 Apply (sale_project.C) rules
O.1 If the project is billed "At Project rate" or "At Employee Rate" and the
    partner is not set, then set the project's sale order's partner
    the sale order line's partner

Specification
===========

- If the partner changes, we ignore all current tasks and let them be. We set the
  new partner as default value on all new tasks. In detail, we have done
  this:
    - When the user creates a task give the customer of the default project or the
      task parent as default customer for the task.
    - When the user changes the project and no partner in the task, we take the
      partner of the new project (if this project has a customer).
    - When the user changes the customer of the project, the linked tasks are not
      impacted by this changes, even if some tasks have not a customer yet.
    - When the user changes the customerf of the parent task, the child tasks are
      not impacted by this changes, event if these tasks have not a customer yet.
- remove the onchange rule to remain consistent.
- get the display_project_id if parent is subtask.

## Miscellaneous

- display commercial_partner_id in project kanban view rather than the partner_id
  in the kanban card of each project to be consist with task's kanban card.

TaskID: 2232042

closes #51471

Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
2021-05-20 16:33:39 +02:00
Xavier BOL (xbo) f79c84e2e9 [IMP] project: display commercial_partner_id in project kanban view
Before this commit, when the partner_id in the project, we display the
partner_id selected in this project in the kanban card of it.

This committ displays the commercial_partner_id rather than the
partner_id in the kanban card of each project in the kanban view to be
consist with task's kanban card.

task-2232042

closes #51471
2021-05-20 13:32:18 +02:00
Xavier BOL (xbo) 4d96a03c43 [IMP] project: get the display_project_id if parent is subtask
Before this commit, when the user creates a subtask in subtask then we
take the project_id but if the user has changed the display_project_id,
the subtask of this task has not the correct project.

This commit gives the project_id by default if the parent task is not a
subtask or the display_project_id of this parent task is not defined
otherwise it gives the display_project_id.

task-2232042

closes #51471
2021-05-20 13:32:18 +02:00
Yannick TivisseandXavier BOL 29bdb04421 [IMP] project: Improve task's partner_id management
Purpose
=======

During the development of the task #2169100, it appeared that the synchronisation
of a task's partner_id according to its project's partner_id and its parent's
partner_id was not very clear.

A first idea was to simplify the partner_id management: as it could be annoying
for the customer to see all the task's partner_id overriden after project's
partner_id modification, the idea was to just use the parent's parnter_id or the
project's partner_id as default value of the task's partner_id. Then, if the
partner_id of the project or of the parent is changed, there is no more impact
on the task partner_id itself.

The main problem of this solution is that the management of the task's partner_id
is also extended in several others modules like sale_project and sale_timesheet.

You can find below what seems to happen with all these task partners.

Start following rules according to which module is installed.
(for the record: sale_timesheet depends on sale_project which depends on project).

Rules are applied in the order they are written.

Rules labelled "O" only apply when changing the project through the task form view.
Rules labelled "C" apply everywhere.

technical: C=compute, O=onchange

project
C.1 If parent's partner changes and the partner is not set, then set the parent's
    partner
C.2 Else if project's partner changes ant the partner is not set, then set the
    project's partner

sale_project [+ project]
C.1 If the project's sale order line's partner changes and the partner is not set,
    then set the project's sale order line's partner
C.2 Else apply (project.C) rules

sale_timesheet + [sale_project + project]
C.1 Apply (sale_project.C) rules
O.1 If the project is billed "At Project rate" or "At Employee Rate" and the
    partner is not set, then set the project's sale order's partner
    the sale order line's partner

Specification
=============

- If the partner changes, we ignore all current tasks and let them be. We set the
  new partner as default value on all new tasks. In detail, we have done
  this:
    - When the user creates a task give the customer of the default project or the
      task parent as default customer for the task.
    - When the user changes the project and no partner in the task, we take the
      partner of the new project (if this project has a customer).
    - When the user changes the customer of the project, the linked tasks are not
      impacted by this changes, even if some tasks have not a customer yet.
    - When the user changes the customerf of the parent task, the child tasks are
      not impacted by this changes, event if these tasks have not a customer yet.
- remove the onchange rule to remain consistent.

TaskID: 2232042

closes #51471

Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
2021-05-20 13:32:18 +02:00
BVE 2051e2b6df [FIX] account: digest email revenu values correction
The value taken into account in the SQL for the calculation were wrong:
- Not based on the state of the invoices (cancelled and draft
were taken into account)
- Had the tax included

opw-2464004
feedback-2478356

closes odoo/odoo#71088

X-original-commit: 8b0e438af24883f979cb54eb046564e4e2a3f64c
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bve-odoo <Abridbus@users.noreply.github.com>
2021-05-20 10:32:18 +00:00
Aurélien Warnon e1b1733c03 [FIX] website_slides: close fullscreen mode when opening web editor
The web editor does not work well with the e-learning fullscreen view.
It actually completely closes the fullscreen view and opens the edition on a
blank page.

To avoid this, we intercept the click on the 'edit' button and redirect to the
non-fullscreen view of this slide with the editor enabled, whose layout is more
suited to edit in-place anyway.

A small testing tour was added to ensure this behavior is kept.

Task-2507179

closes odoo/odoo#71086

X-original-commit: 8009e6fedb78e7c16764faef77459614c7ff5ed2
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-20 09:54:04 +00:00
Swapnesh Shah e0f0732ab8 [FIX] project: display share action on only form view
Before this commit,
Share action was displayed on list view as well which
doesn't makes sense as it will always use `active_id` only.

With this commit,
we are displaying `Share` action on form view only.

opw-2530652
closes #70821

closes odoo/odoo#71062

X-original-commit: 45845a87ab6a6260b42abacf16811684418cd775
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-05-19 16:51:25 +00:00
Aurélien Warnon 00cc734efa [IMP] crm_iap_lead: improve error handling for lead mining requests
This commit improves the crm.iap.lead.mining.request error handling by
displaying the encountered error (currently one of "no results" or
"insufficient credits") within a warning block on top of the form view.

This allows the user to quickly understand what's going on and change his
parameters to get results or buy additional credits if he's out.

Furthermore, this commit simplifies the technical implementation by avoiding to
re-create a separate crm.iap.lead.mining.request when we encounter an issue and
instead allow the user to modify the current request with an error state.

UPG PR odoo/upgrade#2261
Task-2478427

closes odoo/odoo#67574

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-20 06:58:01 +00:00
JordiMForgeFlow 07a5dd9f65 [FIX] mrp: fix recursion error when updating quants for kit variant
When updating the quantities available for a product, an inventory move
is generated without setting the product_tmpl_id, as this field is related
to the product_id of the move. However, when creating the move, Odoo will
consider it a default missing value and will try to fill it in the method
default_get.

When navigating to the product variants of a template from the template form,
a default_product_tmpl_id is set in the context pointing to the template. This
context is propagated to the update quantity action to create/update quants for
the variant.

The problem when dealing with kits is that the products available to update
their quantities are the components of the kit. When navigating to a variant
and updating the quantities of a component of the kit variant, the default product
template in the context will be the kit template.

This is causing that, when generating the inventory move, the move is created with
product_id of the component, and product_tmpl_id of the kit template.

This issue creates a critical data inconsistency as the component's template is set
to the kit's template, which apart from making no sense generates a recursion error.

To fix this, when triggering the action to create/update quants for a kit product, it
must be ensured that no default product template is being set.

closes odoo/odoo#71069

X-original-commit: bdeea73dc1efb6ff7d02cc2f58347a69762bcc3c
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-19 17:50:40 +00:00
Tiffany Chang (tic) f135171b61 [FIX] mrp: prevent MO validation with no consumption
If a MO is validated with all of its (component)
move_raw_ids.quality_done = 0, then when trying to validate the
nonsensical "The quantity to produce must be positive" validation error
will occur. This is due to all move_raw_ids being marked as Cancelled,
which auto-updates the MO state to cancelled, which prevents the
validation from properly completing.

To avoid this error, we prevent the user from having 0 consumption for
all components.

Task: 2422698
Related (v13 fix + bug description) Task: 2463893
ENT PR (test fixes): odoo/enterprise#18355

closes odoo/odoo#71068

X-original-commit: 81ba7084aeb3899787d083a2a2568a490f9c53e5
Related: odoo/enterprise#18411
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Tiffany Chang <ticodoo@users.noreply.github.com>
2021-05-19 17:26:18 +00:00
std-odoo b7e5eb639a [FIX] link_tracker: clean code and fix add a constraint
Purpose
=======
Add a unicity constraint (on the url, UTM campaign, medium and source).
As we must care about null values, we can not implement it in SQL
(possible in pure SQL, but we will need to create an index on the
columns, which is not possible in Odoo if we want to customize the
error message).

Clean the code, before the "search or create" behavior was implemented
in the create, causing strange behavior (creating a link tracker with
the same values as an existing one didn't raise an error, but open
the form view of the existing link tracker).

Task-2090344

closes odoo/odoo#48845

Related: odoo/enterprise#9608
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-17 13:28:43 +00:00
Christophe Monniez 25567ff92b [FIX] core: avoid deprecation warning in requests_toolbelt
The requests_toolbelt package < 0.9 uses `from collections import ...`
which is deprecated in python 3.8 [0].

The request_toolbelt package is not a dependency of Odoo but is needed
by zeep [1]. Unfortunately, the Ubuntu python3-requests-toolbelt package
is still 0.8 [2].

This commit filters out the warning.

[0] https://github.com/requests/toolbelt/commit/979f95266c2044893b05cb2314e94c899915748c
[1] https://packages.ubuntu.com/focal/python3-zeep
[2] https://packages.ubuntu.com/focal/python3-requests-toolbelt

closes odoo/odoo#71056

X-original-commit: 91dd6171dac567e5f0185e53982ede3b166cfe7c
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-05-19 16:11:29 +00:00
Urvi Soni a50157e60e [FIX] hr_expense: do not create a payment when expense is paid by company
Currently, when we create an expense that is paid by company,
then create and approve a report, then post entries, 2 entries are
created. 1 is posted and is correct, the other one is in draft due to
the creation of the payment for employee and should not be there.

As when a company pays for an expense, in 99% of the cases,
it's because employees have a credit card funded by the company.
It happens often that company owners have this kind of card or even
employees but that's more common in the US. In such case,
it's just an account payable to visa or mastercard. so no need to
create a payment for the employee.

So this commit, draft entry will not be created when payment paid
by the company while posting the entries from the expense.

closes odoo/odoo#71063

Taskid: 2410551
X-original-commit: 2aedd076317b37ceffba061c48e3d4fc38f02ea9
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-19 16:56:04 +00:00
Raphael Collet 8ff079366d [FIX] core: computed editable one2many field with a domain
Manually adding a line should not trigger the computation of the field,
just like modifying the line fields that occur in the field's domain.
In other words, the dependencies of the field should be limited to the
ones declared on field or its compute method.

closes odoo/odoo#71049

X-original-commit: 1c39814bd729cc08882f1545c7d88b0592e63f9a
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-05-19 16:29:53 +00:00
Andrea Grazioso (agr-odoo) 2df6a0ee81 [FIX] sale_product_matrix: avoid traceback when using Order Grid Entry
- Enable 'product configurator' and 'variant grid entry'
- Go to product [DEMO]:
  - Add an optional product.
  - Go to the variants tab and add some variants
- Select 'order grid entry'
- Remove all the variants
- Create a SO adding [DEMO]

Traceback will occur

opw-2439764

closes odoo/odoo#71048

X-original-commit: da9541089fcf33c778748c4c3da0d81f6b5ea227
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-05-19 15:18:34 +00:00
Munaf Khan 3c71695e2a [IMP] sms: rename 'Cancel' button to 'Discard' in SMS resend wizard
taskID-2465233
closes https://github.com/odoo/odoo/pull/67502

closes odoo/odoo#67502

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-19 12:51:07 +00:00
Munaf Khan 160b5732ef [IMP] sms: allow users to resend SMS
Right now, for failed SMS, user have to go through each record one
by one to resend the SMS, which is not ideal and user should be
able to resend SMS in batch from the list view.

This commit improves the behavior with following changes:
 * Introduces an action 'Resend' which is availabe on list view of the SMS.
   It enables resending multiple SMS (that are in error state). It also
   displays appropriate toast notifcation to users so they know how it
   worked (if few/none SMS sent successfully or there was no SMS that could
   be resent etc).
 * On the SMS form view, a new 'Retry' button is introduced, visible on SMS
   whrich are cancelled or in error state. It pushes the SMS back in sendng
   queue (outgoing state).
 * 'Cancel' button on form view now also appears in error state.
 * Uses the state-decorations on the list view for better identifications
   of the records (info for outgoing, muted for canceled and danger for error
   state).

taskID-2465233
closes https://github.com/odoo/odoo/pull/67502
2021-05-19 12:51:06 +00:00
Xavier BOL (xbo) 45fb9641b1 [FIX] sale_timesheet: not use demo data in unit test
Before this commit, we use the 'product.product_category_3'
external_xmlid to find the 'Services' category but this record is in
fact a demo data.

This commit removes this using to create a new category called
'Services' for the product created in this test.

Related PR: #65146

closes odoo/odoo#70869

X-original-commit: dd68808fd074ba776f4a9f6b3218df99b887ae9b
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-05-17 11:45:26 +00:00
Swapnesh Shah b6e1ad0f77 [IMP] mrp: add float_time widget on durations fields
closes odoo/odoo#59692

Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-06 16:09:58 +00:00