Commit Graph
3175 Commits
Author SHA1 Message Date
jbm-odoo c44f6ffd61 [IMP] registry.py: Log info instead of warning about dropped view during installation
This problem appears when the module l10n_be_hr_payroll_fleet is installed with the
dynamic report for employees (enterprise module hr_contract_reports).

This module inherits from hr.contract and will create and modify some fields.

By modifying contract's table, PostgreSQL will drop the view from
hr_contract_employee_report. At the end of the installation, PostgreSQL will
check if tables exist, it isn't the case for the view from
hr_contract_employee_report, so it will recreate it.

It's the normal behavior.

But when a table is missing, a warning is logged and create problem with
Runbot. For this reason, it's better to log an Info and not a Warning message.

Validated with @rco
2019-04-18 08:07:43 +00:00
Christophe Simonis 0a09a4d8a8 [MERGE] forward port branch saas-12.3 up to 120359bf0c 2019-04-12 13:37:44 +02:00
Sébastien Theys c7fe955daa [FIX] fields: prevent caching wrong value when it's altered by write
Before this commit, the field assignment would cache the value it received, even
if that value was altered during `write`. This can happen if `write` is
overridden (for example to resize images), or it could also happen if a database
procedure is altering the value.

To fix this issue, we do not cache the value that was assigned. This implies
that additional queries may be necessary to retrieve the value, but those were
already necessary most of the time, so it does not have a significant impact on
performances.
2019-04-11 14:55:36 +00:00
Christophe Simonis 3fc2577c01 [MERGE] forward port branch saas-12.2 up to be3c981423 2019-04-11 19:27:36 +02:00
Christophe Simonis be3c981423 [MERGE] forward port branch saas-12.1 up to 636df25f21 2019-04-11 18:17:25 +02:00
Christophe Simonis 636df25f21 [MERGE] forward port branch 12.0 up to c9d3653f48 2019-04-11 18:00:27 +02:00
Xavier Morel 6bd9e71d9d [FIX] SSF: misinterpretation of onchange command (4)
From an onchange, at this point, (4) doesn't mean "no change" it means
"reset to database values". Through the interplay of client and server
reverse-engineering one another at this point the client (is supposed
to) assume the o2m results are "complete" and a diff from the
current *in-database* values rather than the in-client (sent to the
server) ones.

So a (1) should completely replace all existing values, and a (4)
should just remove all of them (but keep the record linked).

closes odoo/odoo#32617

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-04-11 07:49:21 +00:00
Christophe Simonis e145f2b0c8 [MERGE] forward port branch saas-12.2 up to 2694174b41 2019-04-10 15:10:24 +02:00
Christophe Simonis c9e1deb496 [MERGE] forward port branch saas-12.1 up to af313858b4 2019-04-09 20:48:01 +02:00
Christophe Simonis af313858b4 [MERGE] forward port branch 12.0 up to c1c322dd40 2019-04-09 20:43:35 +02:00
Christophe Simonis 6c8e30cae6 [MERGE] forward port branch saas-12.1 up to 6d4940675f 2019-04-09 12:16:06 +02:00
Christophe Simonis 6d4940675f [MERGE] forward port branch 12.0 up to ea1fc124ef 2019-04-09 11:11:48 +02:00
Christophe Simonis fef49061ea [MERGE] forward port branch saas-11.3 up to 4c61621efb 2019-04-08 19:52:29 +02:00
Christophe Simonis 4c61621efb [MERGE] forward port branch 11.0 up to 9a7e3c8b49 2019-04-08 17:45:00 +02:00
Christophe Simonis 9a7e3c8b49 [MERGE] forward port branch saas-15 up to cd28e53a31 2019-04-08 16:46:31 +02:00
Christophe Simonis cd28e53a31 [MERGE] forward port branch saas-14 up to 32c2af2376 2019-04-08 15:53:36 +02:00
Christophe Simonis e831064d93 [MERGE] forward port branch 10.0 up to 6431e366a8 2019-04-08 15:12:52 +02:00
Odoo Translation Bot 7887dd8727 [I18N] Update translation terms from Transifex 2019-04-07 06:20:48 +02:00
Christophe Simonis 3f95b074e9 [MERGE] forward port branch saas-12.2 up to f2be461f09 2019-04-05 18:46:10 +02:00
Adrian Torres 3f3d2b2773 [FIX] base: prevent module operations while cron is running
closes odoo/odoo#32234

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-05 13:10:35 +00:00
Christophe Simonis f2be461f09 [MERGE] forward port branch saas-12.1 up to f2d0995362 2019-04-05 10:50:56 +02:00
Damien Bouvy a25abec95c [FIX] orm: don't crash on index creation
For existing installations, creating indices might not always be
possible, e.g. if you have a Text/Char field that has an index=True
set on it in a field override and pre-existing rows longer than
the pg supported size , the index creation will fail.

Instead of failing miserably during the schema modification, simply
log the problem instead and keep going.

closes odoo/odoo#32442

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-05 07:53:07 +00:00
Sapan Zaveri 1208d7f839 [IMP] base: contacts email and phone clickable
Purpose of  this task is,
Before this task, the customer was able to click on on the email of a contact from the res.partner view.
But, he wasn't able to click on this same email when the modal of a contact was open.

For the phone it's the opposite. You can't click on the phone from the res.partner view but well from the contact's modal.

So, I made both the fields clickable in both (res.partner view and contact's modal)

Task ID: 1965730
Closes: #32586

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-10 13:10:15 +00:00
Kazantcev Andrey 6b73d23f7a [IMP] http: code cleaning
reuse current_thread result
No needed to call threading.current_thread() on evry arg setting

closes odoo/odoo#32000

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-10 07:18:59 +00:00
wan 6940cfddbc [IMP] account: visible but not required bank account on payment
When making a manual payment with account_sepa we want to allow people to add a bank account as it might display the European QR code for banking app, but this should stay optional.
So we made sure that the conditions making the field visible and required weren't the same.

part of task #1918423

closes odoo/odoo#32198

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-04 12:46:20 +00:00
wan 3c2e3b8c5a [REF] account: simplification of payments objects
simplification of payments objects and refactoring of the code

* registering payment(s) from the list of invoice now generate a single payment per invoice selected
* no more abstract object for payments/payment wizard as the logic is now really simple:
    - group_invoices option is now removed and we never try to group payments based on the currency/customer of whatsoever (see above),
    - the payment amount is the full residual amount of invoice and users cannot change it anymore
* partner_bank_account_id not required as soon as visible (depends on the payment method)
* refactoring to name tags and allow easier inheritance via xpath

part of task #1918423
2019-04-04 10:42:41 +00:00
Christophe Simonis d29e8cf423 [MERGE] forward port branch 12.0 up to 7e4b0350c3 2019-04-04 19:01:12 +02:00
Xavier Morel 7e4b0350c3 [FIX] core: handle multi level o2m in SSF
Technically it does 3 different things:

* switch from 1 level of o2m to 2 levels of o2m when recursing
* handles `parent.<xxx>` readonly modifiers on o2m subfields
* handles `id` readonly modifiers on o2m subfields (already worked in the
  normal case but not for o2m records from default_get)

The last two especially are temporary quickfixes, that will need proper fixes.

closes odoo/odoo#32428

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-04 14:20:51 +00:00
Christophe Simonis d32420397d [MERGE] forward port branch 12.0 up to 251021796c 2019-04-04 11:20:03 +02:00
Lucas Perais (lpe) bf0bb534bf [FIX] base: Arabic generic World locale is ar_001
Before this commit, the "unitag" notation "xx_AA" was used for arabic generic locale
Since it is not an official Unicode CLDR notation, some other modules
may, and did crash (babel)

Instead, we prefer to use Unicode CLDR compliance
i.e. World regions should be "_001"

http://www.unicode.org/reports/tr35/#unicode_region_subtag
http://www.unicode.org/reports/tr35/#unicode_region_subtag_validity
BCP47: https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry

This commit should invalidate the commit made by #32344
which was a hack for stable versions

It should also be taken into account in migration scripts

closes odoo/odoo#32393

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-04-03 14:24:34 +00:00
Lucas Perais (lpe) 0e85b5b132 [FIX] odoo: patch babel for "World" language territory
Following c844d66091
where generic Arabic (World) is coded ar_AA
but babel doesn't support this

Instead, babel understands xx_001 for World generic languages

http://www.unicode.org/reports/tr35/#unicode_region_subtag
http://www.unicode.org/reports/tr35/#unicode_region_subtag_validity
BCP47: https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry

OPW 1961396

closes odoo/odoo#32344

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-04-03 14:03:00 +00:00
Christophe Monniez 3f3763148a [REL] saas-12.3 2019-04-02 21:21:32 +02:00
Xavier-Do b5c2004160 [IMP] core: avoid to check access rules on empty recordset
Checking access rules only makes sence if we have some records,
_filter_access_rules will always return a subset or current
recordset, and a subset or a empty recordset is an empty recordset.

closes odoo/odoo#32313

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-02 15:39:30 +00:00
Christophe Simonis 1122b62d00 [MERGE] forward port branch 11.0 up to 4df568549a 2019-04-02 16:35:17 +02:00
Xavier Morel b4ae543098 [IMP] base: batching of _compute_commercial_partner
Should correctly handle / fallback to regular code when processing
non-stored partners.

Perf difference according to cprofile on my machine:

original python:
ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1    0.134    0.134  205.380  205.380 res_partner.py:277(_compute_commercial_partner)
SQLized
     1    0.118    0.118   67.239   67.239 res_partner.py:280(_compute_commercial_partner)

most of the time leftover seems to be in modified_draft
2019-04-02 09:57:49 +00:00
Xavier Morel 1fb20fe304 [IMP] base: try to batch update of children address & commercial fields
With profiling enabled, importing 10k partners, with all of them
having the same parent (though not with all of them having the same
is_company setting) lowers sync / post-process time from ~550s to
~330s.

Put it in an override to _load_records_create so it's only active for
imports (which is the original report & test case), use a context key
to avoid going the post-processing work in create.
2019-04-02 09:57:49 +00:00
Christophe Simonis f36175dd8f [MERGE] forward port branch saas-11.3 up to b3d4c2d178 2019-04-03 18:46:36 +02:00
Nicolas Martinelli 1e558bc79a [FIX] tools: February 28th
- Set your fiscal year end date to 28th February
- Run the P&L a year before a leap year, e.g. anytime between March 1st
  and December 31st 2019.
- Select 'Last Financial Year'

The dates are set from 2019-03-01 to 2019-02-28.

There are actually 2 bugs. The one solved here is the following
inconsistency:

```
current_date = type(date)(2019, 4, 3)
date_utils.get_fiscal_year(current_date, day=28, month=2)
'date_from': datetime.date(2019, 3, 1), 'date_to': datetime.date(2020, 2, 28)

current_date = type(date)(2020, 2, 28)
date_utils.get_fiscal_year(current_date, day=28, month=2)
{'date_from': datetime.date(2019, 3, 1), 'date_to': datetime.date(2020, 2, 29)}
```

Both should return `'date_to': datetime.date(2020, 2, 29)`. This implies
that the period is recognized as `custom`, which is affected by the bug
solved in PR https://github.com/odoo/enterprise/pull/4006

opw-1949628

closes odoo/odoo#32366

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-03 09:29:57 +00:00
Xavier Morel ef8df8fb4e [FIX] core: don't send readonly fields in o2m in SSF
The SSF would correctly filter out readonly fields when saving a
toplevel form, however it could not remove readonly values when saving
o2m pseudo-records to the parent form (as these would be expected to
remain available for reading upon the next edition and whatnot), so
these values would get sent in 0/1 commands.

Filter out these fields during the parent / toplevel save call.

Complexity notes:

* evaluating readonly modifiers requires the entire record, so
  unchanged fields still have to be written back to the parent form
  and be filtered out when *it* is set up for save, an alternative
  would be to store the `changed` and `readonly` flags alongside the
  record dict, and have the post-process only override the
  pre-computed readonly flag using force_save
* had to fix a test to match the new behaviour, the post-edition
  states turns out to be in line with the client's behaviour (or how
  it looks anyway)

Fixes #32019
2019-04-03 08:44:22 +00:00
Xavier Morel 922d77a291 [FIX] core: infinite recursion in SSF on self-recursive models
The extra setup probably affects any o2m whose edition view itself
contains an o2m, but most likely to blow up entirely on models with
some sort of tree structure (parent/child relationship): the SSF
eagerly loads and setups the o2m's view, and the o2m's o2m's, ... ad
infinitam.

A better / cleaner fix would be to set up the subview on-demand (and
possibly cache it), but the rest of the o2m stuff is unlikely to work
correctly recursively so just don't recurse the o2m view setup at all
for now.

fixes #31458
2019-04-03 08:44:21 +00:00
Jeremy Kersten 82ea590264 [MRG] website_form[_editor]: merge modules together
closes odoo/odoo#32491

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-08 10:07:49 +00:00
Nicolas Martinelli ef4aaeb4e7 [FIX] base: res.partner.bank sequence
`res.partner.bank` is ordered by sequence, but:
- there is no default value
- there is no widget handle to set it

Therefore, methods such as `_get_partner_bank_id` might retrieve an
unexpected value.

To avoid this:
- we fallback to sort by ID
- we add a default value
- we add the widget handle

opw-1948964

closes odoo/odoo#32300

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-01 12:48:04 +00:00
Xavier Morel 7e0b29cbcd [FIX] core: backport changes in 12.1/master to 12.0
PRs #28645 and #31494 were not applied to 12.0, but there's no reason
not to, they should only fix things (make behaviours more in-line with
the regular client), and since o2m is an area where more fixes are
needed and it would be nice to have them in 12.0...
2019-04-01 10:34:47 +00:00
xtanuiha ea4a782f49 [ADD] base: add Archived filter for ir.rule
To easily find archived rules

closes odoo/odoo#32261

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-08 10:18:31 +00:00
Odoo Translation Bot 2d30bd9698 [I18N] Update translation terms from Transifex 2019-04-01 02:44:26 +02:00
Odoo Translation Bot 18c735361a [I18N] Update translation terms from Transifex 2019-03-31 06:20:38 +02:00
Christophe Simonis 28cce6ce3a [MERGE] forward port branch saas-12.1 up to c0cf4049b2 2019-03-29 19:47:46 +01:00
Christophe Simonis 2a06f4dcf3 [MERGE] forward port branch 12.0 up to 09fb2469b4 2019-03-29 18:10:57 +01:00
Odoo Translation Bot 48d88b6e6d [I18N] Update translation terms from Transifex 2019-03-31 03:16:57 +02:00
Aaron BohyandMartin Geubelle 9fbb4fb44f [IMP] web: editable list: table-layout: fixed
This rev. changes the layout of *editable* list views to a fixed
layout. This means that we are now responsible of the width of
each column. To do that, we associate with each field type a
factor, and the higher the factor is, the larger the column will
be (w.r.t. the others). This default value can be overriden in the
arch.

The fixed layout allows to remove the absolute positionning of
widgets inside editable lists (done in the next commit).

Part of task 1915702

Co-authored-by: Martin Geubelle <mge@odoo.com>
2019-04-02 11:55:57 +00:00