[IMP]Yaltik DSL : allow custom name on act_window
This commit is contained in:
parent
e705d61038
commit
8cbf79daf8
@ -1,4 +1,6 @@
|
||||
# Copyright 2019-2024 Fabien Bourgeois <fabien@yaltik.com>
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2019-2025 Fabien Bourgeois <fabien@yaltik.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
@ -17,7 +19,7 @@
|
||||
'name': 'Yaltik Odoo DSL base module and fns',
|
||||
'summary': 'Yaltik Odoo Domain Specific Language base module and functions',
|
||||
'description': """ Yaltik Odoo Domain Specific Language base module and functions """,
|
||||
'version': '12.0.0.5.16',
|
||||
'version': '12.0.0.5.17',
|
||||
'category': 'Yaltik',
|
||||
'author': 'Fabien Bourgeois',
|
||||
'license': 'AGPL-3',
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Fabien Bourgeois <fabien@yaltik.com>
|
||||
# Copyright 2019-2025 Fabien Bourgeois <fabien@yaltik.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
@ -45,7 +45,10 @@ act_window = lambda *args: xmln('act_window', *args)
|
||||
def act_window_model(model, attrs):
|
||||
""" Build new act_window from model and args """
|
||||
xmlid = '%s_view_action' % (model.replace('.', '_'))
|
||||
name = '%s Action' % ' '.join(map(lambda w: w.capitalize(), model.split('.')))
|
||||
if 'name' in attrs:
|
||||
name = attrs['name']
|
||||
else:
|
||||
name = '%s Action' % ' '.join(map(lambda w: w.capitalize(), model.split('.')))
|
||||
attrs_clone = attrs.copy() # Avoid side-effect
|
||||
attrs_clone.update({'id': xmlid, 'name': name, 'res_model': model})
|
||||
return act_window(attrs_clone)
|
||||
|
Loading…
x
Reference in New Issue
Block a user