changeset 5797b992383d in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=5797b992383d
description:
Improve report and CSV for tree structure
issue10116
review341431002
diffstat:
CHANGELOG | 1 +
trytond/ir/action.py | 11 ++++++++++-
trytond/ir/view/action_form.xml | 2 ++
3 files changed, 13 insertions(+), 1 deletions(-)
diffs (55 lines):
diff -r 670b2dd25ca9 -r 5797b992383d CHANGELOG
--- a/CHANGELOG Sun Mar 07 12:43:09 2021 +0100
+++ b/CHANGELOG Sun Mar 07 19:07:53 2021 +0100
@@ -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 -r 670b2dd25ca9 -r 5797b992383d trytond/ir/action.py
--- a/trytond/ir/action.py Sun Mar 07 12:43:09 2021 +0100
+++ b/trytond/ir/action.py Sun Mar 07 19:07:53 2021 +0100
@@ -54,6 +54,11 @@
__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 @@
'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 @@
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 -r 670b2dd25ca9 -r 5797b992383d trytond/ir/view/action_form.xml
--- a/trytond/ir/view/action_form.xml Sun Mar 07 12:43:09 2021 +0100
+++ b/trytond/ir/view/action_form.xml Sun Mar 07 19:07:53 2021 +0100
@@ -8,6 +8,8 @@
<field name="active" xexpand="0" width="100"/>
<notebook colspan="4">
<page string="General" id="general">
+ <label name="records"/>
+ <field name="records"/>
<label name="usage"/>
<field name="usage"/>
<label name="icon"/>