Commit Graph
146859 Commits
Author SHA1 Message Date
Martin Trigaux aa07f93ef7 [IMP] package: update lxml version
Update the version to benefit from the fix for
https://github.com/advisories/GHSA-pgww-xf46-h92r
https://nvd.nist.gov/vuln/detail/CVE-2020-27783

This vulnerability is reproducible in Odoo with
html_sanitize(..., sanitize_tags=False) which does NOT happen for
user-facing content.

Remove old compatibility check (lxml 3.1 was released in 2013)
and cleanup global variables only used once

closes odoo/odoo#64248

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-12-01 14:07:47 +00:00
Bruno Zanotti c80eaa9ddf [IMP] l10n_ar: total amount in letters for MiPyMEs
According to the Argentinean law N° 27440, it is required for MiPyMEs
document types to show in the report the total amount in letters.

closes odoo/odoo#80669

X-original-commit: 9ae95a9a69fd3316b1a217225e8ebacbb51b8fe8
Signed-off-by: William André (wan) <wan@odoo.com>
2021-12-01 11:50:46 +00:00
Paolo (pgi) 10632d8ce3 [FIX] l10n_fr_fec: test wizard must have test_file = True
closes odoo/odoo#80668

X-original-commit: 3ae0b21f4b269859dc41ab6851e2e6e52b6b2e11
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2021-12-01 11:50:42 +00:00
Kevin Baptiste a790a241da [FIX] hr_holidays: fix wrong employee_id fallback
A wrong fallback value was used, the domain is expecting the employee ID
and not the employee record.

closes odoo/odoo#80663

Taskid: 2675380
X-original-commit: 6e68df1a69079bc16888ad588c97f234c9b9fa07
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-01 11:05:14 +00:00
Xavier BOL (xbo) 581056425f [FIX] projet: fix duplicate id in project demo data
Before this commit, 3 xmlid are duplicated, so the result is not
expected.

This commit changes the duplicated xmlid to create the 6 tasks as
expected.

Part of task-2671848

closes odoo/odoo#80661

X-original-commit: 12e848cb200d4b763563e0b110c963aeb71d706e
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-12-01 11:05:09 +00:00
Nicolas Bayet 094ec14233 [FIX] web_editor: wait popover to be inserted to modify it
In some circumstance, `this.$target.data('bs.popover').tip` was not
defined until added into the DOM.

Task-2666388

closes odoo/odoo#80657

X-original-commit: 4fdd17b7436984ade2ce97dd57d749cc18c452dc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-01 11:05:05 +00:00
Paolo (pgi) 423c7029d9 [IMP] l10n_pe: Moved ICBPER tax group from enterprise to community
closes odoo/odoo#78187

Related: odoo/upgrade#2914
Related: odoo/enterprise#21596
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-12-01 11:04:56 +00:00
David Beguin 51d131663c [FIX] survey: test if survey exist in survey_layout for background management
Since fd75481d52, we use the survey variable to compute the
background_image_url in the survey_layout. In some cases (notably in
survey_session_code template), this layout is used without knowing the
variable 'survey'.

After this commit, the 'survey' variable is tested before usage.

Also, this commit add the o_survey_background class to the t-attf-class that
already exists on 'wrapwrap' selector. Otherwise, by having both t-att-class
and t-attf-class, only the t-att-class is kept.

Task-2703147

closes odoo/odoo#80656

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-01 10:18:11 +00:00
Chong Wang (cwg) 1ceccf68e8 [IMP] sign: improve ui for buttons
Put "Sign Now", "Send" and "Share" into the dropdown menu of "Action" button when the window is too small
Add add "Send" "Sign Now" and "Share" buttons in the list view
Make green saving Kanban in the center of the screen when the window is too small
Change the order of buttons for signature popover
Make "width: 30%" css only for buttons for signature popover to avoid text overflow
change 'Adopt and Sign' to 'Adopt & Sign'

before this commit: there are some overflow and misalignment for buttons

task-2630720

closes odoo/odoo#79292

Related: odoo/enterprise#21671
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-01 10:17:57 +00:00
Chong Wang (cwg) db5b055138 [FIX] calendar: fix recurrence name
change the wrong recurrence name like
"Every 1 Months on the -1 Last for 3 events"
to
"Every 1 Months on the Last Thursday for 3 events"

before this task,
If you create a recurrence event and invite another partner in calendar with
* Repeat Every: xxx "Months"
* Day of Month: Day of month: Last Thurday
The recurrence name in the email would be like
"Every 1 Months on the -1 Last for 3 events"

closes odoo/odoo#78809

Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-01 09:30:02 +00:00
Raphael Collet 0011823932 [FIX] core: cr.transaction no longer depends on registry
The cursor features a "transaction" object to manage application-
specific data in relation with cursor operations.  In its initial
implementation, the transaction object was created by the registry.
This created a requirement: in order to be used in environments, a
cursor had to be created by registry.cursor().

We now remove that unnecessary technical requirement by making
environments create the transaction object on demand.

closes odoo/odoo#80644

X-original-commit: e902713648bca329e6821859462b2128aad62c09
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-12-01 08:44:48 +00:00
Nicolas BayetandAntony Lesuisse f98db923e2 [FIX] web_editor: fix module auto install with web
The web_editor dependency with mail was problematic:
- web_editor would not auto_intall without the mail being installed
- A circular dependency problem with discuss

In order to avoid creating a new module shared by mail
and web editor, the use of a hack has been decided.
By checking if `notification_type` is in the session, we ensure
that the module mail is installed.

Task-2698655

closes odoo/odoo#80640

X-original-commit: 4e611d7527f85fc074115bd018adb7d6e5ea2c53
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Antony Lesuisse <al@odoo.com>
2021-12-01 08:01:00 +00:00
Antoine Guenet 9f480ba234 [FIX] mass_mailing: restore empty template thumbnail
The empty template had no thumbnail for the "select your template" tab.
This introduces a simple white one.

closes odoo/odoo#80622

X-original-commit: b1ac5a0167c0463d6d83bf4a8463a5e7432ebc21
Related: odoo/enterprise#22616
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-01 08:00:54 +00:00
Antoine Guenet 4d519e5b9c [FIX] mass_mailing: switch templates on hover thumbnail
Templates in mass_mailing have been redefined in [PR]: all their custom
styles have been removed so they all are built in a way that they could
be built using the editor only. Since this was done, the "select your
template" tab has been broken because there are no styles to apply.
This fixes the feature by adapting it to the new context: instead of
changing the styles, it applies the fresh template as if we were
starting a brand new e-mail.

[PR] https://github.com/odoo/odoo/pull/77312

task-2702007

X-original-commit: 09a8e58fd59c297727f9f64ec2a434caaf5b9a67
Part-of: odoo/odoo#80622
2021-12-01 08:00:54 +00:00
Kevin Baptiste 82803328b2 [FIX] hr_expense: allow users to read paid expenses
Simple users lost the ability to read their own paid expenses due to
missing access rights on account.move.

closes odoo/odoo#80646

Taskid: 2698791
X-original-commit: f164967c1eef731e92f41945b9a9fa05099950d9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-01 07:18:10 +00:00
Thibault Francois 59aa5f7c0e [FIX] survey: question not define in survey.layout on print route
How to reproduce issue
-----------------------

- Create a survey with more than one question
  - Layout: One page per question
- Complete a first survey
- Start a second survey but don't finish it

- Click on see result
- Click on the answer of the uncompleted answer

you got a traceback
'NoneType' object has no attribute 'id'

Node: <t t-set="page_number" t-value="page_ids.index(question.id)"/>

Why this is happening ?
-----------------------

question is define in survey_page_print template inside a foreach.
The scope of question thus is limited to this foreach.

Solution
--------

Declare question before the foreach in a t-set

closes odoo/odoo#80648

X-original-commit: d80ec72696010d668047c8fb1d9665f6aa1b2ee6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-30 19:08:12 +00:00
Sébastien Theys 08a3df6428 [FIX] mail: prioritize internal users when looking for mentions
Since https://github.com/odoo/odoo/pull/73689 all internal users are no longer
known at init. Unlike what was stated in the corresponding PR, the code of
mentions wasn't actually good enough to allow it without any drawback.

This PR fixes the issue by prioritizing internal users on the result of the RPC.

As a bonus the internal user state is immediately returned when fetching
followers, which allows mentions to be accurate even before the RPC is done.

task-2695224

closes odoo/odoo#80645

X-original-commit: 86de2f231be87b289deb85c3b20b93d890cce918
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-11-30 18:23:49 +00:00
Romeo Fragomeli ef70369eaa [FIX] web: navbar menu not shown on tablet
Before this fix, 'currentApp' returned 'undefined' on mobile but
there is no reason not to return the current app on mobile.
This has been fixed in enterprise repository.

Now that 'currentApp' returns a value, we have to explicitly hide
'menuItem' for small screen.

Steps to reproduce:
* Open Odoo on tablet
* Select an App => BUG

opw-2687424
opw-2688832

closes odoo/odoo#80639

X-original-commit: 3659d65f37d08737f99d62ecb8cd486ba8d764f4
Related: odoo/enterprise#22620
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2021-11-30 17:40:11 +00:00
Philippe Wauthy 1db8dc26c7 [FIX] hr: update accesss right for hr_employee
In a multi-company environment, it is not possible to update information (language, email,...) from My Profile.
The security rule only allows to change information if the right company is selected or if the user has no company.
Since a user assigned to several companies will have several records in hr_employee referring the same user_id, the security rule is now updated to allow updating information from the My Profile page if the hr_employee.user_id refers to the current user_id.

task-2678411

closes odoo/odoo#80637

X-original-commit: 3e9393c71ccf1b00c051155afd68b3a0cfff05cd
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-30 17:40:04 +00:00
Philémon van Helden 3b833c73a7 [IMP] mass_mailing, *: improve mailing stat buttons
*mass_mailing_crm, mass_mailing_sale 

Currently, the Mailing stat buttons have a few problems.
The business reporting smart buttons send the user to a list of linked records,
which doesn't provide much value (e.g. what is the user supposed to do with a
list of 12345 leads?). They also show wrong values depending on access rights.
The Mailing KPI smart buttons lead to a blank screen if there's no data to show.

In this commit, we add/adapt all action helpers to help users understand what is
going on. For the business reporting smart buttons we instead send users to
relevant reporting actions, so they can make sense of the data we showed before.
The values of the business reporting smart buttons are now calculated as a super
user.
We also change some domains from the whole UTM Sale Domain to only using
Source ID, which simplifies computation while staying accurate.

task-2604515

closes odoo/odoo#76798

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2021-11-30 16:53:33 +00:00
Hiral Bhavsar 89fbe1c34e [FIX] mail: invisible reply icon on temporary or transient messages
Before this commit:

Replying to the answer of /who command in a channel leads to the reply not being
associated with the correct message, it should simply not be possible.

After this commit:

Reply icon will be invisible for temporary or transient message.

Task-2700389

closes odoo/odoo#80623

X-original-commit: 1df56ba9e105bd2766e252be22a320046b815cf3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-30 16:07:51 +00:00
Charles Ferir ccc85fd269 [FIX] stock: solve possible infinite recursion
Steps to reproduce:

  - Test upgrade request 40290

Issue:

  Traceback raised.

Cause:

  The _find_delivery_ids_by_lot function can raise a
  RecursionError: maximum recursion depth exceeded if
  there is a loop in the path of lots.

  When running the function recursively for
  lot_id contained in produce_line_ids the same lot
  can be reached multiple times.

  In the case of db 40290:
  move_380->move_381
  move_381 and move_419 both in lot_1320
  move_419->move_423
  move_423 and move_380 both in lot_567
  move_380->move_381
  ...(goes on forever)

Solution:

  Use a lot_path optionnal argument to test if
  a lot has already been visited.

Full Traceback:
```
Traceback (most recent call last):
  File "/tmp/tmp81rzi7n7/migrations/testing.py", line 208, in test_check
    self.check(value)
  File "/tmp/tmp81rzi7n7/migrations/base/tests/test_mock_crawl.py", line 85, in check
    self.assertFalse(diff, msg)
AssertionError: [('stock.menu_action_production_lot_form', 195, 'Inventory > Master Data > Lots/Serial Numbers', 310), ('mrp.menu_mrp_traceability', 258, 'Manufacturing > Products > Lots/Serial Numbers', 310)] is not false : At least one menu or view working before upgrade is not working after upgrade.

('stock.menu_action_production_lot_form', 195, 'Inventory > Master Data > Lots/Serial Numbers', 310):
 Traceback (most recent call last):
   File "/home/odoo/src/odoo/15.0/odoo/api.py", line 879, in get
    return field_cache[record._ids[0]]
 KeyError: 567

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1057, in __get__
    value = env.cache.get(record, self)
   File "/home/odoo/src/odoo/15.0/odoo/api.py", line 882, in get
    raise CacheMiss(record, field)
 odoo.exceptions.CacheMiss: 'stock.production.lot(567,).delivery_count'

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/tmp/tmp81rzi7n7/migrations/base/tests/test_mock_crawl.py", line 182, in crawl_menu
    self.mock_action(action_vals)
   File "/tmp/tmp81rzi7n7/migrations/base/tests/test_mock_crawl.py", line 293, in mock_action
    mock_method(model, view, fields_list, domain, group_by)
   File "/tmp/tmp81rzi7n7/migrations/base/tests/test_mock_crawl.py", line 319, in mock_view_form
    [data] = record.read(fields_list)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3227, in read
    return self._read_format(fnames=fields, load=load)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3247, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 5867, in __getitem__
    return self._fields[key].__get__(self, type(self))
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1106, in __get__
    self.compute_value(recs)
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1265, in compute_value
    records._compute_field_value(self)
   File "/home/odoo/src/odoo/15.0/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4249, in _compute_field_value
    getattr(self, field.compute)()
   File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 122, in _compute_delivery_ids
    delivery_ids_by_lot = self._find_delivery_ids_by_lot()
   File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 204, in _find_delivery_ids_by_lot
    for delivery_ids_set in line.produce_line_ids.lot_id._find_delivery_ids_by_lot().values():
   File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 204, in _find_delivery_ids_by_lot
    for delivery_ids_set in line.produce_line_ids.lot_id._find_delivery_ids_by_lot().values():
   File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 204, in _find_delivery_ids_by_lot
    for delivery_ids_set in line.produce_line_ids.lot_id._find_delivery_ids_by_lot().values():
   [Previous line repeated 926 more times]
   File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 197, in _find_delivery_ids_by_lot
    move_lines = self.env['stock.move.line'].search(domain)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 1810, in search
    res = self._search(args, offset=offset, limit=limit, order=order, count=count)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4682, in _search
    query = self._where_calc(args)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4438, in _where_calc
    return expression.expression(domain, self).query
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 442, in __init__
    self.parse()
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 701, in parse
    right_ids = comodel.with_context(active_test=False)._search([(path[1], operator, right)], order='id')
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4683, in _search
    self._apply_ir_rules(query, 'read')
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4464, in _apply_ir_rules
    expression.expression(domain, self.sudo(), self._table, query)
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 442, in __init__
    self.parse()
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 701, in parse
    right_ids = comodel.with_context(active_test=False)._search([(path[1], operator, right)], order='id')
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4682, in _search
    query = self._where_calc(args)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4438, in _where_calc
    return expression.expression(domain, self).query
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 431, in __init__
    self._unaccent = get_unaccent_wrapper(model._cr)
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 405, in get_unaccent_wrapper
    if odoo.registry(cr.dbname).has_unaccent:
   File "/home/odoo/src/odoo/15.0/odoo/__init__.py", line 104, in registry
    return modules.registry.Registry(database_name)
   File "/home/odoo/src/odoo/15.0/odoo/modules/registry.py", line 61, in __new__
    return cls.registries[db_name]
   File "/home/odoo/src/odoo/15.0/odoo/tools/func.py", line 71, in wrapper
    return func(self, *args, **kwargs)
 RecursionError: maximum recursion depth exceeded

('mrp.menu_mrp_traceability', 258, 'Manufacturing > Products > Lots/Serial Numbers', 310):
 Traceback (most recent call last):
   File "/home/odoo/src/odoo/15.0/odoo/api.py", line 879, in get
    return field_cache[record._ids[0]]
 KeyError: 567

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1057, in __get__
    value = env.cache.get(record, self)
   File "/home/odoo/src/odoo/15.0/odoo/api.py", line 882, in get
    raise CacheMiss(record, field)
 odoo.exceptions.CacheMiss: 'stock.production.lot(567,).delivery_count'

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/tmp/tmp81rzi7n7/migrations/base/tests/test_mock_crawl.py", line 182, in crawl_menu
    self.mock_action(action_vals)
   File "/tmp/tmp81rzi7n7/migrations/base/tests/test_mock_crawl.py", line 293, in mock_action
    mock_method(model, view, fields_list, domain, group_by)
   File "/tmp/tmp81rzi7n7/migrations/base/tests/test_mock_crawl.py", line 319, in mock_view_form
    [data] = record.read(fields_list)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3227, in read
    return self._read_format(fnames=fields, load=load)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3247, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 5867, in __getitem__
    return self._fields[key].__get__(self, type(self))
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1106, in __get__
    self.compute_value(recs)
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1265, in compute_value
    records._compute_field_value(self)
   File "/home/odoo/src/odoo/15.0/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4249, in _compute_field_value
    getattr(self, field.compute)()
   File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 122, in _compute_delivery_ids
    delivery_ids_by_lot = self._find_delivery_ids_by_lot()
   File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 204, in _find_delivery_ids_by_lot
    for delivery_ids_set in line.produce_line_ids.lot_id._find_delivery_ids_by_lot().values():
   File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 204, in _find_delivery_ids_by_lot
    for delivery_ids_set in line.produce_line_ids.lot_id._find_delivery_ids_by_lot().values():
   File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 204, in _find_delivery_ids_by_lot
    for delivery_ids_set in line.produce_line_ids.lot_id._find_delivery_ids_by_lot().values():
   [Previous line repeated 926 more times]
   File "/home/odoo/src/odoo/15.0/addons/stock/models/stock_production_lot.py", line 197, in _find_delivery_ids_by_lot
    move_lines = self.env['stock.move.line'].search(domain)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 1810, in search
    res = self._search(args, offset=offset, limit=limit, order=order, count=count)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4682, in _search
    query = self._where_calc(args)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4438, in _where_calc
    return expression.expression(domain, self).query
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 442, in __init__
    self.parse()
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 701, in parse
    right_ids = comodel.with_context(active_test=False)._search([(path[1], operator, right)], order='id')
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4683, in _search
    self._apply_ir_rules(query, 'read')
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4464, in _apply_ir_rules
    expression.expression(domain, self.sudo(), self._table, query)
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 442, in __init__
    self.parse()
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 701, in parse
    right_ids = comodel.with_context(active_test=False)._search([(path[1], operator, right)], order='id')
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4682, in _search
    query = self._where_calc(args)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4438, in _where_calc
    return expression.expression(domain, self).query
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 431, in __init__
    self._unaccent = get_unaccent_wrapper(model._cr)
   File "/home/odoo/src/odoo/15.0/odoo/osv/expression.py", line 405, in get_unaccent_wrapper
    if odoo.registry(cr.dbname).has_unaccent:
   File "/home/odoo/src/odoo/15.0/odoo/__init__.py", line 104, in registry
    return modules.registry.Registry(database_name)
   File "/home/odoo/src/odoo/15.0/odoo/modules/registry.py", line 61, in __new__
    return cls.registries[db_name]
   File "/home/odoo/src/odoo/15.0/odoo/tools/func.py", line 71, in wrapper
    return func(self, *args, **kwargs)
 RecursionError: maximum recursion depth exceeded
```

closes odoo/odoo#80606

X-original-commit: acceb903b0487987edd5da9ce343c0f6c3ff44d8
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-11-30 16:07:47 +00:00
Aurélien WarnonandJulien Banken e70c203910 [IMP] crm: add small view improvements for crm.lead
This commit simply re-organizes a few fields on the crm.lead form view to give
more visibility to the most important information and to give more space to the
"Notes" section.

Task-2677144

closes odoo/odoo#80591

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Julien Banken <jbn@odoo.com>
2021-11-30 16:07:43 +00:00
Horacio Tellez 43cd3b4dfe [IMP] payment: customer is no longer able to see tokens for disabled acquirers.
Saved payments methods for disabled acquirers are no longer visible on the customer
portal. It was fustrating for the customer to see saved payment methods that he was
no longer able to use as they are disabled.
Now the use should only be able to see payment methods that he can indeed use.

Task - 2679695

closes odoo/odoo#79253

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-11-30 16:07:36 +00:00
Odoo's Mergebot dea661b215 [MERGE] resource: get work intervals based on resource settings/contracts
The False key is always added in attendance and leave intervals batch
but is not added in the work_intervals batch.

To give a more smooth API, this commit aligns work_intervals behavior
with the two other methods behavior, regarding the added False key.

task-2646630

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#77362

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-30 17:07:26 +01:00
Nicolas Bayet 9b3c4e3504 [FIX] web_editor: avoid editor history on image cropper
In some circumstance, the image cropper is being reverted by the
Odoo editor unbreakable mechanics. The reason was that the cropper tool
was appended inside the editable rather than outside the editable.

Task-2693553

closes odoo/odoo#80613

X-original-commit: c09600fe35089cdaed34ec12d8bcb992d24e043f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-30 15:22:19 +00:00
Goffin Simon eded149595 [FIX] l10n_de: Bad alignment on 2nd sales order line
Steps to reproduce the bug:

- Install l10n_de
- Create a german company
- Create a SO with two lines with big description
- Print report Sale/Quotation

Bug:

All the elements on the 2nd SO line was aligned with the top

opw:2690117

closes odoo/odoo#80599

X-original-commit: e633715b6e7e2891f367d1ff1e2796f8f1923ee2
Signed-off-by: Florian Gilbert <flg@odoo.com>
2021-11-30 15:22:15 +00:00
Arturo Flores eb78b67e93 [IMP] account_edi: improve how we handle attachments for the email
When assembling the email we are leaving the assignment of the attachments
to another method that we can inherit and then modify instead of doing it
in the same method to attach them.
The idea is that in any localization we need only to modify that method
in order to add new attachments to the mail template.

closes odoo/odoo#80490

X-original-commit: 6f2e7dc3e8c468bcdb0862468eb08b65ce40c983
Related: odoo/enterprise#22568
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-30 15:22:05 +00:00
Valentin Chevalier dd8a3674af [REF] payment: cleanup payment link wizard
Delete code that is not useful anymore and was introduced in
task-2666881 (PR #78334)

task-2694027

closes odoo/odoo#80051

Related: odoo/upgrade#3050
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-11-30 15:22:01 +00:00
Odoo's Mergebot 4bfddfd2a3 [MERGE][IMP] website_slides: refactor content management + vimeo support
This merge commit has five sub-sections:

1. Rename 'slide_type' and 'datas' fields

To 'slide_category' and 'binary_content', in order to ease the following
changes.

See underlying commits for detailed information about those points.

2. Completely refactor the way we handle external content in the course slides.

This includes both technical (new fields, ...) and functional (forms) changes.
With these changes, we aim to make it much clearer for the end user on how to
introduce new content to its course, both for local files and external links.

3. Introduce support for Vimeo

Vimeo is a platform for professionals that manage video content, similarly to
YouTube.
The changes include allowing to introduce Vimeo links in your slides, correctly
embed the video, automatically set it as completed in the last 30 seconds,
fetch video metadata to autocomplete fields when URL is input, ...

4. Slightly improve e-learning views

See underlying commits for detailed information about those points.

5. Rename 'webpage' to 'article'

Indeed, 'webpage' was confusing because it was leading you to believe that you
would have to link external content from another website.

See underlying commits for detailed information about those points.

LINKS

Task-2510174
UPG PR odoo/upgrade#2498

closes odoo/odoo#71477

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-30 16:21:50 +01:00
Aurélien Warnon 22d1743e26 [REF] website_slides: rename 'webpage' to 'article'
This commit simply renames the 'webpage' slide_category into 'article'.

Indeed, 'webpage' was confusing because it was leading you to believe that you
would have to link external content from another website.

While this slide_category instead lets you build an 'article' with content by
using our website builder.

The changes here are just renaming the slide_category and the labels, there
should not be any functional change.

Task-2510174

Part-of: odoo/odoo#71477
2021-11-30 15:21:49 +00:00
Aurélien Warnon ffa504887d [IMP] website_slides: slightly improve various e-learning views
PURPOSE

This commit adds some small UI improvements to the e-learning views.
All those small changes are meant to improve the general user experience when
adding content to a course.

DETAILED SPECS

- Change some placeholders / labels
- Inform the end-user that he can edit his 'webpage' slide using the editor
- Inform the end-user that he can add questions to his 'quiz' slide using the
  'Quiz' tab in the backend form view
- Do not update from slide metadata if field value is already set
- Do not allow previews for certifications
- "Allow Download" of slide content is now False by default
  As it was nice to have for "Documentation" courses but does not really make
  sense for "Training" ones.
- Having a duplicate video id is now informative on the frontend and not
  blocking as before (it was allowed in the backend form anyway).
- Show the video title in the frontend preview

Task-2510174

Part-of: odoo/odoo#71477
2021-11-30 15:21:48 +00:00
Aurélien Warnon 0ece0b3263 [IMP] website_slides: add Vimeo integration
This commit adds support for the Vimeo provider in the e-learning platform.

This includes managing Vimeo video links and showing the Vimeo embedded player
in the fullscreen and non-fullscreen viewers.

But also managing video events to:
- automatically set the slide as completed when the video reaches the last 30
  seconds
- go to the next slide when the video ends (if there is one)

Task-2510174

Part-of: odoo/odoo#71477
2021-11-30 15:21:48 +00:00
Aurélien Warnon 7b5427f6d6 [REF] website_slides: refactor external content management in slide.slide
PURPOSE

Globally refactor the way we handle external content (YouTube videos,
Google Drive documents, ...) in the course slides.

This includes both technical changes (new computed fields, rename, ...) as well
as visual changes on the form views that allow introducing new content, both in
the backend (slide.slide form view) and in the frontend (course main website
page).

SPECS

TECHNICAL REFACTOR

1. Rework the "url" field

This field was used without any distinction for videos, regular documents and
images, leading to a big confusion both technically and visually.

The urls are now split in separate fields (video_url, document_google_url and
image_google_url), based on the type of slide.
Those fields are implemented as 'related' to the stored 'url' field to avoid
extra storage.

This change globally increases the readability and usability in the code, and
also allows for clear labels on the various views.

1b. Rework the "binary_content" field

The same way as for the 'url' field, the 'binary_content' field has been split
into 2 related fields ('document_binary_content' and 'image_binary_content').

This allows for more readability and also helps in the form view to limit the
file selection to the supported file types.

2. Remove the "document_id" stored field

This field did not have to be stored since it can "easily" be inferred from the
video/document URL with some regex work.

3. Remove the "mime_type" field

This field's value was only determined by an external call to the Google Drive
API. It was inconsistent because not set for manually uploaded document and was
used for some strange checks that seemed to work but did not make much sense.
(e.g: used to make the difference between a Google Drive video and a YouTube
video??).

It has been replaced by a "document_type" field, which is always 'pdf' for
local files (only type we support) and inferred from the mimeType returned by
Google Drive metadata for external documents.

This allows, for instance, to show pretty icons next to every slide based on
their type, "sheet" files (Excel, Google Sheet, ...) share the same icons, the
same principle is applied to "doc" files (Word, OpenOffice, Google Doc, ...)
and finally "slides" files (PowerPoint, Google Slides, ...).

4. Introduce several computed fields

Such as:
- video_source_type
- youtube_id
- google_drive_id

These fields are mostly inferred from the slide type and the related URL.
They are used to make clear checks in the code and ease readability, for
example when constructing the slide "embed code" to insert it in the frontend
full screen viewer.

5. Remove the "presentation" slide_type

The slide type "presentation" was some kind of very confusing type between
image and pdf. It was mostly relying on the fact that the content had a bigger
width than height ('landscape' display).

This lead to a lot of confusion both in the code base and in the various forms
allowing to introduce new content ("what should I choose? document or
presentation?").

In order to simplify everything, we completely removed the slide type
"presentation" and converted all the data that had this type and the various
code checks to the type "document" instead.

Meaning that we end up with the following slide types:
- Infographic - for images, local files + external links
- Web Page - local input only
- Document local files + external links
- Video - external only, YouTube or Google Drive links
- Quiz

FUNCTIONAL

Following the technical changes here above, we can improve the form view of the
slide.slide model as well as the website form that allows adding new content.

1. Slide form view

To make it clear where the source of the document comes from, we introduced a
"source_type" field that is either "local_file", used when uploading a file
from your computer, or "external", used when linking content from Google Drive.

The source_type selection appears when adding content of type "document" or
"infographic" and conditions the display of the file upload button or the
document_url field.

2. Adding content from the website

When adding content from the website, the user is now invited to select from
ALL the available slide type, meaning we added "Infographic" to the selection.

Before this change, if you wanted to link an image, you had to select the type
"presentation" (that has a PDF file as icon...) and then input an image file.
The JS then processed the file type to determine the slide type.

As this was slightly confusing for the end user, we decided to use the same
approach as the form view, meaning you FIRST select the type of slide you want
and THEN input the content as a local file or external link.

Since we now handle all types of documents when using an external Google Drive
link, the various screen and text helpers have been reworked accordingly.

3. Handle more types of slides with the new "slide_type" field

This commit also introduces a new "slide_type" field.
(Don't get confused, the previous "slide_type" field has been renamed to
"slide_category" in an earlier rename commit).

This slide_type is a refined slide_category:
- Videos are split into 'youtube_video' and 'google_drive_video'
- Documents are refined based on the file mime_type if it's external content
  For example, if you link a Excel file, the slide_type will be 'sheet'.
  If you link a Google Doc, the slide_type will be 'doc'
  etc...
  (Local documents are only PDFs since it's the only type we support for now)

This small change allows to include minor nice details into views, such as a
refined icon for each slide_type on the website.

LINKS

Task-2510174
UPG PR odoo/upgrade#2498

Part-of: odoo/odoo#71477
2021-11-30 15:21:48 +00:00
Aurélien Warnon ab0b36e8a5 [REF] website_slides: rename slide.slide fields
This commit simply applies the following renames in the slide.slide model:

- 'datas' is renamed into 'binary_content'
- 'slide_type' is renamed into 'slide_category'

This changes intend to ease the next bug refactoring of the website_slide
module content management.

There should be no functional changes applied in this commit.

Task-2510174

Part-of: odoo/odoo#71477
2021-11-30 15:21:47 +00:00
Arnold Moyaux 8861c45ff2 [FIX] stock: delivery slip missing address
commit af13e76629
reworked delivery split to add interwarehouse addresses but also
removed the address in a usual case.

opw-2701998

closes odoo/odoo#80609

X-original-commit: 9b9c4a3433d2a052e70e434b11817b791f38e508
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-11-30 14:31:22 +00:00
roen-odoo 52363d1913 [FIX] pos_coupon : Couldn't start PoS
Current behavior :
When installing l10n_de_pos_cert on runbot module you couldn't start a PoS session

Steps to reproduce :
Duplicate runbot database
Install l10n_de_pos_cert
Try to start a PoS session in a german store

opw-2691615

closes odoo/odoo#80608

X-original-commit: 467708cbedfb2b8146c653afc06625dc4af7e893
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2021-11-30 14:31:13 +00:00
yhu-odoo 31984c8cd9 [IMP] stock: clean onchange for putaway
Clean the code for onchange method with putaway rule applied, merge
them into one onchange method.

Task-2614519

closes odoo/odoo#80519

X-original-commit: 5f562895c4d2f9beac7e0458fcee493b0141f1af
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2021-11-30 14:31:09 +00:00
yhu-odoo 6ac7e776b8 [FIX] stock: ignore the quantity of the current sml when apply putaway
When applying putaway rules, the qty of all existing assigned SM lines are
summed to calculate the incoming  qty of the product to determine if the
capacity has been or will be met. When a SM - that a putaway rule will apply
to - is created, then it will have its SM lines included in this calculation when
it shouldn't. In this case, we need to ignore the qty of those lines

Task-2614519

X-original-commit: 14738c7e5ecfba81e7ccbd401e1204d3bac960aa
Part-of: odoo/odoo#80519
2021-11-30 14:31:09 +00:00
yhu-odoo 14c494c3b3 [FIX] stock: calculate weight of package when apply putaway rule
Now when apply putaway rule on a package with package type, we calculate
the weight of the package according to the product in that package
instead of using the max weight of the package type.

Task-2614519

X-original-commit: 0281ebec36dbb9effd3d2913c0d38c88f9f19920
Part-of: odoo/odoo#80519
2021-11-30 14:31:09 +00:00
yhu-odoo 251e9992c8 [FIX] stock: no check_company on package_type_id
Package won't have a company_id untill the move is validated.
Previously, the package_type_id on package has the check_company to be
true. This forbiden any package type with company_id to be used on a not
validated package. In this commit, we remove check_company to avoid
this.

Task-2614519

X-original-commit: 66cbccb15368713ef04d2ba0f9e8808b72557b41
Part-of: odoo/odoo#80519
2021-11-30 14:31:08 +00:00
yhu-odoo 53852391d3 [FIX] stock: count incoming package number when apply putaway rule
Previously when apply putaway rule, we only count the packages in the
location to check if there is enough space the incoming package. Now we
also count all other assigned incoming packages to that location to
avoid overflow.

Task-2614519

X-original-commit: 21373dbc507e57c3a19b415583a5b0595a66c1a3
Part-of: odoo/odoo#80519
2021-11-30 14:31:07 +00:00
yhu-odoo 87fd6b7692 [FIX] stock: Add missing packaging when find a putaway location
When apply a putaway rule to find a putaway location, we only pass the
product and/or package info to _get_putaway_location. This is not
enough since the putaway rule can also be applied to packaging.

X-original-commit: 9f339938aec075c5385dca349dfc6a7c2d43b6ad
Part-of: odoo/odoo#80519
2021-11-30 14:31:07 +00:00
yhu-odoo 6206b0858b [FIX] stock: improve putaway when put in pack
Put in Pack won't trigger any onchange to use putaway rules. In this
commit, we apply putaway rule in Put in Pack when only one move line
is put in pack. We also check if the ml to put in pack are all in same
package type, if so, we set that package type on the package.

Task-2614519

X-original-commit: 023b69ac2ccac2456bcb1a8b1b66b468e213b86a
Part-of: odoo/odoo#80519
2021-11-30 14:31:07 +00:00
yhu-odoo b9b7bde33d [FIX] stock: add company_id to package type view
We didn't show company_id on package type view, there was no way to
change it. Add it in this commit.
Also made company_id on stock_storage_category form not visible when not
in multi-company.

X-original-commit: 61792e9dc13bf9d326e69eb59efe3a22354f1ca5
Part-of: odoo/odoo#80519
2021-11-30 14:31:06 +00:00
yhu-odoo 152cb2a9f2 [FIX] stock: missing package when create stock move line
When find putaway location while creating new sml, we didn't consider
the package. Add it back.

Task-2614519

X-original-commit: fcbd4c775248f18c71f9cb0e700ed9934babcdfd
Part-of: odoo/odoo#80519
2021-11-30 14:31:06 +00:00
yhu-odoo 22df4c807c [FIX] stock: find putaway location of correct dest_location
Previously when the onchange method find a putaway location for a sml, we
find a putaway location of the location_dest on the sml. However, the
location may already be a result of last computation of putaway
location. In this commit, we always find putaway location of the default
destination location.

Task-2614519

X-original-commit: a96fb8e9d2a57b67666ca3b29c9313aba83cdb91
Part-of: odoo/odoo#80519
2021-11-30 14:31:06 +00:00
d04a5b5c8c [REF] core: compute fields before database insertion.
Until now, stored compute fields were computed after database insertion.
This meant that required fields should not be computed, for instance,
unless some hackish code was added to make it work.  Another trick was
to provide some default value, but this actually prevents the field for
being computed after insertion.

This commit provides a field parameter to specify that the field should
be precomputed: adding precompute=True on the field definition force the
method create() to compute its value before inserting the new record in
the database.  For the reason explained below, precomputing fields is
not always correct, and therefore the default remains to not precompute
a field.

Some stored fields must be computed after insertion, for instance:
* statistics fields computed with search/read_group/...
* fields referencing the current record (res.partner.commercial_partner_id)
* fields referencing another record that does not exist yet (think about
  records created by one2many fields)
* fields depending on the create_date/write_date/create_uid/write_uid

Those fields shouldn't be defined with precompute=True, which triggers
their computation post record creation.  This is why, by safety, we
consider the default behavior to be precompute=False.

closes odoo/odoo#80449

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2021-11-30 14:30:48 +00:00
Anjali 86f5ca73d9 [IMP] sale_(project): generic UX improvement for project
Purpose of the commit is to improve the generic UX of task
and project views.

task-2590412

closes odoo/odoo#75509

Related: odoo/enterprise#20423
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-30 14:30:43 +00:00
roen-odoo d8072e57ea [FIX] point_of_sale: Closing popup buttons
Current behavior:
When you try to close the PoS session when there are more than 6 payement methods the footer buttons dissapear

Steps to reproduce:
Add atleast 6 payement methods to any PoS. When you try to close a session of this PoS the footer buttons are out of the popup

opw-2667725

closes odoo/odoo#80607

X-original-commit: 0ae2b65644451efaf77e8bfd2f704055366dff2a
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2021-11-30 13:41:41 +00:00