details: https://code.tryton.org/tryton/commit/08c5c82cd1e2
branch: default
user: Cédric Krier <[email protected]>
date: Mon Oct 05 18:21:13 2026 +0200
description:
Allow to create any action from the UI
The action field must not be used to create the main action and the
inherited
fields from the parent action must not be set a second time.
Closes #15149
diffstat:
trytond/trytond/ir/action.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (32 lines):
diff -r c55d0522026f -r 08c5c82cd1e2 trytond/trytond/ir/action.py
--- a/trytond/trytond/ir/action.py Mon Oct 05 18:03:10 2026 +0200
+++ b/trytond/trytond/ir/action.py Mon Oct 05 18:21:13 2026 +0200
@@ -350,6 +350,7 @@
'ir.action', "Action",
required=True, ondelete='CASCADE',
states={
+ 'required': Eval('id', -1) >= 0,
'readonly': Eval('id', -1) >= 0,
})
@@ -462,8 +463,9 @@
values = values.copy()
for field in values:
if field in Action._fields:
- action_values[field] = values[field]
- if hasattr(getattr(cls, field), 'set'):
+ if field != 'action':
+ action_values[field] = values[field]
+ elif hasattr(getattr(cls, field), 'set'):
later[field] = values[field]
for field in later:
del values[field]
@@ -474,7 +476,7 @@
if database.nextid(transaction.connection, cls._table):
database.setnextid(transaction.connection, cls._table,
database.currid(transaction.connection, Action._table))
- if 'action' not in values:
+ if not values.get('action'):
action, = Action.create([action_values])
values['action'] = action.id
else: