Commit Graph
147774 Commits
Author SHA1 Message Date
Audric Onockx (auon) 081efb3d62 [FIX] sale_project : display SO stat button on task in mobile
Steps :
- In mobile, go to Task

Issue :
- "Sales Order" stat button is not displayed.

Cause :
- This button's classe are :
	- d-md-inline = displayed when size is medium+.
	- d-none = or else not displayed
- In the past, there was a field SO in the form,
	which made this button unnecessary and taking space.

Fix :
- Now that this field isn't present anymore, delete d-none part.

opw-2722535

closes odoo/odoo#82963

X-original-commit: 16f489ad6b6b9e8118bc806f220cf122e20374a8
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-01-18 11:56:59 +00:00
Raphael Collet 5a32587f16 [FIX] product: make cache invalidation more specific
Some aggressive cache invalidation in the middle of method write() where
the model has children models (in the _inherits sense) causes very nasty
errors that are hard to fix.

Consider two models A and B, where B inherits from A.  Also consider two
fields a1 and a2 on A, which are thus both inherited by B.  Now take a
record from model B, and update both fields as:

    record.write({'a1': ..., 'a2': ...})

As both fields appear as related fields on model B, the method write()
puts all values in cache, then it proceeds to call the inverse method of
both fields.  The inverse method of a1 is called, and this writes on the
parent record.  Now imagine that some override on A invalidates the
whole cache.  When the inverse method of a2 is called, the field's value
on B has been invalidated, and this therefore writes the value False on
the record's parent.

This patch removes and adapt such cache invalidations:
 - Since 4b1cb41cf7, the cache invalidation
   in method write() of product.product is no longer necessary.
 - The cache invalidation in method write() of product.pricelist.item
   has been removed as well, since field that needs to be recomputed no
   longer exists.

Fixes #76946, #77042

closes odoo/odoo#82958

Opw: 2657461
X-original-commit: 5a73a8a3697c0f2685471efa252e5eb1af738e83
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-01-18 11:56:55 +00:00
Antoine Vandevenne (anv) e0601745d8 [FIX] payment_buckaroo: stop crashing on invalid translatable string
closes odoo/odoo#82939

X-original-commit: 1d2fef3ae247f18ccf5c046bf02d35f66f0a0443
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-01-18 11:02:14 +00:00
Antoine Vandevenne (anv) 04997a86b9 [FIX] payment_buckaroo: prevent creating new session for returning users
Before this commit, users returning from Buckaroo to Odoo after payment
could see their session renewed, depending on their browser's
implementation of the `SameSite` cookie attribute. This prevented Odoo
from retrieving the transaction from the users' session.

This commit flags the return route of Buckaroo with
`save_session=False`, hence allowing all users to immediately
post-process their transactions when they return to Odoo.

closes odoo/odoo#82938

X-original-commit: b309d3a99f8ff4a43a21c4772c344ed3250e319f
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-01-18 11:02:10 +00:00
Florent de Labarre 7088851cad [FIX] sale_purchase: copied purchase is linked with the SO
- create an SO with dropshipping, confirm. It create a PO 1
- copy PO 1
--> Issue PO 2 is linked with the SO

closes odoo/odoo#82902

X-original-commit: d56f94d7db59f1228ec90ab0e8ab1e89f3a663e7
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-01-18 11:02:06 +00:00
Arthur Gossuin (goa) 5e849006db [IMP] l10n_in: always generate commercial invoice
The commercial invoice is usually only needed when the country of the
sender is different from the country of the recipient, however, for india,
commercial invoice is mandatory, even if the goods dont leave the country:
https://cleartax.in/s/commercial-invoice/#commercial

closes odoo/odoo#82084

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-01-18 11:02:02 +00:00
Arthur Gossuin (goa) a8ac9c674e [IMP] delivery: add bool function for CI
Usually we want to create commercial invoices in case the warehouse is in a
different country than the recipient. However, some countries like India
need those documents for internal shipping as well.

The added function can easily be overriden in a dedicated module for the
countries that require such a commercial invoice.

Part-of: odoo/odoo#82084
2022-01-18 11:02:02 +00:00
Martin Trigaux d9091ed043 [FIX] point_of_sale,base,: skip store_fname
The store_fname is calculated based on the checksum, as for file_size

and checksum, skip during create/write
Avoid replacing in place the attachments in base as this breaks some
tests reusing the vals_list content (e.g. test_complete_me

Set datas in the copy to keep the content when duplicating a record
(e.g. test_14_duplicated_css_assets fails without this)
running twice because of @warmup share the same self.vals)

closes odoo/odoo#82919

X-original-commit: 611e6794376b0d60291dec085485bb2fb4e31a33
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-18 10:09:59 +00:00
Adrien Widart cafd488883 [FIX] stock: convert product description
In some cases, the SM description is incorrect

To reproduce the issue:
1. Create a product P
2. Create a receipt with 1 x P

Error: The description of the SM is incorrect: `<p><br></p>`. It should
be the name of P

Another example:
1. Create a product P:
    - Internal Notes: "Lorem Ipsum"
2. Create a receipt with 1 x P

Error: The description of the SM is incorrect: `<p>Lorem ipsum<br></p>`.
It should be "Lorem Ipsum"

Since [1], `product_template.description` is a HTML field.

[1] bea5790713

OPW-2732208

closes odoo/odoo#82917

X-original-commit: 73f05114307b6ec6590da22903751ab79e7efa90
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-01-18 10:09:55 +00:00
Florian Damhaut d7c70ade0d [FIX] calendar: correct errors for default attendee
Step to reproduce:
- Create a lead
- go on the smart button meeting
- create a new meeting and edit it
- save

Current behaviour:
- Validation Error
- It seems the default_get apply command in onchange instead of passing the value which lead to missformed argument for meeting

Behaviour after PR:
- Do not send readonly attendee in calendar.event form view

opw-2724372

closes odoo/odoo#82794

X-original-commit: fba25d6982d149a9d5083f993dea7c2091736c58
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-01-18 09:14:47 +00:00
Laurent Smet 807ca26d0a [FIX] l10n_be_edi: Fix wrong anchor for AdditionalDocumentReference (E-FFF EDI)
AdditionalDocumentReference is currently injected right after DocumentCurrencyCode.
However, in 15.0, OrderReference is implemented and then, AdditionalDocumentReference is no longer injected at the right place.
To fix this, we inject now this field just before AccountingSupplierReference that must be always there and Signature is not implemented.

For more details, see:
http://www.datypic.com/sc/ubl20/e-ns19_Invoice.html

closes odoo/odoo#82897

X-original-commit: ce4d52fbbf400d911901e09d562e06984447639a
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2022-01-18 08:18:06 +00:00
Hoang Tran 4851cbc094 [FIX] sale: only reconcile with posted payment if linked transactions
While posting an invoice, if the transactions linked with the invoice
are failed due to valid reason from the payment acquirer, forcing
reconciliation on transactions' payment will raise an error because such
payment isn't posted.

closes odoo/odoo#82895

X-original-commit: 52937b441432b56994dda857d8cdee06b8128872
Signed-off-by: Laurent Smet <las@odoo.com>
2022-01-18 08:18:02 +00:00
Florian Damhaut 237b1b0d65 [FIX] payment_authorize : accept american express CVC
American Express CVC code are 4-digit numbers

Current Behaviour:
Authorize currently only accept numbers up to 999.

Behaviour after PR:
Authorize accept number up to 9999

opw-2727511

closes odoo/odoo#82770

X-original-commit: 9f7821655a2b632f8e36569c438df358c0d23d02
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2022-01-18 07:32:58 +00:00
Laurent Stukkens (LTU) d5e40ea78b [FIX] project: prevent issue on description field resize in form
Prior to this commit:

    - The selector used by the FormHtmlFieldExpanderMixin is the generic one
      '.o_xxl_form_view .oe_form_field.oe_form_field_html'. This selector, altough
      valid, could lead to an undesired behavior if another html field is present
      previously (before the description one) in the view.

After this commit:

    - The '[name="description"] is added to the selector which reduces the possible
      matches only to the one of the description field.

closes odoo/odoo#82926

X-original-commit: db8684055712ec9c5d1acadee60e54a78d87c941
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-01-17 17:50:33 +00:00
Antoine Dupuis (andu) 7b21821d60 [FIX] l10n_pe: demo: set l10n_latam_identification_type_id to 'RUC'
The issue:
When creating a fresh DB with demo data, the demo company and
customer are created with l10n_latam_identification_type_id set to
the default, which is 'VAT', rather than 'RUC'.

This creates a problem when we create an invoice with the demo
company and the demo customer and validate it: when the l10n_pe_edi
module sends the invoice to the OSE, the OSE responds with the
following error code:

'1007|El dato ingresado no cumple con el estandar - [...]
error: Error Factura (codigo: 1007): 1007
(nodo: "cbc:ID/schemeID" valor: "0")'

Some observations on how the issue occurs:
Interestingly, when you create a new company or partner using the UI,
the `l10n_latam_identification_type_id` is automatically set to 'RUC'.
This is ensured by the `ResCompany.create()` and
`ResPartner._onchange_country()` methods, see
https://github.com/odoo/odoo/blob/f84dbf63b9354a3c577589178a09c3ffb151cba3/addons/l10n_latam_base/models/res_company.py#L10 and
https://github.com/odoo/odoo/blob/f84dbf63b9354a3c577589178a09c3ffb151cba3/addons/l10n_latam_base/models/res_partner.py#L24

However, when the demo company is created, the `create()` method is
called at the first <field> element, which is `name`, and so,
`create()` does not set `l10n_latam_identification_type_id`.

And because the demo partner is created without the UI, the onchange
is not called when the partner's country is set.

The solution:
Therefore it is necessary to manually set the
`l10n_latam_identification_type_id` in the demo data.

closes odoo/odoo#82920

X-original-commit: 33e174d58e7ad2a5a965f31a23c4b8281fedef79
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
2022-01-17 17:50:29 +00:00
Julien Castiaux 3d7f49b2f5 [IMP] *: Don't override HttpCase.base_url() in tests
HttpCase.base_url() was introduced with ded278b9c2 but many tests were
using the name attribute already. The tests have been adapted to use the
new method.

closes odoo/odoo#82910

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-01-17 16:56:01 +00:00
Victor Feyens 76aec79fd7 [FIX] point_of_sale: wrong field name used in constraint
Wrongly defined in #55525

Fixes #82834

closes odoo/odoo#82907

X-original-commit: 6ece16fbb0ceaced022a2d1b3f0c5769ba827125
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-01-17 15:57:53 +00:00
Paolo (pgi) 9d5eb68dc6 [FIX] l10n_ch: Fix the invoice title's CSS
The title's (S)CSS selector was failing to pick up the invoice title,
because it was inside the .swiss_container_v2 while it should be out of that.

opw-2584899

closes odoo/odoo#80873

Signed-off-by: William André (wan) <wan@odoo.com>
2022-01-17 15:57:46 +00:00
Audric Onockx (auon) acfeac68d5 [FIX] account : apply analytic rule on invoice
Steps:
- Create an Analytic Account AA
- Create an Analytic Default Rule : when Product P > AA
- Create a Quotation including P, confirm and invoice

Issue:
- AA is not set for the invoice line of P

Cause:
- AA is computed on the invoice line when the product is added,
	but it is recomputed afterward from cache, where it is None

Fix:
- Not allow it to be recomputed afterward.

opw-2714340

closes odoo/odoo#82639

X-original-commit: 34b7c834cb67e1dc1f3727f103489e084c4788bf
Signed-off-by: Onockx Audric (auon) <auon@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-01-17 15:00:45 +00:00
Thibault Libioulle 54c5160264 [IMP] website_sale: search tag in product snippet
This commit adds a search on tag in product snippet.

task-2675384

closes odoo/odoo#79296

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-01-17 14:07:46 +00:00
Thibault Libioulle 8011e171ff [IMP] *: add product tag model access
*: mrp,point_of_sale,purchase,sale,stock

This commit adds the product tag model access to accurate manager groups.

task-2675384

Part-of: odoo/odoo#79296
2022-01-17 14:07:46 +00:00
Thibault Libioulle 86353f9582 [IMP] website_sale: handle product tags
This commit handle product tags and adds the ability to easily define
ribbons, coupons or Dynamic Snippet for a given tag.

Purpose
=======

Product tags allow users to define a given coupon/promotion program on
chosen products templates or product variants.
Product tags allow users to easily add a common ribbon on product
templates which shares a tag.
Product tags allow users to easily define a Product Dynamic Snippet to
show product variants which uses the same tag as the current product
template.

task-2675384

Part-of: odoo/odoo#79296
2022-01-17 14:07:45 +00:00
Thibault Libioulle 5b64d252d2 [IMP] product: add product tag model
This commit adds the product tag model.

Purpose
=======

The product tags allows to easily tag given types of product
independently from their category, following their product range, their
seasonal collection, their theme, etc

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

A product template takes tags that are valid for all their variants.
In order to add granularity, product variants can also take additionnal
tags.
A field is defined on product variants to allow searching on both
product template and product variant tags.

task-2675384

Part-of: odoo/odoo#79296
2022-01-17 14:07:45 +00:00
Anh Thao Pham (pta) 244e4cae03 [FIX] mass_mailing: fix preview prepend when sending test email
- Go to Email Marketing and create a new one
- Select any template
- In Settings tab, set a Preview Text
- Send a test
The content of the received test email is a text with the html code of the email body.

When sending the test email, the body is retrieved with "render_field" method, which
does not return a Markup object but a simple string.
Then "_prepend_preview" method prepends preview (Markup) to body (str).

opw-2686316

closes odoo/odoo#82886

X-original-commit: 71258f5020a0d1c4581cf85df31be3fb3f95562a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-17 13:12:26 +00:00
Nicolas Bayet b467e4df8c [FIX] web_editor: remove image toolbar when removing image
Task-2728793

closes odoo/odoo#82881

X-original-commit: 0ff6f919e10388f7fd6d8efbfb0c8f9644b2505e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-17 12:17:31 +00:00
Nicolas Bayet 48045a069b [FIX] web_editor: change fix for scrolling powerbox
The fix to add an `overflow: hidden` in order to prevent the browser
from chaning the scroll create a glitch where the scrollbar dissapear
when it is overflow: hidden.
A new css property exists to specify exactly this behavior
(`overscroll-behavior: contain;`).

Task-2728791

closes odoo/odoo#82880

X-original-commit: 4cfa9e786d41a27d1bc850eff4fc89e1c4b32974
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-17 12:17:28 +00:00
Victor Feyens 515362a044 [FIX] sale_management: lines reset on template change
The removal of existing order lines on template update was unexpectedly
lost in recent code changes.

This commit brings back the old expected behavior.

closes odoo/odoo#82868

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-01-17 12:17:24 +00:00
roen-odoo a4d5999471 [FIX] sale : Show SO with archived customer
Current behavior:
When archiving a customer contact, the SO linked to this customer where not shown after clicking sales smart button in company

Steps to reproduce:
1. App "Contacts": Have a company and a contact as child of this company.
2. App "Sale": Create a Sale Order for the contact of the company and confirm it.
3. App "Contacts": Archive the contact of the company and switch to the company.
4. App "Contacts": The Smart Button for sale orders says it has one sale order but if you click on it NO sale orders will be shown.

opw-2735060

closes odoo/odoo#82796

X-original-commit: f22364c32ac1438ededd611578b64a69186d7c9c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-01-17 12:17:20 +00:00
Florian Charlier 9d36149ed7 [FIX] website_slides: Fix join course link
The "Join course" link with additional resources was broken

Task-2735494

closes odoo/odoo#82804

X-original-commit: f59cbca07aff6107a355009b74b336a2860dfe29
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-17 10:29:57 +00:00
wan 4f3f28ada3 [IMP] account: add index used to open the dashboard
closes odoo/odoo#82807

X-original-commit: 18f03ef60153f593346738cfc09aaf755ba8d761
Signed-off-by: William André (wan) <wan@odoo.com>
2022-01-17 09:31:52 +00:00
wan 172269ee75 [IMP] account: auto_join statements on move_id
The dashboard is using a domain `[('move_id.state', '=', self.id)]`
This impacts the performances because we are not joining explicitely on
`move_id`. We can't use the field `state` because it is re-declared on
`account.bank.statement.line`.

X-original-commit: 8b19f0f981fefc6df7c8298b57619c6b9b0a0890
Part-of: odoo/odoo#82807
2022-01-17 09:31:52 +00:00
Laurent Stukkens (LTU) dca6ffc099 [FIX] project: prevent html editor fixed size
Prior this commit, the description field of both project.project and project.task
were displayed with the resizable bar and were displayed with a calculated height
which prevented to see the whole field.

After this commit, the resizable option is set to false which displays the whole
field content without the resizable bar.

task-2735599

closes odoo/odoo#82818

X-original-commit: 8acdb9e197eb78ceefec444a245b8b7f01e81fdc
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-01-17 08:38:52 +00:00
Yolann Sabaux 3ae25d62bb [FIX] account: adequate template loading at first time
Steps to reproduce:
- install accounting (account_accountant)
- go to invoice
- click on "send and print"
-> template is not loaded directly

Solution:
- revert changes of commit #fc5812c327daab4 since the onchange is now called only once

OPW-2732687

closes odoo/odoo#82805

X-original-commit: fa25a3b2b7cdafbce70e39a8a896924f015185a9
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: yosa-odoo <yosa@odoo.com>
2022-01-17 08:38:49 +00:00
Yolann Sabauxandandro19951 e10ae3f024 [FIX] google_calendar, microsoft_calendar: ignore no partner created
Description of the issue/feature this PR addresses: in version 15,
sometimes Google and Microsoft calendar synchronizations break with error:

Create/update: a mandatory field is not set.
Delete: another model requires the record being deleted. If possible, archive it instead.
Model: Calendar Attendee Information (calendar.attendee), Field: Contact (partner_id)

This is happening, because when Odoo is syncing an event, it will match
attendee with res.partner, if no existing partner is found, a new one
will be created unless:

- the address matches an existing mail alias ([alias_name]@[mail.catchall.domain])
- the address is invalid (eg. in outlook the email address is sometimes
  in the form /o=ExchangeLabs/ou=.../cn=Recipients/cn=...

In this case we should not try to add the attendee to the odoo event.

Current behavior before PR: Error when syncing that the customer can
only solve by removing the erroneous attendee or remove the event from
their calendar.

Desired behavior after PR is merged: if the partner cannot be created
we ignore it.

opw-2670002
opw-2683889
opw-2702661
opw-2704631
opw-2711907
opw-2720032
opw-2722028
closes #82109
fixes #78678

closes odoo/odoo#82667

X-original-commit: 1cd470c8922119d0da0b69ab7d4b4ff746533689
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: yosa-odoo <yosa@odoo.com>
Co-authored-by: andro19951 <andro19951@gmail.com>
2022-01-17 08:38:45 +00:00
Laurent Smet f8ce1c0457 [FIX] account: Fix wrong st line account in pos box
If money is withdrawn, we can't tell if it's a transfert to the bank account or if some money has been withdrawn to pay an invoice or some expense.
We then assign the suspense account in order for the accountant to go through the reconciliation widget process in order to dispatch/assign the amount to the right account(s).
This allows all the accounting process to go smoothly without any needs for the accountant to manually create a miscellaneous entry.

Introduced by:

closes odoo/odoo#82616

Pr: https://github.com/odoo/odoo/pull/82123
Commit: https://github.com/odoo/odoo/commit/336656e0e9677ccb2f43935b6f267fa83ed153df
X-original-commit: 04396e0627fd36d28b047e0e122ffb55a3a12ebc
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-01-17 07:46:58 +00:00
Hubert Van de Walle (huvw) f1f4d81d37 [FIX] web: export empty relational field in xlsx as empty string
Steps to follow

  - Go to the contact app for example
  - Export some records with a relational field in the import-compatible xlsx format
  - Reimport the downloaded file
  - Odoo can't find matching records with a name False

Cause of the issue

  xlsxwriter will write a boolean false value for empty relations

Solution

  If a field is relational, write an empty string instead

opw-2643705

closes odoo/odoo#82803

X-original-commit: 510a498aa71f117975a08ca3d3df6217e3b8a74d
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-01-17 06:42:47 +00:00
Guillaume (gdi)andRomain Derie 8f7c6997e8 [IMP] website: propose a new social media snippet
This commit introduces a new social_media snippet that allows social
networks to be displayed. This snippet shares the same options as the
share snippet, but also provides a list to edit the URLs of the social
networks in the company data (social_facebook, ...). This list also
allows to manage links to custom social networks (which are not stored
in the DB).

Headers and footers now use this new social_media snippet instead of the
share snippet and in the settings, the urls to the DB social networks
are editable/visible only in developer mode.

task-2687447

closes odoo/odoo#80217

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: Guillaume (gdi) <gdi@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
2022-01-16 23:36:46 +00:00
Guillaume (gdi) 3dde03308d [IMP] web_editor, website: add placeholder and undeletable on we-list
This commits introduces new behaviors on the we-list:
1. Possibility to add a placeholder on inputs
2. Possibility to make elements non deletable
3. Possibility to make element activated/toggled by default
4. Possibility to generate ID for new elements

task-2687447

Part-of: odoo/odoo#80217
2022-01-16 23:36:46 +00:00
Olivier Dony c5d8d30faa [FIX] base: add missing _name for MockIrQWeb
Fixup for #82838, which could cause the following crash when creating a
new database from the DB manager UI, but not from the command-line:

```
Traceback (most recent call last):
  File "/home/odoo/15.0/odoo/service/db.py", line 63, in _initialize_db
    registry = odoo.modules.registry.Registry.new(db_name, demo, None, update_module=True)
  File "/home/odoo/15.0/odoo/modules/registry.py", line 87, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/home/odoo/15.0/odoo/modules/loading.py", line 415, in load_modules
    loaded_modules, processed_modules = load_module_graph(
  File "/home/odoo/15.0/odoo/modules/loading.py", line 199, in load_module_graph
    registry.init_models(cr, model_names, {'module': package.name}, new_install)
  File "/home/odoo/15.0/odoo/modules/registry.py", line 427, in init_models
    model._auto_init()
  File "/home/odoo/15.0/odoo/models.py", line 2795, in _auto_init
    raise_on_invalid_object_name(self._name)
  File "/home/odoo/15.0/odoo/models.py", line 104, in raise_on_invalid_object_name
    raise ValueError(msg)
ValueError: The _name attribute MockIrQWeb is not valid.
```

Not visible on runbot as it does not use the DB manager for creating
databases.

Fixes #82843

closes odoo/odoo#82853

X-original-commit: c0da3aa4812dc7be4f7ce94d771e44d093d4f612
Signed-off-by: Olivier Dony <odo@odoo.com>
2022-01-16 22:38:03 +00:00
Olivier Dony 1b8fa102e9 [FIX] base: render db manager w/ qweb and no db
Due to #82724 and 8ec7739dd72fa0976697f7738b225dbb9efa7c97,
the qweb renderer can't be used directly, however there is no way to use
the proper ir.qweb one without a database.

This is necessary for the /web/database/ routes (db manager) which work
without a database, and require qweb rendering since the abandon of
jinja rendering in v15.

This patch builds on the preparation work of the qweb/ir_qweb merge in #81024
which introduces a limited helper `render()` method in ir_qweb so that
it can be used statically without a database.

Fixes #82835

closes odoo/odoo#82841

X-original-commit: 3014e922b48696fb9aba4b477ebe1878dd01bb69
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Olivier Dony <odo@odoo.com>
2022-01-16 20:39:47 +00:00
Benoit Socias 48a60fe268 [FIX] web_editor: discard background positioning when clicking outside
Since [1] options could still be used while a background positioning
overlay was opened.

After this commit the overlay is deactivated whenever an element outside
of it is clicked - as initially intended.

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

task-2735690

closes odoo/odoo#82824

X-original-commit: 574ae49acb950d99ef4ab2b0504cfd7f39bca406
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-01-16 16:48:50 +00:00
Martin Trigaux 9c16f38fd5 [FIX] microsoft_calendar: use recent dates
Test was failing since 2022-01-16, probably a max 2 years sync

FAIL: TestSyncOdoo2Microsoft.test_restart_synchronization
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/mock.py", line 1325, in patched
    return func(*newargs, **newkeywargs)
  File "/data/build/odoo/addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py", line 21, in patched
    return func(self, *args, **kwargs)
  File "/data/build/odoo/addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py", line 84, in test_restart_synchronization
    self.assertMicrosoftEventPatched(event.microsoft_id, {
  File "/data/build/odoo/addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py", line 40, in assertMicrosoftEventPatched
    MicrosoftSync._microsoft_patch.assert_called_once()
  File "/usr/lib/python3.8/unittest/mock.py", line 892, in assert_called_once
    raise AssertionError(msg)
AssertionError: Expected 'mock' to have been called once. Called 0 times.
Calls: [call._constrains(calendar.event(2049,)),
 call._constrains().__iter__(),
 call._constrains().__len__()].

closes odoo/odoo#82849

X-original-commit: 86911c4e9b9f86f3b9a5625b973e78103a7b0286
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-16 12:33:08 +00:00
David Monjoie 2a0298434f [REV] web: revert ensure scrollbar in mail designer
This reverts commit 247adbb3aa79223c18083caf31e6580905ce32e8 as it broke
the website design. We do not know yet what the reason is and we'll need
to investigate further. Probably a css specifity issue, but since this
is 15.0 stable, we chose to first revert the commit asap and re-do the
fix in another way later.

closes odoo/odoo#82823

X-original-commit: 3c8409d946e549a3d3f104b9417257b5dc7cf0c8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 19:15:20 +00:00
Touati Djamel (otd) 4f0dd2271a [FIX] purchase_stock: fix system parameter access right
You are blocked with an access error when you try to replenish a product with `”Buy”` route if you don't have the settings rights,
because the code tries to read a system parameter.

Solution:
To avoid this error, we need to read it as superuser.

opw-2725702

closes odoo/odoo#82814

X-original-commit: dff238959f46708b68cda4b03f8f6981f7245ee7
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2022-01-14 18:24:04 +00:00
Victor Feyens c541359187 [FIX] sale_quotation_builder: wrong/missing depends on compute methods
closes odoo/odoo#82806

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-01-14 17:29:35 +00:00
Nicolas Bayet d3b328358f [FIX] web_editor: prevent editor powerbox hint duplication
Whenever the browser is lagging between multiple enter,
the command hints were not being updated until the browser
main thread process the event queue.

Task-2728794

closes odoo/odoo#82795

X-original-commit: bfed1edd26312488dc0f45e8982b51ea4d98db76
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 16:37:54 +00:00
6367a89332 [FIX] core: import of o2m with recursive xml declaration
Let's imagine this data

```xml
<record model="my.model" id="1">
    <field name="name">parent</field>
    <field name="children_ids">
	<record model="my.model" id="1.1">
	    <field name="name">child</field>
	</record>
    </field>
</record>
```

Loading this data the first time, everything works fine.
But if we update it, this is what happens:
* load `my.model,1`: write on `name=parent` and `children_ids=None`
* load `my.model,1.1`: write on `name=child` and `parent_id=my.model,1`

The write on `children_ids=None` can unlink all the children if the
field is declared as `ondelete=cascade`
That will leade in all the records to be deleted and recreated, but
without keeping links with other documents.

For instance, when upgrading the `account` module, all the
`account.account.tag` are removed from `account.move.line` because when
the `account.tax.report.line` are updated, all the tags are deleted and
recreated.

closes odoo/odoo#82793

X-original-commit: de00316fa42173f3a5c394458bb4418e59e298cd
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: rco-odoo <rco@odoo.com>
Co-authored-by: jva-odoo <jva@odoo.com>
Co-authored-by: william-andre <wan@odoo.com>
2022-01-14 16:37:50 +00:00
Thibault Delavallée 93c226be41 [REF] website_crm_partner_assign: change conflicting method naming
``get_portal_url`` is already used in portal mixin. As we are in a side
module doing things not really related to portal mixin let us inline it
directly as it is used only once anyway. Indeed this method does not give
any portal url just a base url with a db parameter, used afterwards to let
people connect to the db.

Task-2712450 (Mail/Sale: Improve 'Pay Now' notification template)

closes odoo/odoo#82627

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-14 16:37:46 +00:00
Thibault Delavallée e7b40e783a [FIX] sale: clean unnecessary portal/access code
Override of ``get_access_action`` in sale_management is useless. Indeed
it redirects to the portal when

  * there is an order template;
  * user is share OR force_website is in context;

This override calls ``get_portal_url``. This method basically crafts link like
``access_url?access_token=TOKEN`` as no other argument is given to portal
url computation method.

Using the standard ``get_access_action`` gives the same result. When having
read rights on the record (which is implied for current code), portal override
already calls ``_get_share_url``. Moreover portal version effectively checks
requested access_uid has read access while current override uses current user
which may lead to strange results depending on call chain.

Removing this kind of override simplifies management of notification emails
and buttons, especially that "Pay Now" template is about to be cleaned.

This notably partially reverts odoo/odoo@b49da62365 and some other commits. Those
are anyway linked to mails sent when sale did not have its portal available
directly from sale as portal was a side module. Website quote was adding its
own portal-related logic (accept and pay). All this is now standard in sale
and it makes sense to use standard ``get_access_action`` code when possible.

Task-2712450 (Mail/Sale: Improve 'Pay Now' notification template)

Part-of: odoo/odoo#82627
2022-01-14 16:37:46 +00:00
Thibault Delavallée 139e900276 [FIX] purchase: fix inherit order of portal and mail thread
Having portal inherit added after mail thread prevent from really entering
portal overrides of mail.thread methods due to Odoo LRU implementation of
inherit. Notably group computation for email is not called in portal. This
means notably access tokens are not always available in notification emails.

Task-2712450 (Mail/Sale: Improve 'Pay Now' notification template)

Part-of: odoo/odoo#82627
2022-01-14 16:37:46 +00:00