Commit Graph
141473 Commits
Author SHA1 Message Date
Samuel Degueldre ff8070033b [FIX] web_editor: show mimetype warning for illustrations
Previously, when clicking on an illustration in the editor, the image
options would be unavailable with a message saying that it was due to
technical limitations, and that the user should reselect the image in
the media-dialog for quality options to become available. This was
caused by the fact that in order to support more than one customizable
color in illustrations, they are now saved inside the database with an
url containing which colors are customizable inside the url's query
parameters. Since the endpoint that finds which attachment corresponds
to which image src was looking for an exact URL match, but query params
are trimmed on the client side before talking to the endpoint, they were
no longer matching.

This commit fixes that by searching for attachments whose URL matches
the provided one with or without any extra query parameters.

closes odoo/odoo#67625

X-original-commit: b26319c3c9409e8724fadeec80e63ea94dc8d599
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-10 17:59:34 +00:00
nie bb5052575a [FIX] website_sale: only show products of the current companies
Steps:
- Create a second company
- Go to Website > Products > Products
- Create a product for all companies
- Click the "Go to Website" smart button
- Click "Edit in Backend" in the top-right corner
- Change the product's company to the one you're not on
- Go to Visitors > Visitors

Bug:
Access Error:
The requested operation ("read" on "Product" (product.product)) was
rejected because of the following rules:

(Records: Two prod (id=42), User: Mitchell Admin (id=2))

Explanation:
It happens because of the rule `product_comp_rule` which prevents
reading a product from a different company.
This commit filters the visited products on the current companies.

opw:2467138

closes odoo/odoo#67614

X-original-commit: 984adb180ab1a255fac086fd61478141074e8d31
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-03-10 16:36:51 +00:00
Anh Thao Pham (pta) 30879f9ff1 [FIX] purchase_product_matrix: fix product onchange on PO form
- Install purchase_product_matrix
- Go to Purchase and create a PO
- In PO Line, type a text (i.e. test) in product field and use quick create option
Description and UoM fields should be updated following product creation, but they are not.
"onchange_product_id" is not triggered.

"purchase_product_matrix" module overrides "purchase.order" form view by replacing product_id
field by product_template_id field.
"_onFieldChanged" function should execute "_onTemplateChange" when product_template_id is changed
and if id is set, which would trigger "field_changed" on product_id, but it cannot be done after
a quick create as id is false.

opw-2462538

closes odoo/odoo#67605

X-original-commit: 3c082b9a47be35579a454f13edc230ac3029922d
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-03-10 15:43:06 +00:00
Younn Olivier 7332d37c68 [FIX] website: fix image gallery slider index
The gallery slider index was wrongly calculated when the gallery had no
active element, as the jquery method .index() will still return -1 when
no element is found.

task-2472041

closes odoo/odoo#67563

X-original-commit: 666fc3697bd7d70cfa0dd92f0a401b771196bb27
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-10 15:50:37 +00:00
Younn Olivier 4366d17794 [FIX] website: fix fullscreen indication pointer events
As the container div of the fullscreen indication stays on the page to
be displayed, it was obstructing the click events of the elements it was
displayed on. The user could not access what was on top of the screen.

The solution was to remove pointer events for that div so that it
doesn't interfere with other elements on the page.

Related to https://github.com/odoo/odoo/pull/65255

closes odoo/odoo#67589

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-10 12:49:29 +00:00
Yannick Tivisse 98f86305b3 [IMP] hr_work_entry_contract: Lessen calls to _get_bypassing_work_entry_type
Allows to reduce the number of queries of 4*N, with N=number of contracts.

closes odoo/odoo#67471

Related: odoo/upgrade#2255
Related: odoo/enterprise#16842
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-10 14:25:22 +00:00
Yannick Tivisse d5abecbce5 [IMP] hr_work_entry_contract: Make _get_contract_work_entries work in batch
Purpose
=======

Reduce by N the number of calls to the method, with N = Number of payslips
2021-03-10 14:25:21 +00:00
Yannick Tivisse b57272794c [IMP] hr_work_entry_contract: Reduce _generate_work_entries queries 2021-03-10 14:25:21 +00:00
Julien Banken e86f892a7b [IMP] crm: Duplicate leads on lead form view
PURPOSE

Duplicate lead records are an issue for CRM users
To prevent sales representatives from contacting a prospect that:

- Already refused an offer from another sales
- Already accepted an offer from another sales
- Is already discussing with another sales

The purpose of this task is to inform the CRM user that there are
some possible duplicates for one lead and let the user decide how
to handle the case.

SPECIFICATION

- Add a computed field to count the number of potential duplicates.
- Add a stat button on the form view of a lead to display the number
of potential duplicates. When the user clicks on it, the leads
considered as duplicate will be displayed in a kanban view.
- Add a lost ribbon on the kanban view to quickly visualize the lead
state since the duplicates can be lost leads.

LINKS

Task ID : 2151017

closes odoo/odoo#61834

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-10 14:29:50 +00:00
Nisha patel adf3c610c7 [FIX] hr_holidays: Improve displayed information on calendar leaves
See task pad for complete information.

closes odoo/odoo#58168

Taskid: 2314838
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-10 14:21:24 +00:00
Arnaud Joset ce58c83872 [IMP] calendar: set default stop different than default start
Before this commit, the default stop was equal to default start, creating events with duration = 0.

closes odoo/odoo#67146

Taskid: 2475473
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-03 12:35:10 +00:00
Laurent Smet 25dcf48225 [IMP] account: Allow tax to not be affected by a previous one
In India, we need to configure taxes like this:
- 6% applied on base amount
- 6% applied on base amount
- 1% applied on 1.12 * base amount

If both 6% taxes are affected the base of subsequent taxes, it gives the following result:
- 6% applied on base amount
- 6% applied on 1.06 * base amount
- 1% applied on 1.06 * 1.06 *  base amount

Thanks to the new 'is_base_affected' field set on the second tax, it gives the expected results.

closes odoo/odoo#66134

Task: 2343958
Related: odoo/upgrade#2254
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-03-08 15:37:08 +00:00
Goffin Simon ba1d2b754f [FIX] account_fleet: Field vehicle_id unavailable on vendor refund
The fleet vehicle_id must be visible on vendor refund

opw:2471784

closes odoo/odoo#67280

X-original-commit: 7144321c3fd13f83241ae7e4be71a9a4d576a871
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-03-04 16:16:25 +00:00
Kevin Baptiste 8c5bfd351a [IMP] hr_attendance: show own attendances
Users with the rights 'Manual Attendance' get (read-only) access to their
own attendances.

closes odoo/odoo#66934

Taskid: 2438863
Related: odoo/upgrade#2216
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-01 13:33:35 +00:00
Kevin Baptiste be8c2cad82 [FIX] calendar: send context on "Add" button
The "Add" button was not propagating the context, therefore records
couldn't get their default values set from the context keys `default_XXX`.

closes odoo/odoo#66876

Taskid: 2464991
Related: odoo/enterprise#16664
Related: odoo/upgrade#2207
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-08 07:18:00 +00:00
Kevin Baptiste 07ccdb2e88 [IMP] hr_holidays: increase performance counter
The change introduced in odoo/enterprise#16664 for hr_appraisal
increases the query counter by one.

TaskID: 2464991
2021-03-08 07:17:59 +00:00
Goffin Simon bb54e5ea1a [FIX] hr_expense: Create an expense product with vendor taxes
Steps to reproduce the bug:

When trying to import or create a expense product with supplier taxes,
the supplier taxes were removed.

PS: The field vendor taxes is available in the expense product view

opw:2444551

closes odoo/odoo#65403

X-original-commit: 02d0591b73f5acd8c94e65cda3af1158c3a2254a
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-02 12:58:42 +00:00
Kevin Baptiste 5f98b6acdb [IMP] hr: add a model for departure reasons
The "Departure Reasons" where hardcoded and couldn't reflect all the
valid departure reasons (like "End Of Fixed-Term Contract").

This commit introduces a new model `hr.departure.reason`.

closes odoo/odoo#66905

Taskid: 2447056
Related: odoo/enterprise#16709
Related: odoo/upgrade#2211
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-10 08:32:36 +00:00
Kairis e426492142 [IMP] Expense, Timesheets: toast feedback to user
Display notification to give feedback to user.
And reload the view with the params "next".

closes odoo/odoo#67219

Taskid: 2344276
X-original-commit: bd33f283a1fa39815481ca28918c65ac7b48d641
Related: odoo/enterprise#16830
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-10 08:46:24 +00:00
Antoine Prieels f0d26f1a87 [FIX] point_of_sale: Electronic payment cancel might fail
With Worldline, the cancel command fails when the card was already inserted.

closes odoo/odoo#67560

Taskid: 2415526
X-original-commit: c71f71fab63d2ccb1faeccbe54425f5b0fb488f0
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-03-09 17:05:25 +00:00
Yann Papouin 492bd7dafa [FIX] sale_purchase: Invalid context mapping
When canceling a purchase order generated from a SO, a warning activity
is generated on the SO to warn the salesman that the PO was cancelled.

But the activity message was incomplete, because the cancelled PO lines
were given as 'purchase_lines' to the rendering context, but expected
as 'purchase_order_lines' in the qweb template.

This commit ensures that the correct key is used and that the activity
message is clear and complete.

Fixes #67508

closes odoo/odoo#67572

X-original-commit: ba7336a9d696e8506943edca2f3871f78fac3e99
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-03-09 20:19:06 +00:00
Lucas Perais (lpe) 8f033a2b50 [FIX] mass_mailing: typo that broke ensure_one down the line
Sometimes it crashed when the domain used for the mailing cron
returned more than one record

source commit: 1738f9c8f7

closes odoo/odoo#67556

X-original-commit: cb97f7c64a1fa575799a7832cb52e433436581e0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-09 16:35:48 +00:00
Didier (did) c1504fb429 [FIX] mail, test_mail: ensure thread name is up to date on message
When formatting a message, a message could be with an empty or obsolete
record_name field. It's better to rely on the relation between the message and
the thread and fetch the current thread name.

task-2411715

closes odoo/odoo#63000

closes odoo/odoo#67549

X-original-commit: 51e962803d2048efeb0f7e96a9fe561ac49ee05a
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-03-09 16:46:41 +00:00
Didier (did) 7b7483f3ed [IMP] test_mail: add query count test record_name in message_format
This will count the number of query when formating messages, in particular for
the thread name query that is changed in the following commit.

Part of task-2411715

X-original-commit: 45b51acc35188765270a0b8b1dcaf5508408edf6
2021-03-09 15:56:46 +00:00
qsm-odooandOussama MESSAOUDI 43232259bf [FIX] website: restore mobile visibility snippet option
Conflict between a fix in 14.0 (see [1]) and an improvement in master
(see [2]) broke the feature (because both introducing a JS option for
the feature).

[1]: https://github.com/odoo/odoo/commit/9463f0f889f9dd8da6077895c125da4998a933c0
[2]: https://github.com/odoo/odoo/commit/25173a4c29b57a01cbe415de439f2da0f4760507

closes odoo/odoo#67555

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Oussama MESSAOUDI <ome@odoo.com>
2021-03-09 16:28:23 +00:00
Jeremy Kersten 29f1e4de0f [FIX] wesite_sale: check mandatory fields during checkout
opw-2477881
This commit closes #67421

Courtesy of @fmdl

closes odoo/odoo#67510

X-original-commit: 3ed730ae7669a082ffca38d8d873785756703801
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-03-09 09:28:15 +00:00
Younn Olivier 7706fa4aca [FIX] website: fix image gallery miniatures disappearing
When the snippet was dropped, the miniatures were disappearing and
replaced by an arrow.

It was due to two things:
- the wrongly calculated index when the snippet was
initialized, as the jquery method .index() will still return -1 when no
element is found, fixed in https://github.com/odoo/odoo/pull/67389
- none of the sample images in the template were active

task-2472041

closes odoo/odoo#67081

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-05 15:28:21 +00:00
xO-Tx 9d2398ac59 [IMP] web_editor: update style for background button
The goal of this commit is to update style for Media Picker button.

Part of https://github.com/odoo/odoo/pull/66544
task-2326573

closes odoo/odoo#66544

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-09 11:02:50 +00:00
xO-Tx 38dc9c82c5 [IMP] website, *: replace spacing selection by a slider
*: web_editor

The goal of this commit is to tweak the code of <we-range> widget
to be able to select a css using class values.
This way, the image spacing selection can be easily replaced by
a slider of 4 levels [0 -> none, 1 -> small, 2 -> medium, 3 -> big].

Part of https://github.com/odoo/odoo/pull/66544
task-2326573
2021-03-09 11:02:42 +00:00
xO-Tx 90b1b1b1b0 [IMP] website: make images wall editable
The goal of this commit is to make the Images Wall/Gallery snippet
editable to be able to open the media dialog on "double-click"
on images.

Part of https://github.com/odoo/odoo/pull/66544
task-2326573
2021-03-09 11:02:36 +00:00
xO-Tx b1e48c8dd2 [IMP] web_editor, *: update multi image selection layout
*: website

The goal of this commit is to improve multi image selection
(Image Wall, Gallery...) using the same layout as in selected themes
for selected images.

Part of https://github.com/odoo/odoo/pull/66544
task-2326573
2021-03-09 11:02:14 +00:00
Younn Olivier dfcc9a3ce0 [IMP] website: show indication to the user that he can exit full screen
Behaviour before the PR is merged :
There is no indication that the user can exit fullscreen by
pressing on escape.

Desired behaviour after PR is merged :
An indication is shown to the user after he enters fullscreen,
which disappear after a few seconds. A new widget
FullscreenIndication is available.

Part of https://github.com/odoo/odoo/pull/65255

task-2438556

closes odoo/odoo#65255

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-08 16:25:14 +00:00
Younn Olivier eddf8971cf [IMP] website, website_sale: change labels of new content
When adding a new product, 'Product Name' is displayed
instead of 'Name', and 'Create' instead of 'Continue' for every type of
new content added.

Part of https://github.com/odoo/odoo/pull/65255

task-2438556
2021-03-08 16:23:55 +00:00
Younn Olivier e55de3be34 [IMP] website: rename 'options' tab to 'theme' and remove tooltip
Behaviour before the PR is merged :
Options tab from the snippets menu can be misleading for some
users.

Desired behaviour after PR is merged :
The options tab from the snippets menu is renamed to Theme, and
the tooltip is removed.

Part of https://github.com/odoo/odoo/pull/65255

task-2438556
2021-03-08 16:23:54 +00:00
Younn Olivier 4236412fd3 [IMP] web: select hex color code when user clicks on it
Description of the task :
Make the website ui as consistent as possible by making some layout
quick wins.

Behaviour before the PR is merged :
The user has to double click to select the hex color on the color
picker after clicking on it a first time.

Desired behaviour after PR is merged :
The hex color value is selected when the user clicks on it.

Part of https://github.com/odoo/odoo/pull/65255

task-2438556
2021-03-08 16:23:54 +00:00
Martin Trigaux 0fda70aa8e [FIX] tools: properly format error message
To reproduce:
1. take a translatable record with an external id
2. delete the record but keep the ir.model.data (sql)
3. export the translations of the module linked to the orphan
   ir.model.data
-> Error while formating the message

This commit fixes three issues:
- %d instead of %s to construct the string
- wrong order to identify the missing records
- display the external ids instead of the ids (which may not be very
  helpful to debug)

Courtesy of Yannick Brant

closes odoo/odoo#67530

X-original-commit: a2a45539ca4056eb3b3d5d6bafbfb63c10255843
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-03-09 12:11:11 +00:00
Christophe MonniezandRaphael Collet c23b13eafe [FIX] models: call inverse method right after cache invalidation
When a record is written on a computed field with an inverse method and
an x2many field wit a delete command, the computed field is not properly
handled by the inverse method, because of a whole cache invalidation
that happens during the unlink.

With this commit, we write in cache on the fields that have been
invalidated before invoking the inverse method.

opw #2439861

closes odoo/odoo#67525

X-original-commit: d39855bad5153654d443d1b7ede3907f8bae3e66
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2021-03-09 11:24:09 +00:00
Kevin Baptiste 819221086c [MOV] hr_holidays: move field to hr.employee
Move the field current_leave_id to hr.employee.

closes odoo/odoo#67332

Taskid: 2476677
Related: odoo/upgrade#2239
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-05 14:00:35 +00:00
Julien Castiaux 2ba1e83253 [IMP] mass_mailing: use cron trigger to send "now"
The "launch" button of an email campaign mark the current campaign ready
to be processed. As sending all the mails is a pretty heavy operation,
it is done asynchronously in a cron. The cron was running every hour, it
means the cron was running even if there was no active campaign and it
has a best precision of 1 hour.

We now use the new mechanism of cron triggers (4b28f11) to schedule the
con execution at the time the campaign is configured to be sent. It
achieves a better precision and ensures the cron only runs when there are
stuff to process.

We still let the cron run once a day as a security until the cron
mechanisme proves reliable.

closes odoo/odoo#65124

Task: 2416741
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2021-03-09 09:31:24 +00:00
Aurélien (avd) 2b73e09ba8 [IMP] hr_holidays: add various cosmetic changes
Remove 'refuse' leaves from the Calendar View.
Improve leave/leave.allocation popup form views.
Add Sequence handle to leave type list view.

Change the sorted key func. in _search override to
first order by sequence asc then sort ties by
remaining,taken desc.

closes odoo/odoo#62162

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-09 08:52:43 +00:00
Jigar Vaghela ec72da926f [FIX] l10n_in_sale: place of supply base on delivery address
Before this commit:

place of supply always set from customer address.

After this commit:

place of supply is set by delivery address

closes odoo/odoo#67393

Opw: 2456095
X-original-commit: dd141a882478c2e3684638321f36b952bcac3858
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-03-05 15:47:15 +00:00
Humberto Arocha 076952189c [FIX] l10n_mx: Fixing Repartition account for refund
Main
-

[FIX] l10n_mx: Repartition account for refund must be the same
than invoice's one.

Explanation
-

Current Behavior
=

Purchase Tax (16%)
-

|field|value
|-|-
|Transition Account|Transtion Tax
|Invoice Repartition|Paid Tax
|Refund Repartition|Transtion Tax
|CABA Base|Base Account

Invoice
-

|account|debit|credit|
|-|-:|-:|
|Expense|1000||
|Transtion Tax|160||
|Payables||1160|

Payment
-

|account|debit|credit|
|-|-:|-:|
|Payables|580||
|Bank||580|

CABA on Payment
-

|account|debit|credit|
|-|-:|-:|
|Base Account|500||
|Base Account||500|
|Paid Tax|80||
|Transtion Tax||80|

Refund
-

|account|debit|credit|
|-|-:|-:|
|Payables|290||
|Discounts||250|
|Transtion Tax||40|

CABA on Refund
-

|account|debit|credit|
|-|-:|-:|
|Base Account|250||
|Base Account||250|
|Paid Tax|40||
|Transtion Tax||40|
|Base Account|250||
|Base Account||250|
|Transtion Tax|40||
|Transtion Tax (*)||40|

(*)Wrong Entry Line

Trail Balance
-

|account|debit|credit|balance|
|-|-:|-:|-:|
|Bank|0|580|-580|
|Base Account|1000|1000|0|
|Discounts|0|250|-250|
|Expense|1000|0|1000|
|Paid Tax|120|0|120|
|Payables|870|1160|-290|
|Transtion Tax|200|200|0|
|Total Sum|3190|3190|0|

Expected Behavior
=

Purchase Tax (16%)
-

|field|value
|-|-
|Transition Account|Transtion Tax
|Invoice Repartition|Paid Tax
|Refund Repartition|Paid Tax
|CABA Base|Base Account

Invoice
-

|account|debit|credit|
|-|-:|-:|
|Expense|1000||
|Transtion Tax|160||
|Payables||1160|

Payment
-

|account|debit|credit|
|-|-:|-:|
|Payables|580||
|Bank||580|

CABA on Payment
-

|account|debit|credit|
|-|-:|-:|
|Base Account|500||
|Base Account||500|
|Paid Tax|80||
|Transtion Tax||80|

Refund
-

|account|debit|credit|
|-|-:|-:|
|Payables|290||
|Discounts||250|
|Transtion Tax||40|

CABA on Refund
-

|account|debit|credit|
|-|-:|-:|
|Base Account|250||
|Base Account||250|
|Paid Tax|40||
|Transtion Tax||40|
|Base Account|250||
|Base Account||250|
|Transtion Tax|40||
|Paid Tax (*)||40|

(*)Right Entry Line

Trail Balance
-

|account|debit|credit|balance|
|-|-:|-:|-:|
|Bank|0|580|-580|
|Base Account|1000|1000|0|
|Discounts|0|250|-250|
|Expense|1000|0|1000|
|Paid Tax|120|40|80|
|Payables|870|1160|-290|
|Transtion Tax|200|160|40|
|Total Sum|3190|3190|0|

Tax Review
=

It is expected that Payables for 290 divided by 1.16 (100% + tax) yields the tax base equal to 250
Given that tax base of 250 multiplied by 0.16 (tax) should yield the Outstanding Transition Tax.
Transition Tax must be 40. Currently it is 0.
Paid Tax must be 80. Currently is it 120.
Refund must cancel out 40 in Paid Tax because Refund is not an actual Cash Flow.

closes odoo/odoo#67348

X-original-commit: 18f9cbea59b4a9bcacb5eee237c531a666b1dc46
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2021-03-05 12:06:17 +00:00
Florian Gilbert 789223af88 [IMP] l10n_be: Remove default account on non deductible part in VAT.
According to the documentation from IPCF, the proportion of VAT that may not
be claimed back must be recorded by default on the same account as the base
amount in a different move line that this base amount.

Task ID: #2373849

closes odoo/odoo#67492

X-original-commit: 8b831cd5d1d837b103aab1abd5ee3cbe0e6787d7
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Florian Gilbert <FlorianGilbert@users.noreply.github.com>
2021-03-08 16:17:17 +00:00
Aaron Bohy cd367a3967 [FIX] web: FieldMany2Many: link/unlink options
Commit [1] altered the way the FieldMany2Many behaves with respect
to 'create' and 'delete' options. Indeed, for many2many fields,
adding or removing records doesn't mean "creating" or "deleting"
records, as it is only about adding/removing records to/from a
relation. This is completely fine and correct.

Unfortunately, a feature has been lost in the process: it is no
longer possible to state that a many2many field should be editable
but should not allow to add (or remove) record to the relation.

This commit fixes the issue by adding two new options: 'link' and
'unlink' for that purpose.

[1] https://github.com/odoo/odoo/commit/c98579d25af01c14df4baf57fb4652f3e7469096

opw~2466213

closes odoo/odoo#67495

X-original-commit: df44e65bbbba55a7ee2224ad5b4f13248a39423a
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-03-08 16:37:38 +00:00
William Henrotin 5b1fac7a78 [IMP] base: use of float_compare in server actions
This commit gives access to float_compare function in server action python
code.

closes odoo/odoo#67500

X-original-commit: 3046b11f50aa1a0e02725492ba63b17c194db751
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-03-08 17:19:11 +00:00
Andrea Grazioso (agr-odoo) 6c41709213 [FIX] base_vat: accept XI VAT format
Following Brexit on January 1st 2021, companies in Northern Ireland have
a new VAT number starting with XI instead of GB. More info:
https://www.gov.uk/government/publications/accounting-for-vat-on-goods-moving-between-great-britain-and-northern-ireland-from-1-january-2021/check-when-you-are-trading-under-the-northern-ireland-protocol-if-you-are-vat-registered-business

stdnum support the new XI VAT from 1.16
https://github.com/arthurdejong/python-stdnum/commit/b93d69581f35aa18e7fdd52b3f7fdf06770215e3
This patch add temporary support in base_vat until the new version
is available on the Debian package repository

Community tracked issue
https://github.com/odoo/odoo/issues/64891

opw-2461322

closes odoo/odoo#67473

X-original-commit: 7e7d8731aa5679123100311b573a65ae23f3db99
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-03-08 15:09:55 +00:00
lejeune quentin 98a35a9a5d [IMP] point_of_sale: Update raspios IoT build
Update the version of the raspios for the IoT

closes odoo/odoo#67486

X-original-commit: 752c041881070d4532f9fb4466e04470fdcfa1af
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-03-08 15:27:04 +00:00
Adrien Widart 3ebfc9352b [FIX] sale_stock_margin: compute product uom qty
When confirming a SO, if a line uses a different UoM than the default
UoM of the line product, the computed cost will be updated to the
product unit cost.

To reproduce the error:
1. In Settings, enable:
    - Units of Measure
    - Margins
2. Create a product P
    - Sales Price: $100
    - No customer taxes
    - Cost: $50
    - UoM: Units
3. Create a SO
    - Add P
    - Set the line UoM to 'Dozens'
4. Display the order line field "Cost"
    - [Note] As you can see, since UoM is 'Dozens':
        - Unit Price: $1200
        - Cost: $600
5. Confirm the SO

Error: Line cost becomes $50 (the cost of one P-product). Since the UoM
of the line is 'Dozens', Cost should be $600 (as before confirming the
SO). As a result, this error creates incorrect data in the margins
(95.83% instead of 50%).

OPW-2444335

closes odoo/odoo#67480

X-original-commit: 377f70ada0ec720aca055986ff19b8bbff84e33d
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-03-08 14:35:04 +00:00
Christophe Monniez 76aff7b774 [FIX] core: avoid astroid imp module deprecation warning
The astroid package where version is lower than  2.5.1 uses imports the `imp`
module that was deprecated in python 3.4 [0].

In Debian buster, astroid version is 2.1.0 and 2.3.3 in Ubuntu Focal.

With this commit, the deprecation warning is filtered out.

Note that pylint 2.5 avoid that deprecated import [1], that's the reason
why the warning was not showing on current runbot Docker image.

[0] https://docs.python.org/3/library/imp.html
[1] https://github.com/PyCQA/pylint/commit/51c646bf70a6e0a86492bfd2ddd1885671d64d67

closes odoo/odoo#67469

X-original-commit: 8127bea147c093aa64ac7d31ebc69e4dcbef6eef
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-03-08 12:39:31 +00:00
William Henrotin 34d3169890 [FIX] stock: pass on change from move to move line
The run_push() method may change the location_dest_id of the stock move
but not the associated stock move line. That can produce a
de-synchronisation between stock move and stock quants as those are
updated by the stock move lines.
This commit ensures the location_dest_id of the stock move is also set
on the move lines in run_push()

opw : 2427301

closes odoo/odoo#67460

X-original-commit: 7dafde71c0591be74f9d433976243342b1b3e635
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-03-08 11:48:32 +00:00