From 674b469b45693aaa2b51d629f02152b714d7f0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 7 Mar 2021 19:07:53 +0100 Subject: [PATCH] Improve report and CSV for tree structure issue10116 review341431002 --- CHANGELOG | 1 + trytond/ir/action.py | 11 ++++++++++- trytond/ir/view/action_form.xml | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 80e6f44341..5ab1c89b91 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Add which records to use for actions * Add parent to group to inherit accesses * Add __access__ to Model * Add route wrapper to allow null origin diff --git a/trytond/ir/action.py b/trytond/ir/action.py index f9782146ed..cb0c37c0b2 100644 --- a/trytond/ir/action.py +++ b/trytond/ir/action.py @@ -54,6 +54,11 @@ class Action(DeactivableMixin, ModelSQL, ModelView): __name__ = 'ir.action' name = fields.Char('Name', required=True, translate=True) type = fields.Char('Type', required=True, readonly=True) + records = fields.Selection([ + ('selected', "Selected"), + ('listed', "Listed"), + ], "Records", + help="The records on which the action runs.") usage = fields.Char('Usage') keywords = fields.One2Many('ir.action.keyword', 'action', 'Keywords') @@ -66,6 +71,10 @@ class Action(DeactivableMixin, ModelSQL, ModelView): 'get_action_value': RPC(instantiate=0, cache=dict(days=1)), }) + @classmethod + def default_records(cls): + return 'selected' + @staticmethod def default_usage(): return None @@ -103,7 +112,7 @@ class Action(DeactivableMixin, ModelSQL, ModelView): Action = Pool().get(type_) if columns is None: columns = [] - columns += ['id', 'name', 'type', 'icon.rec_name'] + columns += ['id', 'name', 'type', 'records', 'icon.rec_name'] if type_ == 'ir.action.report': columns += ['report_name', 'direct_print'] elif type_ == 'ir.action.act_window': diff --git a/trytond/ir/view/action_form.xml b/trytond/ir/view/action_form.xml index 5fbf2a8683..58a482b3da 100644 --- a/trytond/ir/view/action_form.xml +++ b/trytond/ir/view/action_form.xml @@ -8,6 +8,8 @@ this repository contains the full copyright notices and license terms. --> +