Commit Graph
147741 Commits
Author SHA1 Message Date
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
Thibault Delavallée 6aa3a88190 [FIX] portal, various: give access to portal in customer emails by default
Records inheriting from portal mixin implement their own access to portal
using tokens. Activating the access button by default seems the right thing
to do instead of having to do it manually in each addon. Access is granted
at record level using tokens and access URLs anyway.

This eases future improvements of "Pay Now" notification template as it
will use the ``has_access_button`` instead of doing custom computation
directly in the template itself.

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

Part-of: odoo/odoo#82627
2022-01-14 16:37:45 +00:00
std-odoo 58514beab0 [FIX] base: enforce the usage of ir.qweb instead of qweb
Purpose
=======
Clarify that qweb should be used as <ir.qweb> when the latter is
available. <ir.qweb> version is a an optimized version of QWeb rendering
and using it is better for performance and daily usage. Moreover it used
Odoo model instead of standard python class, that's why we do not want
people to use QWeb instead of <ir.qweb>.

Task-2709589

closes odoo/odoo#82781

X-original-commit: b08f475e34ccd6e0417374953c11728efad07402
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-14 15:45:02 +00:00
Florian Charlier da57d82c45 [FIX] website_slides: Fix lesson fullscreen template
A variable was inadvertently renamed which broke the fullscreen rendering of
lessons with links.

Task-2735020
Introduced in 63285ce0, part of odoo/odoo#75646

closes odoo/odoo#82780

X-original-commit: ac0b58975442b3ea0a86f2993234c3946b20a01d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-14 15:44:57 +00:00
xmo-odoo 44e7a693f0 [IMP] flake8 base config
The usage of `select=RST` apparently broke all local flake8 uses (which might
be implicit e.g. used for linting in the simpler editors). Always excluding
"addons" probably causes a similar problem.

Remove the exclusion of "addons", and use "extend-select" for the selection of
RST errors. This should play better with local configuration, or the lack of
configuration (thus flake8 defaults). This means the exclusion of addons and
the "blanking" of the default errors selection will have to be done in the CI 
configuration, but that probably makes sense.

closes odoo/odoo#82650

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-01-14 15:44:52 +00:00
thcl-odoo d826b0ac7a [FIX] payment: allow the user to archive the tokens he sees
Expected behavior :
User should be able to archive the tokens he sees

Current behavior :
User sees his tokens but cannot archive a token from another company

Steps to reproduce :
- Install Sales & Contacts
- Create a 2nd Company
- Enable `Online Payments`
- Setup a Payment Acquirer (Test Mode for current company) *Be sure to have `Allow Saving Payment Methods` checked*
- Create a new contact and grant him portal access

*With new contact*
- Get the link and set a password
- Create a new payment method in `Manage payment methods`

*With admin again*
- Replace `Allowed Companies` and `Default Company` for the new contact by the company created before

*With new contact*
- Go back in `Manage payment methods` and try to delete the token

Reason :
Before, the `write` method from the model was called but returned an AccessError because the token was linked to another company.
Now a custom route is called, it checks if the token is linked to the user and archives it with the necessary rights

OPW-2660186

closes odoo/odoo#82405

X-original-commit: 19f8c4e26291740edecd0c101c3d331deef2758d
Signed-off-by: Claude Thibault (thcl) <thcl@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-01-14 15:44:48 +00:00
Antoine Guenet 449f8f3220 [FIX] web: ensure scrollbar in mail designer
Commit [1] moved the scrollbar from the document body to the top
element (#wrapwrap). This works for website builder but fails for
iframes which don't have that element. This is apparent in Marketing
Automation mail templates where it's become impossible to scroll down.
This fixes that issue by excluding iframes in that rule.

task-2734825

[1] https://github.com/odoo/odoo/commit/9f048625e11dacda9fd49694e89ae65bc112374f

closes odoo/odoo#82777

X-original-commit: 95f280c4032a7358deeedae1cb6f63beab70387b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 14:50:00 +00:00
Merlin (megu) 299fd2d9a8 [FIX] l10n_it_stock_ddt: translate DDT report
DDT report was not translated in the user's language

Steps to reproduce:
1. Install the module l10n_it_stock_ddt
2. Open 'DDT report' in Setting -> Technical -> Reporting -> Reports and add to the print menu
3. Install the 'Italian / Italiano' language and set it as a customer's language
4. Create a sale order for that customer and confirm it
5. Open its delivery order
6. Print the 'DDT report'
7. The report is in English instead of in Italian

Solution:
Add a translation file for the report and render the report in the partner's language or the user's language if there is no partner

OPW-2697213

closes odoo/odoo#82774

X-original-commit: c812adcd67554e00c32e15ad985fc28cb62867d6
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-01-14 14:49:57 +00:00
Florian Charlier 84ad766047 [IMP] survey: Improve UI of results statistics
PURPOSE
Various improvements of the results' statistics were required, mainly regarding
* the filtering features that were not clear and impractical
* the way answer scores was reported
* the vertical space taken by questions never answered

Among other smaller changes, the layout of `datetime`-answers questions is
harmonized with the other answer-types (grouped by value), considering that
the "time" part is important and that the "seconds" part bof that time would
only be changed if it is relevant to the question.

SPECIFICATIONS
**Filters**
It is now more convenient to filter surveys based on:
- Whether they are fully completed
- Whether they are passed
- Whether they are failed (last 2 are mutually exclusive, and only available
for scored tests)

A badge is added to show the number of surveys that match each filter option
if chosen. Note that this simple implementation does not allow to show the
number of surveys which would be displayed if the filter was removed, or
replaced, so the badges are not shown once a filter is selected.

The question/answer filters can now be removed individually.
The i.fa-filter elements used to activate them are now always visible, and are
only available for answers that have been selected at least once.

**Scoring**
Scores are added in tables next to the answers instead of as additional lines
below the question caption.

Right answers are now marked in the Graph and Data tabs instead of being simply
listed under the question.

**Unanswered questions**
To make this special case more clear to the user, a discrete alert is added
below the question. The Graph and Table tabs are removed in this case, as they
contain no information. For Multiple choice and Matrix questions, the Table tab
stays visible to show the possible answers available.

*Misc*
To follow common representation, numbers which are equal to integer values will
show as integers in answers and scores (e.g., 30.0 will show as 30), using a
sub-template.

Distinguishing the questions and results from the previous/next ones was
difficult, hence the added margins and discrete lines.

Similarly to other fields, datetime results now display one line per answer
value, with its occurrence.

Stylesheets are cleaned up.

LINKS
Task-2618399

closes odoo/odoo#77522

Related: odoo/upgrade#3168
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-14 13:53:56 +00:00
Laurent Stukkens (LTU) 601a7d98f2 [FIX] project: allow parent task being a subtask in task form
Before this commit:

    - From the task form, it was not possible to select a parent task
      that is itself a subtask and thus creating multiple level of
      subtasks.

After this commit:

    - From the task form, it will be possible to select a parent task
      that is itself a subtask and thus creating multiple level of
      subtasks.

task-2703632

closes odoo/odoo#82769

X-original-commit: 8ccec8c873d3c4fb4445ab3489d1ee6cbddea3de
Signed-off-by: Xavier <xbo@odoo.com>
2022-01-14 13:06:03 +00:00
Graeme Gellatly a1cb05feaf [FIX] mrp: Remove name field defined twice in workorder tree view
In mrp_production_workorder_tree_editable_view the name field is defined twice, once invisible. This makes inheritance more difficult than it needs to be. After this commit, the first invisible name field is removed, leaving it defined only once.

closes odoo/odoo#82765

X-original-commit: 33b34d05a1ddcb0ab51c1b457b5bbca92e5eb89b
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-01-14 13:05:59 +00:00
Alexandre Kühn 0970b1fad6 [IMP] mail: remove comp t-ref on components ChatWindow/MessageList
In preparation to use OWL 2 in discuss code.

Task-2694206

closes odoo/odoo#82031

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-14 13:05:55 +00:00
Victor Feyens 5033f5cb68 [FIX] sale_management: wrong usage of self in loop
closes odoo/odoo#81818

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-01-14 12:11:48 +00:00
Victor Feyens ee67846401 [IMP] sale: harmonize states attrs
Part-of: odoo/odoo#81818
2022-01-14 12:11:48 +00:00
Victor Feyens e1e3c4e6e0 [FIX][IMP] sale_quotation_builder: convert to computes
Part-of: odoo/odoo#81818
2022-01-14 12:11:48 +00:00
Victor Feyens 9624577a0f [FIX] sale_*: do not (re)compute useless things on module install
Part-of: odoo/odoo#81818
2022-01-14 12:11:47 +00:00
Victor Feyens 6a3bcee0a6 [IMP] sale_quotation_builder: convert onchanges/creates to computes
Harmonize backend & frontend behaviors

Avoid the overhead and additional stacktrace depth of write/create 
overrides

Ligth cleanup of the fields & code as well.

Part-of: odoo/odoo#81818
2022-01-14 12:11:47 +00:00
Victor Feyens 74e13888ee [IMP] sale_management: convert onchanges/defaults to computes + cleanup
* onchanges/defaults conversion

Harmonize frontend and backend behaviors
Delegate price computation to sale computes

* multi-company fixes

Do not allow adding a product restricted to a company to a
quotation template shared between companies.
  Remove old onchange updating template company when such a product was added
  Update product_id field domains accordingly

* cleanups

Clean fields (ordering, attributes, ...)
Clean methods order following odoo guidelines
Remove useless class reference in super calls
Make onchange methods private (_onchange_sale_order_template_id)

Part-of: odoo/odoo#81818
2022-01-14 12:11:46 +00:00
Victor Feyens 97c63af7b1 [IMP] sale: convert defaults to computes
* make sure company based values are correctly updated when the company
is changed
* Also use context_today instead of now since validity_date is a date,
and not a datetime

Part-of: odoo/odoo#81818
2022-01-14 12:11:46 +00:00
Aaron Bohy 17b8539971 [IMP] web: replace unnecessary t-raw by t-esc
closes odoo/odoo#82755

Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-01-14 11:15:21 +00:00
luvi da8ff3d087 [IMP] web: t-ref instead of this.el in the CommandPalette
The commit adapts the CommandPalette to use a t-ref to a node
in the template instead of a this.el.querySelector("...") in
the component to query an element. This will improve the
compatibility with Owl 2.

closes odoo/odoo#82752

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-01-14 11:15:18 +00:00
Antoine Guenet dc17e84778 [IMP] web_editor: prevent icon and text tools in stars widget
When clicking, double clicking or triple clicking in the stars widget of
the Powerbox, we don't want to see the regular options of icons or text.
This prevents them from showing.

task-2575449

closes odoo/odoo#81920

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 10:21:31 +00:00
Antoine Guenet d6688ca759 [ADD] web_editor: allow rating with stars in readonly fields
Similar to checklists, this allows the user to click the powerbox stars
widget even in readonly mode, so as to change a rating without going in
edit mode.

task-2575449

Part-of: odoo/odoo#81920
2022-01-14 10:21:30 +00:00
Antoine Guenet 199874c963 [REF] web_editor: change field html widget to modern module
This adapts the html field widget so it uses the modern import system
rather than the old `require`.

Part-of: odoo/odoo#81920
2022-01-14 10:21:30 +00:00
Antoine Guenet 41e98ccbe4 [FIX] web_editor: check/uncheck checkboxes in readonly fields
When a checklist is present in an html field, there is a feature that
allows us to check/uncheck its boxes without going through edit mode.
That feature was broken due to a dead callback in wysiwyg.js, which is
hereby restored.
Meanwhile, the behaviour of checklists had changed but the python code
handling the readonly checking/unchecking hadn't so this brings it up to
date[1].
Finally, the code managing checklist ids was unnecessarily complicated
as it was trying to keep the ids consecutive for no particular reason.
This refactors it to simply use unique ids based on date stamps.

[1] It used to be that checking a box checked all the children of that
box but it was in the meantime decided not to do that anymore.

Part-of: odoo/odoo#81920
2022-01-14 10:21:30 +00:00
Antoine Guenet 8266b978e1 [ADD] web_editor: two new powerbox widgets to rate with 3 or 5 stars
This adds two new widgets to the powerbox, which allow the user to
quickly insert 3 or 5 stars, then click on them to color them gold.

task-2575449

Part-of: odoo/odoo#81920
2022-01-14 10:21:29 +00:00
Nicolas Bayet 89c215983b [REF] web_editor: remove dead code
closes odoo/odoo#82742

X-original-commit: a101ead524148825c99a4032a50138140527365a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 09:25:50 +00:00
Juan Jose Scarafia cbfaa94e8f [FIX] l10n_ar: vat inclusion on invoice report
Prior to this commit the line amounts on the invoice report where including the VAT always. With this change we only include VAT if invoice needs to include it (_l10n_ar_include_vat)

closes odoo/odoo#82740

X-original-commit: 47996fdd4e8c79f876d669f73b18c6046a83c95e
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-01-14 09:25:46 +00:00
Nicolas Bayet f4b76e99ef [FIX] web_editor, mass_mailing: create link in new tab
In mass_mailing, creating a link from the linktool in mass mailing
generated link that would not create a new tab when clicked.

Task-2734760

closes odoo/odoo#82735

X-original-commit: c6b7556a35182174c3384c2069256826205bba22
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 09:25:42 +00:00
luvi 741b79cfcc [IMP] web: trim keywords in the search bar
When the search field is used to query an element, the value is
trimmed to remove unnecessary spaces before and after the actual
keywords. This eliminates the annoyance of a search having no
result because of a space that was left (for example when copy-
pasting some text). A test has been added to check if a value
has been trimmed when the text input contains spaces.

closes odoo/odoo#82193

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-14 07:47:08 +00:00
Didier (did) 493908f7d0 [IMP] mail: remove the file uploader component
Before this PR the only purpose of the file_uploader component was to inject a
`<input type="file">` inside the DOM.
We can now create this input directly inside the FileUploader model without
register a component.

task-2727815

closes odoo/odoo#82213

Related: odoo/enterprise#23261
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-01-13 19:04:53 +00:00
Odoo's Mergebot 45e5aca8e5 [FW][FIX] l10n_ar: demo install together with sale_timesheet
Create a demo database installing l10n_ar and sale_timesheet, something like: `odoo -i l10n_ar,sale_timesheet`

Current behavior:
We get the error
`- 'Hotel Accommodation' belongs to company 'YourCompany' and 'Partner' (partner_id: 'YourCompany, Marc Demo') belongs to another company.
`

Desired behavior:
Everything fine.
There is no need to set company_id = responsable inscripto for partner demo and admin

closes odoo/odoo#82737

Forward-port-of: odoo/odoo#80489
Signed-off-by: William André (wan) <wan@odoo.com>
2022-01-13 19:15:48 +01:00
Juan Jose Scarafia 2362d04586 [REM] l10n_ar: change of company_id on root user
Changing company_id on root user was not a good idea. We make all the changes needed to make it work without that change.

X-original-commit: 9d4145da94284b9346d4fd5bec2dd35143ec1ba7
Part-of: odoo/odoo#82737
2022-01-13 18:15:47 +00:00
Juan Jose Scarafia 82293606ad [FIX] l10n_ar: demo install together with sale_timesheet
X-original-commit: f6c0a8be17400035726388e3a6070a415f31e471
Part-of: odoo/odoo#82737
2022-01-13 18:15:47 +00:00