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.
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>
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 #1918423closesodoo/odoo#32198
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
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
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.
closesodoo/odoo#32313
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
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
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.
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
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
`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
closesodoo/odoo#32300
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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...
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>
It is now possible to put buttons in the list view group headers.
When the view is grouped by a many2one field, those buttons
appear next to the header title when the group is opened.
The buttons are specified in the views in a <groupby> tag in the
list arch, with the following structure:
<groupby name="groupedField"> <!-- must be a many2one -->
<button type="object" name="my_method" string="Button1"/>
</groupby>
It is also possible to add `field`, inside the `groupby` which can
be used for modifiers. These fields thus belong on the many2one
comodel, like:
<groupby name="partner_id">
<field name="name"/> <!-- name of partner_id -->
<button type="object" name="my_method" string="Button1"
attrs="{'invisible': [('name', '=', 'Georges')]}"/>
</groupby>
These extra fields are fetched in batch when grouping on the field.
Part of task 1915702
With this rev., when there are a lot of groups in a grouped list
view, groups are displayed under several pages, whereas they were
all displayed in the same page before.
This is especially interesting with the new 'expand' attribute, to
ensure that we don't read records for a large number of groups.
By default, the groups limit is set to 80 (like records), and to 10
is the 'expand' attribute is set to true. This limit can be
overriden with the 'groups_limit' attribute.
Part of task 1915702
The 'toolbar' attribute is not referenced in the documentation, and
it has no effect since at least v10.
The 'on_write' attribute was referenced in the documentation, but
is no longer used in Odoo and has no effect since at least v11.
The 'colors' and 'fonts' attributes are deprecated since v9, and
have no effect since v10.
The 'string' attribute is deprecated since v8 and has no effect
since v9. However, it is widely used in Odoo, so we must remove
all occurrences before removing it from the rng.
This test also fails before the module extraction commit as the code
translations like the one for 'Ijkl' have no 'module' value during the reimport
and are ignored by the following search
closesodoo/odoo#32022
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When a single po file is processed (i.e. direct po import, not read from a i18n
directory inside a module), there was no module information on code translations
The module information is important for web translations where the list of
modules is given in the call to the route '/website/translations' and
'/web/webclient/translations' and only the web translations of these specific
modules is retrieved and used.
To manually import the translations of a custom module (e.g. openerp_enterprise),
the base.language.import wizard is typically used and the give .po file is
directly imported.
For model and model_terms, the module information is easily deducted from the
the record external id (<module>.<reference>) but for code translation, we
relied on the global variable module_name.
The .po file do contain the module information but this information was ignored.
Real example:
#. module: openerp_enterprise
#. openerp-web
#: code:addons/openerp_enterprise/static/src/js/odoo_enterprise_start_trial.js:249
#, python-format
msgid "Please choose your domain name"
msgstr "Veuillez choisir votre nom de domaine"
Before this commit, the above translation was imported without the module and
was not retrieved in the '/website/translations' call on the /trial page
The global module_name is still used when set for backward compatibility.
Co-authored-by: Raphael Collet <rco@odoo.com>
If the smtp session was dead, it would lead the whole mail batch to fail.
opw 1949270
closesodoo/odoo#32424
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>