Commit Graph
143436 Commits
Author SHA1 Message Date
Nicolas Pierre b03e900a40 [IMP] stock(_*), mrp: highlight PO/SO links on forecast report
Replenishment is great to replace MTO but misses the direct link between SO and PO (smart buttons on both SO and PO to link to the corresponding PO and SO).
The info is actually there in the forecasted report but it is not accessible directly from the PO and in the case of the SO does not highlight the corresponding line of the SO.

This adds a graph icon in the PO, MO and receipt form to directly access the forecasted report (it already exists for SO and delivery).
The information linked to the SO/PO/MO/receipt/delivery is also sent to the forecasted report to highlight the corresponding line.
Note that in the case of the SO, the information needs to go first through the qty_at_date widget (which contains the link to the forecast report).

The graph icon for the PO, receipts and MO turns red when the forecasted quantity at expected date is negative. This is done using the new 'forecasted_issue' field.

closes odoo/odoo#62264

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-09 13:41:27 +00:00
Csaba Tóth 4c91e895a9 Sign the Odoo CLA by Online ERP Hungary Kft.
closes odoo/odoo#65816

X-original-commit: 054f3a53c9335bee0a09d4b375e1620292cf0601
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-09 13:19:42 +00:00
Lavish Chhatwani d30663503d [IMP] sms: autofocus on "body" for valid phone number in single mode
Before Commit:
When users wants to send an SMS to someone with help of the phone widget,
the composer is opened, and users expect to be able to write the message
right away. The issue is that the default focus is on the phone number, so
if users start writing, it will corrupt the phone nubmber, and they have to
discard the changes and have to click the body to finally start typing SMS
content.

After Commit:
When the composer is opened, if the phone number is valid, 'body' field is
focused automatically so that users can start typing right away. If number
is not valid, the focus will still be on the phone number. This is managed
by providing 'default_focus' attibute on the body field, which appears or
is hidden as needed.
For the mass mode also, we simply focus on the body field to enable user
to start writing content right away.

closes odoo/odoo#65443

Task-id: 2394488
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-09 11:01:03 +00:00
Didier (did) d34c9c224c [IMP] mail: composer require thread
Whole code is relying on composer having a linked thread, which makes sense
functionally too, so let's explicit this requirement on the field.

task-2453459

closes odoo/odoo#65531

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-09 08:54:43 +00:00
Anh Thao Pham (pta) 097f29d0f6 [FIX] product_margin: fix Avg. Sale Unit Price
- Install product_margin
- Go to Invoicing > Customers > Invoices and create an Invoice
- Add a Credit Note
- Go to Accounting > Reporting > Product Margins and check Product used in the Invoice
The "Avg. Sale Unit Price" is incorrect. It should be 0 as it is for "# Invoiced in Sale"

Credit Notes are not taken into consideration when computing "Avg. Sale Unit Price".
This is also the case for discount.

opw-2382797

closes odoo/odoo#65777

X-original-commit: 8c7feb45f1ee8581e259f3c2aaff7a139f516d94
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-02-09 09:45:15 +00:00
Thibault Delavallée 1b8aa71e6b [FIX] mass_mailing: fix batch call of action_send_mail
Loop inner calls should use mailing not self.

Task ID-2455433

closes odoo/odoo#65755

X-original-commit: d63734eb6e00c079ad9c0658674efb2321610173
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-09 07:55:23 +00:00
Samuel Degueldre 5845bef12b [FIX] web_editor: insert record name as text
Previously, the many2one widget from the web_editor used jQuery's
'.html()' method when inserting a record name into the page. The record
name was not HTML-escaped before this, which may have unexpect result
and break the layout.

This commit fixes that by using the '.text()' method instead.

This bug only affects pages containing a many2one (contact excluded)
at the time of selection and not after the selection.
e.g. on the /event page, changing the category of an existing event
via the website editor

closes odoo/odoo#65686

X-original-commit: 53aff7f07317a8261b8b9c3e462d930141c7081b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-08 09:04:12 +00:00
Benjamin Frantzen (bfr) dd65f793e7 [FIX] account: when a decoder successfully parse an attachment, ocr is not called when updating an invoice
Before this commit, even if another attachment decoder managed to parse an attachment into an invoice, all the decoders were called.

closes odoo/odoo#65764

X-original-commit: ec05004acb2a3283920e3d7730a971814ccc2ac1
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-02-08 20:40:16 +00:00
Denis Ledoux e402cd496f [FIX] mrp: qty_available computation of a kit and its component
When `qty_available` was being called
for a kit and its components at the same time,
e.g.:
 - Kit product
   - Product 1
   - Product 2

The kit product available qty was always computed to `0.0`,
because when computing its component available quantity,
they were computed to `0.0` because they were marked
as `protected` by the ORM when calling the compute method
for these records at the first call.
When the `qty_available` compute method for the kit
then called recursively the `qty_available` compute
method for the component, as the component record
were marked as protected,
the ORM filled their value with the Falsy value `0.0`.

This issue occured particularly in the upgrade integrity unit test
which makes sure the available quantities of the products remain
unchanged after upgrade. This test computes the available
quantities for a bunch of products at the same time,
and its therefore likely a kit product gets its available
quantity computed as the same time than its components.

upg-3185
upg-4215
upg-4228
upg-5558
upg-5745
upg-5856
upg-6012
upg-6064
upg-6076
upg-6306
upg-6514
upg-6588
upg-6729

closes odoo/odoo#65758

X-original-commit: 8e152a567a6003dae4abb3b537b963eec4142d6d
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2021-02-08 18:58:04 +00:00
Thibault Delavallée abeb7f907a [FIX] crm: update query counters
Probably linked to merge and forward of odoo/odoo#65688 that split some
computed fields. This may have an impact on some fields computation and
therefore queries.

Task ID-2455236

closes odoo/odoo#65748

X-original-commit: b1520ad39c7abd18f8af1c3b23e6e3e897916004
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-08 16:34:44 +00:00
Tiffany Chang (tic) 9effef7087 [FIX] mrp: use bom quantity in bom report
This commit makes it so when the bom structure report (Structure & Cost
smartbutton) is opened the product quantity defaults to the BoM's
`product_qty` amount rather than 1.

Steps to reproduce:
- Create/open a BoM
- Set `product_qty` to any value greater than 1
- Click on "Structure & Cost" button.

Expected result: product quantities scaled to the `product_qty`
Actual result: product quantities scaled to Quantity = 1

closes odoo/odoo#65747

Task: 2429885
X-original-commit: 30c05ad99bcf5884e071ebfa41adc6b44f23ba1e
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-08 16:33:36 +00:00
Benjamin Frantzen (bfr) 35a5c0c84c [FIX] account_edi_extended : fix visibility of 'Retry' and 'Send Now' button.
Before this commit, the button 'Retry' would appear if the blocking_level of an account.move (aggregated value of all the related edi.document) was lower than 'error' even though the button 'Send now' also appears. The button 'retry' should only show if the blocking_level is 'error'.

closes odoo/odoo#65714

X-original-commit: 4fda4838b8e3462b6428f316bfe9814cd743e891
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-02-08 12:20:39 +00:00
Benjamin Frantzen (bfr) 7785fcb819 [FIX] account_edi: edi.document are re-send if they are in error
Before the introduction of account_edi_extended and blocking_level, if an edi.document was in error, it was retried each the time the edi.documents were processed. With account_edi_extended a bug was introduced and only the document not in error were processed. This commit aims to restore the previous behavior.

Also fixes tests of account_edi.

See https://github.com/odoo/odoo/commit/a9a46cf09b0c841c7fda95b5ed03033fc6936ca2

X-original-commit: 385fa29322f6dffc7d7d0de96a1cfbddb0cab7f0
2021-02-08 12:20:37 +00:00
Didier (did) b51a08a6e1 [FIX] mail: avoid updating a delete isCausal model
task-2453463

closes odoo/odoo#65707

X-original-commit: f6be3fff524d02b08d9fc05b9a90ec133aa77792
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-08 11:12:52 +00:00
Aaron Bohy 7a51632e39 [FIX] web: nested x2many with non inline views
This commit partially reverts commit [1], and backports commit
[2] from 14.0.

Even though [1] correctly fixes the faulty scenario, there is a
variation of this scenario which isn't handled. It has been
fixed in 14.0 by [2], and that fix also fixes the original
issue of [1]. So we keep the tests of both [1] and [2], and
the fix of [2].

[1] dd97d446ee94a32089f200bb7122139d31e69873
[2] f6c06bd0b8

closes odoo/odoo#65705

X-original-commit: f2b9a5502f5cf0ee51f193177c679889c18130a9
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-08 11:08:06 +00:00
nounoubensebia 87f86579a1 [FIX] website_event: hide registered badge when registration is canceled
Before this commit, a participating badge was displayed on the event even if
the user's registration has been canceled. This is a strange behavior.

After this commit, the participating badge will be hidden if all the user's
registration have been canceled.

Task ID-2432546

closes odoo/odoo#65702

X-original-commit: 125e5401123d8e4bc7656ac7534cc9290451adbc
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-08 11:05:41 +00:00
ijas ahammed bd830b35a7 [IMP] {sale_}crm: tone down action buttons on lead/opp form view
Primary action buttons should suggest the next logical flow to the user.
On contrary, the opportunity form view is having too many primary
buttons, losing their actual meaning.

In this case we consider that next logical steps should be:
 - the creation of a new commercial document (Sale / Rental) if
   any / all of those apps are installed;
 - the winning of the deal (as losing would stop the flow);

With this commit, we make following changes to achieve that:
 - rename the 'Mark Lost' and 'Mark as Lost' buttons to simply 'Lost'
   and make them secondary buttons;
 - rename the 'Mark Won' button to simply 'Won', and keep it primary;
 - once the 'sale_crm' is installed, make the 'Won' button secondary;

closes odoo/odoo#64834

Task-id: 2247355
Related: odoo/enterprise#15977
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-28 11:45:53 +00:00
Benjamin Frantzen (bfr) 64e0ee442f [FIX] l10n_be_edi: added the pdf report inside the xml as a base64 string
This is a requirement for the e-fff format.

TASK ID: 2339062
Ticket ID: 2394614

closes odoo/odoo#65683

X-original-commit: 5e16044b8d5194f9ce3aa8d43a9923896b8abfdf
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-02-08 09:05:35 +00:00
Benjamin Frantzen (bfr) 548d08bdc6 [FIX] l10n_be_edi: pdf extracted from e-fff file have correct extension
The text of the node 'cac:AdditionalDocumentReference/cbc:ID', which should contain the name of the pdf file in an e-fff document is incorrectly set by some software, and may contain the path to the file and/or the name of the xml instead of the pdf. Based on this information, we extract the stem only and append the .pdf extension to form a valid filename for the pdf.

TASK ID: 2339062

X-original-commit: f998d96d68e2e153e6061a273eb65ec3699501e4
2021-02-08 08:17:20 +00:00
Benjamin Frantzen (bfr) fbc77a6ecd [FIX] account_edi: a failed import of an attachment with account_edi now allows OCR to run automatically.
Before this commit, account_invoice_extract and account_edi where independent in parsing files uploaded or added as attachment in an invoice. Some tricks where used to avoid clash, but they were not perfect and some bugs appeared like the OCR not triggering automatically or an attachment being parsed twice by account_edi when parsing failed. The goal of this commit is to unify the import of files between the two features and ensure that they will not clash.

For more information about potential problems that appeared before :
See https://github.com/odoo/odoo/pull/61169
See https://github.com/odoo/enterprise/pull/15124/

closes odoo/odoo#65660

X-original-commit: 8435d0e8990509ee67425977f970ab27bea8133a
Related: odoo/enterprise#16172
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-02-05 17:56:12 +00:00
wan b14e5926ae [IMP] codeowners: add accounting
closes odoo/odoo#65571

X-original-commit: 41ac5b0ea7429f11b554a822287b37d635103a34
Signed-off-by: William André (wan) <wan@odoo.com>
2021-02-04 16:52:01 +00:00
Mithilesh Rao 6cd42e016d [IMP] hr_holidays,web: Improve the mobile view for calendar and times off
Purpose of the task is to improve mobile interface of the Time Off
and calendar view.

So in this commit, we have improved UI as below:
hr_holidays:
 - Move the leave summary topbar from top to sidebar filter of
calendar for small screen
 - Improve the kanban view of leave for mobile and added the
badge for state.

web:
 - Improve the calendar year mobile view by spliting the month view
in 2 column.

TaskID: 2333778
Related PR: https://github.com/odoo/enterprise/pull/13454

closes odoo/odoo#61474

Related: odoo/enterprise#13454
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-08 08:35:05 +00:00
Thibault Delavallée c146e63779 [FW][FIX] crm: split computed fields linked to partner
RATIONALE

Stored editable fields receive their values either from compute either from
user input. If a user input is given to create / write compute method is not
called. If multiple fields are computed through the same method giving one
field value discard call to compute method and other fields are not called.

SPECIFICATIONS

Split ``_compute_partner_id_values`` compute method so that partner related
fields are independent :

  * have a method for address fields as those are computed in group. Indeed
    either we take all from partner either none. Otherwise it would create mixed
    addresses that make no sense;
  * have a specific computation for partner_name and contact_name coming
    from ``_prepare_partner_values``;
  * have other fields separated (function, title, ...) acting like related on partner
    if not set by user;

LINKS

COM PR odoo/odoo#65381
Task ID-2451339

X-original-commit odoo/odoo@78eb46352e

closes odoo/odoo#65658

X-original-commit: bb13421d3a7f04ede9350b3b28c1650c3d9890f8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-05 17:51:33 +00:00
Thibault Delavallée fa20c36a63 [FW][IMP] crm: add tests about lead / partner synchronization and computed fields
Add tests related to lead / partner contact fields synchronization. Add tests
with user input and/or partner synchronization to ensure editable stored fields
work as expected on lead model.

Warning: those tests are failing. Next commit will split computed fields into
several methods in order to fix computation.

LINKS

COM PR odoo/odoo#65381
Task ID-2451339

X-original-commit odoo/odoo@18cd93ded8

X-original-commit: 94d618ff3ff8ee13d23f893836d00a5a71981938
2021-02-05 17:51:32 +00:00
Goffin Simon fa0b098900 [FIX] website_blog: Traceback on archived blog
Steps to reproduce the bug:

- Create a blogpost in the the blog 'travel
- Archive the blog 'travel'
- Open the blogpost

Bug:

A traceback was raised

opw:2444406

closes odoo/odoo#65576

X-original-commit: 196d96ef8eaf8aa06e16c9768ed595fca1c315ff
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-02-04 17:51:29 +00:00
nie 2d5ab66dec [FIX] stock_account: total quantity can be zero
Follow-up of https://github.com/odoo/odoo/pull/64942

Explanation:
When computing the total quantity, summing negative and positive values
can sometimes lead to zero even if the scoped quantity is not zero.
E.g.: Warehouse 1 has 10 items and Warehouse 2 has -10 items.
Scoping on Warehouse 1 results in 10 items but the total quantity is 0.

This commit also takes into account float precision.
Inspired by:
https://github.com/odoo/odoo/blob/d9b409247303c6b165a7df381169f2480a19900f/addons/stock_account/models/stock_quant.py#L36-L38

closes odoo/odoo#65661

X-original-commit: 3547b15cb362f73c60354070da5e49ffa674e432
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-05 17:56:57 +00:00
Raphael Collet 2f93046cf7 [FIX] core: writing on one2many field on new record
When using command "6" (SET), the one2many field's inverse was not
assigned on the lines.

closes odoo/odoo#65675

X-original-commit: ba733a9ac73dcf978ed7eaab7681781b2d5a9bfc
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-02-07 14:32:19 +00:00
Ivan Yelizariev ed02c1a2db [FIX] core: fix adding a field related to Binary or x2many
such fields have store=True, but they don't exist in table.

---

https://github.com/odoo/odoo/pull/65232#issuecomment-773298323
https://github.com/odoo/odoo/commit/02417290191c22c9c99e6dc96a572c21f38e64f1

closes odoo/odoo#65669

X-original-commit: 2eee717ded0fc702b431f7fe784dc62438aa5603
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-02-06 12:41:03 +00:00
Martin Trigaux ef824bdeff [FIX] base: correct Lesotho's currency symbol
The Lesotho Loti has the symbol M and not L
Example of use:
http://lestimes.com/businessman-xie-in-m27-million-scandal/
http://lra.org.ls/sites/default/files/2020-10/LRA%20Integrated%20Annual%20Report%202019.pdf

Fixes odoo/odoo#62807

closes odoo/odoo#65663

X-original-commit: f6b55a460bd4eb96f543d19694e7239677fd3d5a
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-05 18:16:42 +00:00
Didier (did) 74c2d7b775 [FIX] mail: add missing useStore props
closes odoo/odoo#65650

X-original-commit: dd850198619f0ce4008118ea00d50f0cb1b40eea
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-05 17:00:11 +00:00
Martin Trigaux 76f305a556 [FIX] base: query company dependant as superuser
When retrieving company dependant values, the computed domain called
search_multi method of ir.property as normal user.
Since odoo/odoo@8f57863707 ir.property records are no longer
readable by a normal classical user.

To reproduce:
Add a domain using a company_dependant field
e.g. on res.partner, with purchase installed, modify the parent_id
field in form view to

  <field name="parent_id" ... domain="[('property_purchase_currency_id','=',property_purchase_currency_id)]" />

When clicking on the parent_id with a low priviledge user, an
access-right error is raised, as the user doesn't have access to
ir.property records

Fixes odoo/odoo#65450

closes odoo/odoo#65643

X-original-commit: 33868b4e14124800035ea99df111b35b4199ae60
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-05 16:20:49 +00:00
Iago Alonso ea747950a9 [CLA] signature for os-ia
closes odoo/odoo#65632

X-original-commit: 4a08c12aa04f7131b9c090e71fba6c2b3775932d
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-05 14:52:02 +00:00
Adrien Widart 2829ffde9f [FIX] google_calendar: prevent useless partners creation
When syncing with a Google account, if user's email is different from
Google account, the server creates a new partner. Moreover, the synced
event are not linked to the current partner.

To reproduce the error:
1. Have two Google accounts GA01 and GA02
2. With GA01, add an event to Google Calendar and add GA02 to guests
3. In Odoo, sync with Google Calendar using GA02
	- The partner linked to the current Odoo user must have an email
different from GA02's email

Error: The calendar is synced, but the user needs to check "Everybody's
calendars" to see the synced events. A new partner has been created
using GA02's email. The synced events are linked to this new partner
instead of current user's partner (`self.env.user.partner_id`).
Moreover, Google event's organizer is always added to attendees but, if
it this is indeed the case (so if the organizer is also an attendee),
`google_event.attendees` already contains this organizer.

OPW-2440033

closes odoo/odoo#65630

X-original-commit: 12cb76bdfe7a5affb7580485473be71cfa37658a
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-02-05 14:41:43 +00:00
Yannick Tivisse 0506d4e6fa [IMP] hr_contract: Add stat button to access contracts from calendars
Purpose
=======

Currently there's no easy way to retrieve all the contract using a given
calendar.

closes odoo/odoo#65621

Related: odoo/enterprise#16157
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-05 14:06:01 +00:00
Anjali 008c978a16 [IMP] delivery: group sales fields together in contact form
This commit keeps the sales related fields together in a contact form view
by moving 'property_delivery_carrier_id' field at last, instead of after
'user_id' (Sales Person).

Task Id : 2445997

closes odoo/odoo#65030

Related: odoo/enterprise#15946
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-04 09:38:30 +00:00
Julien Castiaux d960da8e54 [FIX] base: remove trigger coalescing
You have have a scheduled activity precisely at 8:12:34 AM (send an
email, anything). You trigger the cron using that precise moment. The
cron runs at 8:12:00 AM which is before the scheduled moment so the
activity is skipped. Imagine there is no other scheduled activity that
coudld trigger the cron, it is only run at worst 23h59 minutes later
thanks to the daily cron execution fallback.

The assumption of a29bb54 is wrong, it groups the moments the
cron should be triggered by grouping the moments on the rounded down
minute. This is not consistent with the trigger API that promises the
cron will run *as soon as possible but **not before*** the scheduled
moment.

closes odoo/odoo#65555

Task: 2452697
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2021-02-05 13:44:55 +00:00
Jigar Vaghela 8f647c07e4 [FIX] l10n_in: If vat is not available in delivery address then check same in customer
This below case is not working before this commit:
when Bill to Ship to where Delivery address partner is not registered and not have GSTIN

closes odoo/odoo#65599

X-original-commit: d9b409247303c6b165a7df381169f2480a19900f
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-02-05 12:26:16 +00:00
Kevin Baptiste 3d5e912da7 [IMP] hr: add a model for work locations
The work location of an employee was previously a fields.Char. That was
changed to a Many2one field to a the new model called work.location.
That had some consequences in other modules that had to be slightly
adjusted.  The modules impacted were hr, hr_appraisal, hr_payroll.

Task id: 2335646

closes odoo/odoo#63192

Related: odoo/enterprise#15235
Related: odoo/upgrade#2020
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-05 13:00:09 +00:00
Jeremy Kersten 258ebe1405 [FIX] website: contact us page, don't cache page if prefilled
Before this commit, the page can be set in cache with some data pre-filled.
Now we don't cache anymore the contactus page if you have GET params.

closes odoo/odoo#65608

X-original-commit: 4ce59c3ab26a441ad8b7f2fd038b690cf897231d
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-02-05 12:14:10 +00:00
sahista pathanandThibault Delavallee 7bd984dacc [FIX] mail: correctly update new and removed subtypes when updating subscription
Currently, the subtype checked selection is not saved when the user adds and
removes subtypes. Indeed either an addition is performed, either a removal
but having both is not correctly taken into account when updating an existing
subscription.

How to reproduce
  * click on the pencil icon to edit the subscription of the follower;
  * as an example default "Discussions" will be the only one selected;
  * check "Notes" and save;
  * -> this works;
  * click again on the pencil icon and uncheck "Notes" and check "Activities"
    then save;
  * -> this does not work as only removal is performed (Activities is not
    checked);

The problem only occurs when you unchecked subtypes and checked other ones.

This commit fixes that behavior by taking into consideration both new
subtypes and subtypes to remove.

LINKS

Task ID-2205643
Task ID-2241688
COM PR #56775

X-Original-Commit odoo/odoo@d16b036638

closes odoo/odoo#65605

X-original-commit: 18cb4f6d8120a30a7f5d05eef107ac1734dd1431
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Thibault Delavallee <tde@odoo.com>
Co-authored-by: Shahista Pathan <sat@odoo.com>
2021-02-05 12:06:10 +00:00
Thibault Francois f001e026a2 [IMP] mail: improvement perf of find_or_create
Behavior before the commit
--------------------------
find_or_create define in mail module called
super if no partner is found based on the email_normalized

super call find_or_create define in base that make
a search again on the email before the creation

This cost two search every time a new partner should be created
and the search on email is less efficient than the search on
email_normalized

after the commit
----------------
Only the search on email_normalized is done before the creation

drawback: if a module that does not depends on mail module
override find_or_create the code will not be triggered anymore
the module should depends on mail module

closes odoo/odoo#65565

X-original-commit: 49d5b3813e57f2cd91d582de9b9bb534f05d2dc3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-05 10:23:53 +00:00
Martin Trigaux 6e6f5bd599 [FIX] mail: fallback on English message
In case of bad translation that doesn't contain the placeholder

Context:
A bad Japanese translation was inserted

  #. module: mail
  #: code:addons/mail/models/mail_thread.py:0
  #, python-format
  msgid "Create new %(document)s"
  msgstr "新しい%(ドキュメント)を作成する"

The translation has been corrected but use the 14.0 syntax of _ method
to include placeholders and fallback on the English source term in
case of bad translation
cf odoo/odoo#52155

closes odoo/odoo#65586

X-original-commit: 48cc6b1f2b3208e8affd5f6a261751fe973c2091
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-05 09:25:40 +00:00
Martin Trigaux 8015bdeb4c [I18N] *: fix bad placeholder in translations
Modify manually for the languages where the language is not on Transifex

closes odoo/odoo#65564

X-original-commit: 793dc3fc1002aca15f5e0a7c33baf36a4550d180
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-04 16:05:39 +00:00
Michael Mattiello (mcm)andAaron Bohy 54ea956490 [FIX] web,base: save when tab/browser closes
PR [1] introduced the auto save feature (changes in form and list
views are automatically saved when the view is left, e.g. with
the pager, breadcrumbs, stat buttons, menus...).

However, there was one case that had been left aside: when we close
the tab or browser. This commit ensures that we also save the
changes in this case.

The record is saved only if it is valid, otherwise the changes are
simply lost (we don't block the tab/browser from closing itself).

Moreover, the beforeunload handler must be *almost* sync (a few
ms setTimeout seems ok, but definitely not an rpc roundtrip). For
that reason, we cannot wait for onchanges to apply before saving.

part of task 2330101

[1] https://github.com/odoo/odoo/pull/60693

closes odoo/odoo#65561

X-original-commit: 9949ea14e4f27ca8c0fc84d726ad0434e2e216b8
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2021-02-04 15:46:28 +00:00
Benjamin Vray 81f907ce1c [FIX] web_editor: allow to center button with summernote
Before this commit, it was not possible to center a button using the
editor option 'align center'.

It is because, using document.execCommand(), the Chrome browser doesnt
want apply 'text-align: center' on nodes with centered children. And
the buttons have the boostrap class '.btn' which adds text-align:
center.

So the hack here is disabling the text-align property from the '.btn'
class during the execution of document.execCommand().

task-2423935

closes odoo/odoo#65566

X-original-commit: d4f38c344360713287eed22872614f46dec7e0f6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-04 16:14:02 +00:00
Samuel Degueldre 480327381a [FIX] website, web_editor: fix empty parallax snippet not being removed
Previously, when removing all the content of a snippet, that snippet
would get automatically deleted. This was not the case for parallax
snippets because we previously intended the user to drop the parallax
snippet, empty it, and drop other content inside of it.

Recently, we added the parallax option on all snippets, rendering the
previous workflow obsolete. There is now no longer any reason to keep
empty parallax snippets. This commit fixes that.

task-2446008

closes odoo/odoo#65551

X-original-commit: 61f410b57f1c28bd6464b86d1582c22b7fd846d5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-04 15:18:36 +00:00
qsm-odoo 6d6ea9a530 [FIX] web: allow users to zoom on frontend pages
task-2446015

closes odoo/odoo#65536

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-04 13:52:03 +00:00
Xavier Morel 0d9b480ee7 [REM] core: useless translation mark
I misremembered that `_` would go look for the translation stuff
through the stack, but it only goes up to the caller of `_` itself.

Since `clean_filename` has no `cr`, `cursor` or `self` that's never
going to do anything, and it's thus completely useless.

closes odoo/odoo#65534

X-original-commit: ab3122448079d998e88f77704df62d1b1871e918
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-02-04 13:03:44 +00:00
qsm-odoo 98d8d51100 [FIX] website_mass_mailing, *: add test for newsletter popup
*: website

This is the forward-port of a stable dependency fix, needed as it
includes a test. The dependency was properly fixed with [1].

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

closes odoo/odoo#65530

X-original-commit: 76e1495b0d5eab8fc03b6daf51dbc1c148c7de53
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-04 12:10:51 +00:00
wan 49dcee62e3 [FIX] account: track the changes on account.move.line
The method `_mail_tracker`` must be called after the super call on `write`

closes odoo/odoo#65505

X-original-commit: cfd98d7b0e022b876a4cc99becc2da4f972ea030
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-02-04 07:52:03 +00:00