Commit Graph
143436 Commits
Author SHA1 Message Date
oco-odoo d9c97e8cd1 [REM] l10n_ch_qr_iban: merge module into l10n_ch
This module had been introduced in stable to add a field to store the QR-IBAN in case it differed from the regular account number. We now merge it into the original module and make it so that the only way to define a QR-IBAN is to populate this field (no more magic with account number).
2021-04-01 17:06:11 +00:00
std-odoo ab179fb600 [FIX] mail_plugin: avoid repeating company creation
Purpose
=======
Avoid creating / enriching multiple time the same company.

It can occur in many situation; when IAP do not return an email address
the the company, when the domain is blacklisted...

We also want to remove the field "iap_enrich_info" from the res.partner
model because this field can be heavy (JSON field) and the res.partner
model is used a lot.

Technical
=========
For this purpose, we create a new model <res.partner.iap> which will
store the IAP response and the requested domain.

So we can retrieve the previously enriched company regardless of the
partner's values

Task 2466653
See odoo/odoo/pull/68286
See odoo/upgrade/pull/2301

closes odoo/odoo#68286

Related: odoo/upgrade#2301
Related: odoo/enterprise#17426
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-01 14:23:07 +00:00
Tymoteusz Motylewski f1ea45c402 [IMP] doc: add missing command line options
- fixes some typos
- adds command parameters which are present when running odo-bin --help
- updates some descriptions, e.g. regarding configuration file and data-dir

closes odoo/odoo#67778

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-04-01 15:48:47 +00:00
Nicolas (vin) 8b0804772f [IMP] l10n_be: Hide sum from the header lines in the tax report
The sum on the header lines of the Belgian tax report are unnecessary,
this will make sure that they do not appear anymore.

task id #2271978

closes odoo/odoo#58523

Related: odoo/upgrade#1895
Related: odoo/enterprise#13230
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-04-01 14:57:33 +00:00
Nicolas (vin) 39d6e3d8c0 [IMP] account_reports: allow to carry over lines between periods
In belgian accounting, some tax lines in the tax report must be carried
over to the next period if they are negative.

If the balance for the next period is positive, it will be deduced by
the maximum possible amount that is carried over. If it is negative,
the negative balance will simply be added to the carried over balance.

This process repeats itself from one period to the other endlessly,
until the carried over balance come back to 0.

This is done by putting the carried over balance in dedicated analytic
accounts.

task id #2271978
2021-04-01 14:57:33 +00:00
Thibault Libioulle 9e3ca57dfc [FIX] project: keep create enabled in dependent task
Prior to this commit:

Once the user clicked on View Task in the "Blocked By" task list, the
Create button in the form view of the targetted task is hidden. Also,
in the subtask notebook the user is not able to create additionnal
subtasks.

Reason:

In the action, the create argument is set to False.

After this commit:

We merge the two action_open_task and action_open_task_form into a
unique one. We remove the create set to false.

Related PR : #66740

closes odoo/odoo#68652

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-04-01 14:10:39 +00:00
Julien Mougenot 38561b9c97 [FIX] doc: Clean Assets Management documentation
A few changes to the layout and texts of the "Assets Management" part of
the javascript reference documentation.

closes odoo/odoo#68649

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-04-01 13:53:44 +00:00
93e88da2e6 [ADD] web_editor: introduce Odoo Editor wysiwyg rte library
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
Co-authored-by: Fabien Pinckaers <fp@odoo.com>
Co-authored-by: Quentin Smetz <qsm@odoo.com>
2021-04-01 12:49:47 +00:00
27166ff9df [REM] web_editor, website: remove Summernote wysiwyg rte library
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 12:49:47 +00:00
Thibault Libioulle b83dcc7231 [FIX] project: fix display_project_id initialization
Prior to this commit:

1) The display_project_id was not set if user created a task from the
form view.
2) The project_id followed the display_project_id once the
parent_id and display_project_id was modified and set to False

Reason:

1) The display_project_id was set to False in the vals and not overriden in
the create method.
2) The project_id always followed the display_project_id if the
display_project_id was modified.

After this commit:

1) The display_project_id follows the project_id if the task has no
parent_id.
The project_id follows the display_project_id if the task has a
display_project_id defined and a parent_id.
2) The display_project_id always follows its project_id if it has no
parent_id
The project_id always follows the display_project_id if set or the
parent_id.project_id if not and is changed only when the
display_project_id is modified.

task-2497080

closes odoo/odoo#68647

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-04-01 12:34:40 +00:00
Laurent Smet 6db346767e [ADD] account_edi_ubl_bis3,l10n_nl_edi : added bis3 and nlcius formats
closes odoo/odoo#68514

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-04-01 14:58:20 +00:00
Laurent Smet b58810a77b [IMP] account_edi(_*): Standalone UBL format + edi.format inheritance
task: 2361217
2021-04-01 14:58:20 +00:00
Benoit Socias c1e84bd08d [FIX] website_blog: fit the size of the Dexter effect darkening area
Before this commit the darkening area of the Dexter effect is visible
through the rounded corners when the blog post was not hovered.

After this commit the darkening area is moved inside the right element
thus not requiring magic numbers for truncating the area and fixing the
display of the darkening area behind the rounded corners.

closes odoo/odoo#68640

X-original-commit: f08e6e02cda9080d39f3a81fb83853df917f9ebc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-01 13:09:57 +00:00
Laurent Smet 3e1d81429b [REM] account: Remove on-the-fly payments when reconciling the statement line
This option is there because it was needed by the Mexican EDI to send payments to the government.
Since the refactoring made at revision:
https://github.com/odoo/enterprise/commit/1ccb480b8e95f5702b6fb4e01446d24107514550
... this feature is no longer needed.

closes odoo/odoo#68020

Signed-off-by: William André (wan) <wan@odoo.com>
2021-03-17 13:43:15 +00:00
Laurent Smet 8992955db2 [REM] account: Remove deprecated code since https://github.com/odoo/odoo/commit/8f5e137df71f83f9baa8886aedfd123f329841d7 2021-03-17 11:06:29 +00:00
Sunil Shrimali b5b2b55ddd [IMP] event: prevent copying kanban_state and stage_id
Currently, when duplicating an event, it also copies the stage_id and
kanban_state, which should be set to their respective default values.

This commit improves the behavior and sets the default values for
stage_id and kanban_state while duplicating an event.

taskID-2463576
COM PR odoo/odoo#67633

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-01 13:37:09 +00:00
Sunil Shrimali a1050eb6a1 [IMP] website_event: improve design for confirmed registration page
This commit improves the following behavior:

 * Truncates long names/emails (with ellipses) to avoid
   overlapping
 * Aligns the start and end dates with bootstrap grid structure
 * Where Phone number is not provided, removes phone icons and
   N/A
 * When there is no ticket, instead of displaying 'N/A', simply
   provide ID of the attendee as a reference (like 'Ref: 10')

taskID-2463576
COM PR odoo/odoo#67633
2021-04-01 13:36:51 +00:00
Laurent Smet c9f9f859ca [IMP] account_edi: Replace high velocity CRON by CRON triggers
So, instead of waiting for the cron every hour, we create
a cron trigger, which is created/activated every time
we post/cancel an invoice.  When the CRON worker is available,
it can take the job immediately.

To be sure that we don't miss any crons or that events
might be needed that are not triggered, we still launch the
cron every day.

A test was added to check that the crons are correctly
triggered.

closes odoo/odoo#67088

Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-04-01 13:55:48 +00:00
Hardik Prajapati 7faa4c3bc6 [IMP] web: display nocontenthelp message in graph view
Currently, graph view display the blank chart when the
sample data is set and the noContentHelp message is empty.

so in this commit, graph view display the sample data with
noContentHelp message even if the noContentHelp message is empty.

TaskID-2347554

closes odoo/odoo#62153

Related: odoo/enterprise#14840
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-04-01 09:46:47 +00:00
Goffin Simon d4e96e3362 [FIX] l10n_it_edi: Error when adding a note on invoice lines
Steps to reproduce the bug:

- Install l10n_it_edi
- Let's consider an italian company C with l10n_it xhart of accounts
- Create a customer invoice I in C and add a line with a price and a tax
- Add a note line
- Confirm I

Bug:

This UserError was raised: You must select one and only one tax by line.

opw:2484338

closes odoo/odoo#68609

X-original-commit: 49cf25fcc80ec2cb8ba3b3473c7c8d31533e2037
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-03-31 15:00:25 +00:00
oco-odoo 17610e8ca9 [IMP] account, account_edi, l10n_*, purchase, sale: Generalize the use of account_fiscal_country_id
Before, account_fiscal_country_id was only use for tax operations; and country_id was used for all the other accounting stuff. Now, with the new ability to use foreign tax reports (with foreign VAT fiscal positions), we can generalize the fiscal country, sot that it is the one that needs to be used for the whole accounting. Since foreign tax reports were not supported before, account_fiscal_country_id is already set on existing database as the country for the "main" accounting, so the impact of this change is small.

closes odoo/odoo#68349

Related: odoo/upgrade#2322
Related: odoo/enterprise#17299
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-04-01 12:09:20 +00:00
oco-odoo 7922e5d102 [IMP] l10n_*: set newly-introduced country_id field on chart templates 2021-04-01 12:09:20 +00:00
oco-odoo 7d678cc7f4 [IMP] account: introduce foreign VAT fiscal positions
Such fiscal positions define an alternate VAT for a specific region. When foreign_vat is set, a country must be set on the fiscal position; it'll be used to know for which tax report the fiscal position must be available as an alternate VAT (in the tax report; see enterprise branch). Note that it is possible to defined several foreign VATs for the same country, as long as they belong to different states within that country.

Note that this new feature is only for FOREIGN stuff; so, when you have to submit a tax report in different regions than yours. For example if you have a Belgian accounting, have French customers, and have a French VAT in addition to your Belgian VAT, to submit a tax report in France. For domestic operations, simply use your the vat field of your company, just like before.

[IMP] account: add country_id on taxes and filter them on invoices

The invoices now compute the country from which they should accept the taxes: it's either the one defined by fiscal_position_id.country_id (if fiscal_position_id is a foreign VAT fiscal position, i.e. it defines a foreign_vat value), or the company's account_fiscal_country_id.

Taxes from other countries are filtered from the view; we don't want them to be available there. There is also a constraint ensuring that. Same goes for tax repartition lines and tags from other countries.

We don't want to mix taxes, tags and foreign VAT fiscal positions from different countries, as it would break the tax report in enterprise. Doing this ensures the tax report can efficiently discriminate the move lines between the different regions whose report they have to appear in.

[IMP] account: add country_id to account.chart.template

This is done so that the taxes are created in the right country, and the fiscal country is initialized in a consistent way when instantiating the CoA on the company.

[IMP] account: print foreign VAT on invoice instead of company VAT if one is defined

[IMP] web: allow forcing company vat on document templates

This is done to allow the use of foreign vat fiscal position on invoices: in that case, we don't want to use the company VAT, but the value of fiscal_position_id.foreign_vat. So, when such a value exists, the invoice simply set the force_vat variable to the right value.

[IMP] base_vat: also validate VAT of foreign VAT fiscal positions

We generalize the code formerly only done for res.partner so that the foreign_vat field of account.fiscal.position can be checked in the same way.
2021-04-01 12:09:20 +00:00
oco-odoo 8a2be06f96 [IMP] account: allow switching CoA even when draft moves have a sequence
Before, we only cheked the name to know whether or not there were moves forbidding the deletion of the whole accounting to replace the CoA. This was too strict, as an accounting with only draft moves couldn't do it if some move had a sequence number (which could happend with moves that were reset to draft). If everything is in draft, we want to allow such deletion.
2021-04-01 12:09:20 +00:00
oco-odoo 7d541b9956 [IMP] account: allow deleting moves that were posted before it they are the last element of the sequence chain
We don't check anymore that a move has been posted before in order to allow its deletion. Instead, we look at its sequence: if it's set and is not at the end of the sequence chain it belongs to, we know removing the move will create a gap, whatever the move state, so we forbid it.

If the user really wants to remove the move anyway, it is possible, by manually emptying the name of the move to delete. This way, he won't have any sequence anymore, and will be deletable. Users should however, rather rely on move cancellations and reversals, just for the sake of a cleaner accounting.
2021-04-01 12:09:20 +00:00
Ivan Yelizariev 5a4e7b711e [FIX] core,account: avoid useless recomputations in res.config
User may use Settings menu just to click "Manage Users" buttons. Such simple
navigation sends ``create`` request, which may trigger a chain of
recomputations. To avoid that we redefine ``create`` method to check if a value
is really changed.

The previous explicit implementation lacks in v14 two fields at least:

* from module `account`
    ```
    qr_code = fields.Boolean(string='Display SEPA QR-code', related='company_id.qr_code', readonly=False)
    ```

* from module `enterprise/account_reports`
    ```
    account_tax_fiscal_country_id = fields.Many2one(string="Fiscal Country", related="company_id.account_tax_fiscal_country_id", readonly=False)
    ```

Performance Tests
=================

In this test we click "Manage users" and check stats for
``res.config.settings/create`` request.

Demo database with eCommerce and Accounting app installed:

```
|        | Number of queries | Query time, sec | Remaining time, sec |
|--------+-------------------+-----------------+---------------------|
| Before |               707 |           0.325 |               0.215 |
| After  |               382 |           0.283 |               0.174 |
```

The same, but with extra 1400 invoices:

```
|        | Number of queries | Query time, sec | Remaining time, sec |
|--------+-------------------+-----------------+---------------------|
| Before |               715 |           0.459 |               0.349 |
| After  |               382 |           0.176 |               0.107 |
```

---

opw-2489335

closes odoo/odoo#68620

X-original-commit: 5e3f37191a4687b305e2337780c7f10278f6a7aa
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-03-31 18:02:08 +00:00
Romain Derie 8fcf930a6b [IMP] web_editor, website, *: introduce popover as edit system for links
*: website_form

This commit introduces a simple & light popover/tooltip (as in Google Doc) when
editing a link.

It will be used:
1. (web_editor) On every page links.
2. (website) In the website navbar, when clicking on a menu, it will replace the
popup shown to ask the user what he wants to do (edit the menu or go to the link
or do nothing). That popup was a bit invasive and old-fashioned.

Part of https://github.com/odoo/odoo/pull/64756
task-2439860

closes odoo/odoo#64756

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-01 09:49:45 +00:00
Romain Derie fe67b34f1a [IMP] website: keep dropdown open when clicked in navbar on edit mode
Before this commit, when a menu inside a dropdown was clicked, the dropdown
would close itself, making the menu impossible to be edited.
That was not really an issue as those menu could still be edited through the
menu editor dialog.

That behavior was already prevented for mega menu in order to be able to edit
them.

This commit adds the same behavior to regular dropdown menu. It is mandatory
for the following commit adding a popover on menu to edit them instead of the
dialog.

Part of https://github.com/odoo/odoo/pull/64756
task-2439860
2021-04-01 09:49:45 +00:00
Romain Derie 9658cc2944 [FIX] website_blog: add missing require
Require to website snippets options was missing.
Indeed, `CoverProperties` is defined in it, but is `include` in website_blog
without requiring it.

Somehow, it was not raising an error on runbot but adding new odoo module
(totally unrelated to CoverProperties or blog) seems to change the order of
import and reveal the issue.

Part of https://github.com/odoo/odoo/pull/64756
2021-04-01 09:49:45 +00:00
Christophe Monniez e42a5342ee [FIX] hr_holidays: fix typo in relativedelta days
In relativedelta, `day` means day of the month and `days` is for number
of days. Today, the demo data failed because the computed `date_to` was
before the `date_from`.

closes odoo/odoo#68632

X-original-commit: 67cb39aa74ae60dd069bf552ed06c878ec643f9c
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-04-01 07:43:08 +00:00
Alexandre Kühn 1874d6e827 [IMP] mail: Attachment viewer header UX on mobile
Task-ID 2200168

closes odoo/odoo#66614

Related: odoo/enterprise#16579
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-03-31 16:53:24 +00:00
Thibault Delavallée 389d74fab3 [IMP] crm: allow team members to opt-out from assign
Purpose is to allow members to quickly opt-out / opt-in from assign
process. For example if for some reason (leaves, too much leads, temporarily
working on something else) a salesperson cannot handle more leads he may
opt-out from assign process.

When member is opt-out, hide assign details from both kanban and form
views. It allows notably to see at a glance who is out and who is in.

Task ID-2494749
COM PR odoo/odoo#68476
UPG PR odoo/upgrade#2318

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-30 14:41:16 +00:00
jbw 5291db731f [IMP] base: correct erroneous "SOD" currency code to "SOS"
The currency code of Somali shilling is corrected from SOD to SOS.

closes odoo/odoo#66707

Task: 2450747
Related: odoo/enterprise#16614
Related: odoo/upgrade#2300
Signed-off-by: William André (wan) <wan@odoo.com>
2021-03-31 14:15:54 +00:00
jbw 32ada4a415 [IMP] base: Currencies configuration
Improves list; kanban and form view for currencies and currency rates.
Add checks to prevent changing/adding rates when accounting entries exists
on dates concerned by those rates.

Task: 2450747
2021-03-31 14:15:54 +00:00
Mohammed ShekhaandMathieu Duckerts-Antoine 3ed1890c7a [IMP] web: use search groupbys in pivot
Before this commit: all groupable fields were offered to selection when
a user would click on a suitable pivot header. While guaranteeing maximal
flexibility, this was easily overwhelming to any new commer.

After this commit: when at least one groupby is defined in the search
arch, the selection is done in the search arch groupbys (plus eventually
some custom groupbys) via a menu similar to the "Group By" menu in the
control panel. The advanced users have still access to more options in a
"Add custom group" menu again as in the control panel. When no groupby
is defined in the search arch, the selection is done among the groupable
fields as before.
This has led to a small modification of control_panel_model_extension.js:
it has become necessary to distinguish the groupBy filters coming from
the arch from those created by the user via the "Add custom group" menu.

Task ID: 2376505

closes odoo/odoo#61572

Related: odoo/enterprise#17341
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-03-31 13:56:38 +00:00
Noe Antoine 26203f194a [IMP] website_crm: propagate logged partner on lead from contact us form
Reduce friction submitting a CRM contact us form while linking the
lead to the portal contact.This facilitates the flow generating leads
from the contact us form.

The partner_id of the lead created from form is set to the one of the
logged visitor if model is crm.lead and there is a logged_visitor and
if the prefilled email and phone number of form match the logged partner's
(otherwise it would change the partner when setting it on lead

In details : there must be an email, the same in input and in partner,
after normalization. Only then:
- If there are both a phone in values and a phone on partner,
  propagate partner on lead only if they are the same.
- Else, that is if there is no phone in partner or no phone in values,
  propagate partner on lead. If no phone in input, it will not propagate.
  on the model. If no phone in partner, then if there is one in input, it
  will write that additional info on partner, completing its profile.

Concerning phone comparison: extending current logic, the numbers are
still formatted before comparison. That is:
- Before this comit, the form value was formatted according to country in
record or geoip. Now, if there is no country_id in record, uses the logged
visitor partner's country or env company country, if there is a logged user.
Finally, it uses session geoip as last option. (changes in _get_country())
- The partner's number is formatted through its model function _phone_format,
according to the partner country (or env company).
- Both formattings are done in international format.

Adds tours to check that partner is linked to lead only if phone and email
are not changed from prefilled data (from logged visitor's partner on form.

Task-ID : 2241639
PR : #61126

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-31 13:23:21 +00:00
Noe Antoine 5e0f7d1e78 [IMP] website_crm : catch logged partner info on contact form
1) Improves user experience by filling contact form with logged partner info.
This facilitates the flow when logged.

The contact us form is filled with data from the partner linked
with logged in web visitor, logged_partner. Its data is used in priority.
Empty fields (e.g. no partner is logged) will be set to default values
in request.params if any. This way, previous behaviour is preserved (as well
as widget correct display behaviour).

2) This commit also adds a star next to the required field Subject in the contact
us form like for the rest of required fields of the form : s_website_form_mark
This improves coherence and clarity when filling the form.

Task-ID : 2241639
PR : #61126
2021-03-31 13:18:07 +00:00
7cfb0e0e74 [MERGE] *: declare assets in manifest, not in xml
This PR changes the way assets are declared in Odoo modules.

Before: assets were declared in template files. Template bundles were
generated from primary templates, so technically any qweb template could
have been called as an asset bundle, with the 't-call-assets' directive.

Being standard qweb templates, they had access to standard HTML tags
(script, link, with or without raw scripts or style definition), qweb
directives (t-call, t-raw, etc.) and could be inherited by other
templates.

Now: assets are defined in the module's manifest and generated by the
't-call-assets' directive.

More information on the new system can be found on the updated user
documentation (see the "JavaScript Reference" section).

closes odoo/odoo#60632

Task: 2352566
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 17:15:51 +02:00
Benjamin Vray 229a731855 [FIX] website_sale: fix product grid tables layout
Before this commit, on the /shop page, tables inside modals (e.g.
modal optional product) were modified by the CSS of the table of the
product grid. After this commit, the CSS is modified to only target
the product grid table.

task-2492086

closes odoo/odoo#68600

X-original-commit: 312e9b60b7f2ffe6f10b9bb7c202cb72e67ac8ab
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-31 13:24:37 +00:00
Benjamin Frantzen (bfr) 90f23b6b5f [IMP] account: remove deprecated method _create_invoice_from_single_attachment
closes odoo/odoo#68596

X-original-commit: 079be25a1d994fa2166c90fa52216498b1b27d37
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-03-31 12:47:57 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
8cc066173d [IMP] *: Improve assets management
This commit changes the way assets are declared in Odoo modules.

Before: assets were declared in template files. Template bundles were
generated from primary templates, so technically any qweb template could
have been called as an asset bundle, with the 't-call-assets' directive.

Being standard qweb templates, they had access to standard HTML tags
(script, link, with or without raw scripts or style definition), qweb
directives (t-call, t-raw, etc.) and could be inherited by other
templates.

Now: assets are defined in the module's manifest and generated by the
't-call-assets' directive.

More information on the new system can be found on the updated user
documentation (see the "JavaScript Reference" section).

Task: 2352566

Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Simon Genin (ges)andJulien Mougenot ee412d2138 [REF] account: remove file from qweb that doesn't exist anymore
This commit removes a template file that was does not exist anymore in
the account module.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Simon Genin (ges)andJulien Mougenot 216b530002 [REF] website: remove priority for assets frontend in portal
This commit removes a needless priority attribute on a portal template.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Julien MougenotandSimon Genin 26dea77c72 [REF] point_of_sale: clean up assets views
This commit handles 2 things:

- The line odoo._modules = <t t-raw="get_modules_order()"/>; used to be in
assets_backend but is now directly added to the web.bootsrap (the odoo
index template). Since pos has its own index, we add it there.

- An "id" attribute has been removed from a link tag which was used to
indentify said link as an xpath target. The xpath has been adapted to
target the href instead.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Julien MougenotandSimon Genin 6b87c77502 [REF] google_recaptcha: Public key in session_info
Before this commit, the recaptcha widget got the database public key
from a qweb "t-set" directive fetching directly the key from the
database when rendering the template.

Now, it is loaded beforehand and given to the session_info instead.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Julien MougenotandSimon Genin a3373db4b8 [REF] mass_mailing: clean up assets views
This commit handles 2 things:

- Clarifies why some inline style has to remain inline instead of being moved
to a separate file.

- Moves an inline modification to field_html for testing purpose to
a dedicated file.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Julien MougenotandSimon Genin 043079d4dd [REF] web_editor: clean up assets views
This commit handles 2 things:

- Moves snippets used to call the summernte library inside several new
dedicated files.

- Removes a raw script declaration to move it to a dedicated file.

Also the calls to the lib files have been changed from a qweb loop to an
explicit list of script tags.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Julien MougenotandSimon Genin ebe86f5ca5 [REF] web,*: Flatten _assets_helpers
Before this commit, the asset bundle "_assets_helpers" was the only
bundle using a "t-raw" directive to insert assets in between other asset
calls.

Now _assets_helpers only contains the assets called before the t-raw
directive, and the second part (1 file actually) has been added after
every call of the bundle.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Julien MougenotandSimon Genin e0efbb08a4 [IMP] web_tour: add tour 'disabled' option
This commit changes the way tours are automatically disabled when in
demo data.

Previously, an override of the assets_common template was applied by a
file loaded in the web_tour demo data, ensuring that the tours are
disabled when demo data are loaded in the database.

Now, a "tour_disable" boolean will be given to the session_info object
to determine whether the tour manager must be disabled, meaning that it
will automatically consume all registered tours.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00