Commit Graph
31 Commits
Author SHA1 Message Date
Adrian Torres bbee0b3081 [FIX] base: allow setting group_expand for ir.model.fields
PR #75856 introduced a default implementation of group_expand for
Selection fields that set the value of group_expand to True.

However the PR lacked the necessary bits that allow the same behavior
for fields created on the fly instead of through code.

This commit allows the propagation of the group_expand attribute for
fields of type Selection, this commit also exposes the checkbox in the
UI to enable/disable the setting.

closes odoo/odoo#76775

X-original-commit: 1cacc3e53cf722a31bedff7a76f8e5cc6ed45ce0
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-09-18 17:00:52 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
David Beguin 30248fde17 [IMP] base: add anchor to add action button in ir.model form view
In order to be able to add a button to activate contextual merge action on the
target model, the ir.model form view had to be adapted to add the header.

Task ID: 2459416
ENT PR: odoo/enterprise#16975
2021-06-01 13:34:53 +00:00
Xavier Morel 6835aeb0de [REM] core, *: deprecate <act_window> and <report>
Convert deprecated tags through the codebase.
2020-07-28 13:03:13 +00:00
Xavier Morel 148f3dabc9 [IMP] base: make ir.model.data use access fields
Apparently some "core objects" used to have a pair of
fields (date_init, date_update) which predate the current access
fields (hopefully anyway, the genesis of both is lost to time so we
can only speculate).

odoo/odoo#34988 removed them on constrains & relations and left them
on ir.model.data, but they do seem redundant with the regular access
fields which *are* enabled on ir.model.data.

* removes the date_init/date_update fields
* converts the one bit of code which did set those to set
  create_date/write_date
* add a default value on the columns, to ensure create_date is
  properly set even from SQL queries
* use create_date/write_date in the view
* adds setting those columns to a bunch of raw SQL queries which were
  missing them (also updates the queries some to merge the literal
  values into the queries as it seems unnecessary to interpolate
  e.g. a boolean literal)

Builds on and closes odoo/odoo#50516 as that's why I started looking
into it, and that fix is in this branch as well.

closes odoo/odoo#50661

Related: odoo/upgrade#1213
Related: odoo/enterprise#10772
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-05-27 06:16:01 +00:00
Nisha patel 4fe9eda03d [IMP] various: Change the label Model insted of Object
Currently, sometimes users are getting confusing between the concepts
of 'objects' and 'models' when doing advanced configuration or
customization.

So, In this commit we replace 'object' label by 'model'.And also add
quicksearch on the relation field.

TaskId: 2209594
Related Ent PR: https://github.com/odoo/enterprise/pull/9556

closes odoo/odoo#48647

Closes: #48647
Related: odoo/enterprise#9556
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-31 11:31:24 +00:00
Nisha patel 159699b09c [IMP] various: set boolean_toggle on 'active' fields in form view
Currently, to activate/deactivate records with the 'active' checkbox
user has to switch to edit mode of the form.
So the purpose of the task is to allow the user to activate/deactivate
records from the readonly mode of the form view.

In this commit, we  set widget='boolean_toggle' on the 'active' field in form
view.

closes odoo/odoo#46567

Taskid: 2206794
Related: https://github.com/odoo/enterprise/pull/8918
Related: odoo/enterprise#8918
Closes: #46567
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-02 06:26:02 +00:00
Damien BouvyandRaphaël Collet 00205aae2a [IMP] base: support group_expand for custom fields
Allow a naive `group_expand` for manual fields where having the
attribute set to True causes the ORM to include all records from the
relation model of the m2o field in the read_group.

This is particularly useful for custom m2o fields which represent
stages - a grouped list view or a kanban view should include all
possible stage, not only the currently used values.

Co-Authored-By: Raphaël Collet <rco@odoo.com>
2020-01-31 12:07:29 +00:00
Damien BouvyandRaphaël Collet 4d2aa27157 [IMP] base: support ordering on custom models
Up until now, it was impossible to specify the default ordering
on models created manually.

This could somewhat be bypassed by specifying the ordering of records on
views themselves, but this has one main drawback: when using a
relational field that targets a custom model as a group-by key, the
ordering defaulted to the id of the custom record. For example, if I
create a custom field on partners that points to a custom model
'x_grade' on which an 'x_sequence' field exists, I could order my grade
in their own list view according to their sequence, but any read on
partners grouped by this 'x_grade_id' field would order the returned
groups by id while I would prefer to have them ordered according to the
'x_sequence' field.

This commit introduces a new field 'default_order' on the ir.model model
that can store this default ordering clause (as an SQL expression).

Co-Authored-By: Raphaël Collet <rco@odoo.com>
2020-01-31 12:07:28 +00:00
Yenthe666 42be67dc75 [IMP] base: add model constraint search view
The constraint view in Odoo has no good quick search options to filter/group and find
specific constraints easily.
This commits allows you to easily group and search for the most used values of
constraints. This will make the finding of constraints easier for functional people.

closes odoo/odoo#41288

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-07 13:05:16 +00:00
Yenthe666 7876af3ad0 [IMP] *: set name on page elements
page is an element that is often used for xpath

closes odoo/odoo#41718

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-16 15:10:24 +00:00
Martin TrigauxandRaphaël Collet 7593b887df [REF] fields: use ir.model.fields.selection
The selection values of a selection field are now stored in database in the
model ir.model.fields.selection

This will allow to have a modular approche on selections and each selection
is now linked to the module that declared it.
Previously to this change, the selections were linked to the field, meaning
uninstalling a module had no impact on the selections stored on database.

With this change, the selections will now be translated in the correct module
(having an external id) and the records having a used selection will now be
reset to null.

closes odoo/odoo#30228

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>


Co-authored-by: Raphaël Collet <rco@odoo.com>
2019-08-19 11:44:34 +00:00
lbs-odoo 9a0fedfc65 [IMP] various: improve searchviews UX
Improve searchviews UX in all the modules

TaskID: 2029731

closes odoo/odoo#35700

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-16 13:35:21 +00:00
Martin Trigaux 074074e570 [IMP] base: use log access columns
Instead of date_init/date_update, let the ORM use its own fields

This is a part of an effort to clean old models created before the use
of the ORM was generalized.

ir.model.data model also has date_init and date_update columns but
this may be changed later as more prone to side effects

closes odoo/odoo#34988

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-22 07:31:22 +00:00
Martin Trigaux bf88f3e3d1 [IMP] base: replace 'sql_constraint' translations by 'model' translations
Store the SQL constraint message directly in the field `message` of the
corresponding `ir.model.constraint` record, and manage translations from
there.  Those records are given an XML id in order to be tracked in PO
files.  The translation type 'sql_constraint` is removed.
2019-07-11 14:53:01 +00:00
Christophe Simonis 9035fb8a2a [MERGE] forward port branch saas-12.4 up to 618ea1ab67 2019-06-18 10:24:25 +02:00
Hiral Bhavsar 3cd7ed07a2 [IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.

Task 1937686

closes odoo/odoo#31243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-17 11:34:17 +00:00
Christophe Simonis 25e3f27062 [MERGE] forward port branch saas-12.3 up to 48a9f5a633 2019-06-17 13:20:35 +02:00
Christophe Simonis 8853e6b594 [MERGE] forward port branch 12.0 up to 7ef4ba03c4 2019-06-11 15:20:13 +02:00
Christophe Simonis 9e9e9acef1 [MERGE] forward port branch saas-11.3 up to a2582c4252 2019-06-07 19:04:43 +02:00
Christophe Simonis a2582c4252 [MERGE] forward port branch 11.0 up to bdc62d8031 2019-06-07 13:00:07 +02: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
Yenthe V.G 246144ac51 [IMP] base: add sheet and group names on form views
To make the rendering looks better and to make it easier to do xpath
2019-01-22 10:30:02 +00:00
David BeguinandFMDL 0b1a3da01f [IMP] base : adds direct access to groups, record rules and access rights from user form
Adds 3 smart buttons with count to see :
- Groups
- Access Controls
- Record Rules
Buttons available in debug mode only
Every user that have access to user form has at least admin / Settings or Admin / Access rights.
Admin / Settings includes Admin / Access Rights

Create and delete are not allowed for those views.
Indeed users may think they are modifying current user's access
whereas they are modifying the whole group access.
To avoid confusion, the user's access rights list is now not editable.
Clicking on a row redirects to form view that can be edited.
A warning has been added on access rights form to be sure the user
is aware of what he is doing.

Task ID : 1830142
Closes PR #25587

Co-authored-by: David Beguin <dbe@odoo.com>
Co-authored-by: FMDL <florent.mirieu@gmail.com>
2018-10-24 07:31:06 +00:00
Raphael Collet 2b9d5f929c [FIX] base: avoid clash between field and method copy 2018-09-14 14:26:24 +02:00
Nhomar Hernández c77d4effc4 [IMP] web: Better view fields for debug mode.
When you need to fast review all properties of a model, mostly the
fields it is really anoying go to all the technical path which has all
the information already.

The previous "View Fields" action was very messy.

My proposal is simply instead use a dialog which is almost useless open
a normal vie (a little improved) which allow us audit completely
everything.

Remove the previous dialog, this will not be used anymore.

Closes #26364
2018-08-14 13:59:59 +02:00
qsm-odoo c59380bac5 [REF] *: BS4, rename btn-default to btn-secondary
BS4 "btn-default" class was replaced with "btn-secondary", which makes
more sense.
2018-07-27 12:36:54 +02:00
Christophe Simonis 45329c0cf2 [MERGE] forward port branch 11.0 up to 84210074e5 2018-07-05 17:21:01 +02:00
Christophe Simonis ae6a65753e [MERGE] forward port branch 11.0 up to dbb713c2f8 2018-02-21 20:19:26 +01:00
Christophe Simonis 8a257b08b6 [FIX] base: adapt ir.rule view
Since 7b3796d77c, view attributes are
validated against use of invalid field names.

However, the use of `global` field is a special case due to fact of
being a python keyword.

Rewrite the python expression to avoid using it, while keeping the same
visual effect.

Close #21631
2017-12-13 17:30:33 +01:00
Thibault Delavallée b162eb2e1e [MOV] base: move ir_* views to views/ 2017-11-27 11:14:55 +01:00