Commit Graph
2498 Commits
Author SHA1 Message Date
mreficent 0632274451 [IMP] base: add hook to be able to hide more module categories
closes odoo/odoo#32662

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-10 10:21:44 +00:00
Xavier Morel 2cc7f0dd49 [IMP] core: allow auto_install restriction on a subset of dependencies
Currently, auto_install is triggered when all dependencies get
installed, but there are cases where one would want such trigger on
only a subset thereof.

e.g. we want `website_sale_dashboard` to auto-install when
`website_sale` is installed. Currently, it requires `web_dashboard` to
also be auto-installed otherwise `website_sale_dashboard` would "wait"
for both dependencies to be explicitly installed before the
auto-install triggers. That's despite `web_dashboard` not being very
useful on its own. More generally this is an issue with technical
modules which need to be marked as auto_install so as not to block
e.g. bridge modules from automatically installing.

This change allows setting `auto_install` to a subset of `depends`:

* if auto_install is set to `False`, the module does not get
automatically installed (no change in semantics)
* if auto_install is set to `True`, the module gets automatically
installed if and only if all its dependencies are installed (also no
change in semantics)
* if auto_install is set to a list of dependencies, the module will be
installed when all *these* dependencies are installed, other
dependencies (excluded from auto_install) will be installed
alongside as a consequence
* auto_install can be set to an empty list, in this case the module
will always be automatically installed regardless of its
dependencies (and will force their installation).

So after this change, `web_dashboard`'s auto_install can be set to
`False` (such that it's not installed if no module defining dashboards
is installed) and `website_sale_dashboard`'s manifest can be edited
to:

'auto_install': ['website_sale']

possibilities:

# no automatic installation
'depends': ['a', 'b'],
'auto_install': False

# automatic installation if both a and b are installed
'depends': ['a', 'b'],
'auto_install': True

# automatic installation if both a and b are installed (explicit)
'depends': ['a', 'b'],
'auto_install': ['a', 'b']

# automatic installation if b is installed, a will get forcefully
# installed if it isn't yet
'depends': ['a', 'b'],
'auto_install': ['b']

# always automatically installed, will cause the installation of
# its dependencies even if they're not marked explicitly
'depends': ['a', 'b'],
'auto_install': []

Task 1851328

closes odoo/odoo#29431

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-05-07 11:44:26 +00:00
Priyanka Kakadiya ac77a6ce8e [REF] base: handle groups for server action
Users may not do all actions bound to a model. We add the `groups_id` field
on `ir.actions.server` so that `get_bindings` can filter out unauthorized ones.

task id- 1945291
2019-05-08 09:40:11 +00:00
Raphael Collet a38dc1ccb9 [FIX] test_mail: adapt query counts
closes odoo/odoo#32905

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-06 09:44:10 +00:00
Raphael Collet d0dbcacfff [IMP] models: new implementation of prefetching 2019-05-06 09:44:10 +00:00
Hetal Dhanak b5b7396b84 [IMP] base: updated tooltip of implementation field in ir.sequence
-customers were misunderstanding the concept of "no gap" sequence
implementation hence updated the tooltip of the same to make it more useful and
clearer.

Task-1973967

closes odoo/odoo#33017

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-08 05:13:39 +00:00
Parth Choksi 33b75bb48b [IMP] base: added margin to all module info buttons
Before this commit, there was no space between:
 - Install button and Upgrade button.
 - Uninstall button and Upgrade button.

After this commit, margin will be added to all the buttons for proper layout.

Task ID: #1937131

closes odoo/odoo#30829

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-05-06 08:47:55 +00:00
Hiral Bhavsar a02d273ebc [IMP] base, mail: set CRUD on activity view as attributes
Just like other views (form, list, kanban, etc.) CRUD operations (create,
delete and edit) are now set as attributes on the activity node based on
the user access rights.

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar b2de618f9f [IMP] base,mail: allow to customize the activity view
The activity view has been greatly improved to allow to customize it
more easily. It works quite similarly to the kanban view, defining
`<field>` tags at the top and using these fields in the `<template>`
section. The template name used to define the activity cards is
`activity-box`.

Note that these activity cards are rendered using `KanbanRecord` widget
(this has implied that ActivityView inherits from `BasicView`).

Also note that the view validation has been moved in base to include the
common grammar.

Task 1894990
2019-05-03 10:19:40 +00:00
Swapnesh Shah b29d4da037 [IMP] base: use correct string for search filter
Type is the label of the field state ('Custom Field' or 'Base Field') while
ttype is 'Field Type'

closes odoo/odoo#33124

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-03 09:06:26 +00:00
Yenthe666 527d70a602 [IMP] base: improve res.country.state views
Allow to group by country
Add default search filters
Improved help message

closes odoo/odoo#29926

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-03 09:32:12 +00:00
Lucas Lefèvre 207c4cfb3b [FIX] base: Add missing parent_id in res.partner form
Steps to reproduce:
- Install hr and base_address_city
- Edit an employee
- In private info, set a private address
- Open private address form from the employee form

Traceback because parent_id is undefined.

The base_address_city module override a part of res.partner
view form to change the city readonly modifier.
This override adds a domain in which appears parent_id,
but the field is not present in the view.

Related commit 526bfca3af

closes odoo/odoo#32172

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-04-19 06:59:11 +00:00
Géry Debongnie 578c99475d [IMP] web: various small improvements to form view
This commit is a few small improvement/fixes to the web framework:

- allow placeholder attribute on input tags in form view
- only bind click event handler to buttons managed by the framework, not
  custom ones
- _onExecuteAction method in action manager properly fails if event
  cannot be properly handled

closes odoo/odoo#32458

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-05-02 07:14:52 +00:00
Raphael Collet f44571f550 [IMP] base: remove mapped() where not necessary 2019-04-30 07:54:49 +00:00
Raphael Collet 63bc6013ab [IMP] fields: relational fields automatically behave as mapped
In other words, `recs.foo_id == recs.mapped('foo_id')`.
2019-04-30 07:54:49 +00:00
Sébastien Theys 0ab1940189 [IMP] base,web: adapt kanban image following image tools changes
Since the images are not guaranteed to be square anymore, the kanban image had
to be adapted to better handle the different image ratios.

Also the placeholder has been moved into the actual image div instead of
being a separate div that acted differently.

The avatar placeholder was white... displayed on top of white. Now it's grey
so we can actually see it.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Sébastien Theys 09ff05ba45 [IMP] base: clean up image tools tests
Since all the tools have been merged into one, the tests can be restructured and
the duplicate tests removed.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Sébastien Theys 425f197f16 [IMP] tools,base,*: remove intermediary image functions
* = hr, im_livechat, mail, payment, purchase, web, web_editor, web_unsplash,
	website_profile, website_slides

Since the merge of all image tools into one function, the intermediary functions
are not needed anymore.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Sébastien Theys e479138558 [IMP] tools,base: merge all image tools
Make the image tools more consistent and easier to maintain by having a single
function handling all the cases, instead of several functions doing more or less
the same thing with obscure differences.

Also introduce a new function to guess the size based on a field name, to be
used in the following commit.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys 4c61ee7b7d [IMP] tools,base: remove ratio from image crop
Following commit: 6801baa662

Crop is always used when we know the target size. Therefore there is no point
to pass a ratio argument. However size is required now.

Also "center" is always used, so make it the default type.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys d870877967 [IMP] tools,base,web,website_*: keep image ratio on resize
* = website_partner, website_profile, website_sale, website_slides

Before
======

Since commit: 2e3848b394

The images that are resized have additional borders if the target ratio is
different than the image ratio. Those borders are transparent if the image
format supports it, and are white otherwise.

With that current solution, if the background where the image is displayed is
another color than white, it is looking really bad.

Moreover, most images are stored resized like this, so it is not even possible
to decide if it should have borders or not depending on the context, the
original image and ratio is forever lost.

It is also inconsistent because if the image is already smaller than the target
size then it doesn't include borders. In that case it keeps the original ratio
instead of the target ratio. So it isn't even guaranteed that the target
ratio is going to be respected.

After
=====

This commit will solve all of those problems by always keeping the ratio of the
original image.

This implies the views should be taking care of adding borders when necessary.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys 2864f8a6cf [IMP] base: add tests for the image tools
task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys d303518841 [IMP] tools,base: remove image encoding parameter
The image tools were accepting an encoding parameter but it was never used.
Indeed the given images are always encoded in base64.

`image_colorize` was the only method not taking base64 directly, so it has been
modified for consistency. This allows to change the code in partner to not
base64 decode the image in some case just to be base64 encode it again after.

`crop_image` and `limited_image_resize` have been slightly refactored to account
for this change, but in this commit their behavior was kept.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Martin Trigaux 6d9862f860 [FIX] base: use correct code for Filipino
Master version of odoo/odoo#32867
Instead of fil - fil_PH, it should have been fil_PH - fil.

closes odoo/odoo#32868

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-23 09:48:59 +00:00
Kaushalya Mandaliya 8f1db5bbdf [IMP] base: improve search on res.partner tags to include parent tags
When using the 'tag' quicksearch on the contacts, it should search on the
parent tags as well. It is what users expect from this kind of search.

Using child_of is considered valid here as people should not have a huge
list of nested categories / tags. Even a famous production db like Odoo
does not have more than 215 of them.

Related Task ID: 1903699
closes #30733

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-24 12:54:05 +00:00
Martin Geubelle 0aa4906843 [REF] web, *: remove one2many_list widget
This widget was exactly the same as a `one2many` and was kept for backward
compatibility reasons. It can be safely removed in master.

Related to task 1918327
2019-04-24 08:04:39 +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 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
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
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 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
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