diff --git a/CHANGELOG b/CHANGELOG index a8cbf12825..33991cc759 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Merge tree and list views * Added autocompletion on fields.Char * Remove ir.default * Add type, last user and last modification on ir.attachment diff --git a/doc/topics/views/index.rst b/doc/topics/views/index.rst index 36048b26e4..52d7f3f54d 100644 --- a/doc/topics/views/index.rst +++ b/doc/topics/views/index.rst @@ -22,6 +22,7 @@ So generally, they are defined in xml files with this kind of xml: model name type name + Actions ir.action.act_window ir.action - form @@ -141,7 +140,6 @@ this repository contains the full copyright notices and license terms. --> Reports ir.action.act_window ir.action.report - form @@ -172,8 +170,6 @@ this repository contains the full copyright notices and license terms. --> @@ -316,7 +310,6 @@ this repository contains the full copyright notices and license terms. --> Wizards ir.action.act_window ir.action.wizard - form @@ -374,7 +367,6 @@ this repository contains the full copyright notices and license terms. --> Wizard Sizes ir.action.act_window ir.action.wizard_size - form @@ -445,7 +437,6 @@ this repository contains the full copyright notices and license terms. --> URLs ir.action.act_window ir.action.url - form diff --git a/trytond/ir/attachment.xml b/trytond/ir/attachment.xml index bd5ec89d45..f82aca5e42 100644 --- a/trytond/ir/attachment.xml +++ b/trytond/ir/attachment.xml @@ -58,7 +58,6 @@ this repository contains the full copyright notices and license terms. --> Attachments ir.action.act_window ir.attachment - form diff --git a/trytond/ir/cron.xml b/trytond/ir/cron.xml index 893bedb0f0..ac7842a8e9 100644 --- a/trytond/ir/cron.xml +++ b/trytond/ir/cron.xml @@ -69,7 +69,6 @@ this repository contains the full copyright notices and license terms. --> Scheduled Actions ir.cron - form {'active_test': False} Exports ir.action.act_window ir.export - form diff --git a/trytond/ir/lang.xml b/trytond/ir/lang.xml index 253175aa0d..488ae8a0fa 100644 --- a/trytond/ir/lang.xml +++ b/trytond/ir/lang.xml @@ -113,7 +113,6 @@ this repository contains the full copyright notices and license terms. --> Languages ir.lang - form {'active_test': False} Models ir.model - form @@ -113,7 +112,6 @@ this repository contains the full copyright notices and license terms. --> Fields ir.model.field - form @@ -173,7 +171,6 @@ this repository contains the full copyright notices and license terms. --> Models Access ir.model.access - form @@ -230,7 +227,6 @@ this repository contains the full copyright notices and license terms. --> Fields Access ir.model.field.access - form diff --git a/trytond/ir/module/module.xml b/trytond/ir/module/module.xml index 5373dbb426..b55964f5fb 100644 --- a/trytond/ir/module/module.xml +++ b/trytond/ir/module/module.xml @@ -76,7 +76,6 @@ this repository contains the full copyright notices and license terms. --> Modules ir.action.act_window ir.module.module - form [('name', '!=', 'test')] Config Wizard Items ir.module.module.config_wizard.item - form diff --git a/trytond/ir/property.xml b/trytond/ir/property.xml index 1bfba3aec8..a2a4c8ec70 100644 --- a/trytond/ir/property.xml +++ b/trytond/ir/property.xml @@ -39,7 +39,6 @@ this repository contains the full copyright notices and license terms. --> Default Properties ir.action.act_window ir.property - form [('res','=',False)] Properties ir.action.act_window ir.property - form diff --git a/trytond/ir/rule.xml b/trytond/ir/rule.xml index fd91f6fcfd..5d17fc2c81 100644 --- a/trytond/ir/rule.xml +++ b/trytond/ir/rule.xml @@ -57,7 +57,6 @@ this repository contains the full copyright notices and license terms. --> Record Rules ir.rule.group - form diff --git a/trytond/ir/sequence.xml b/trytond/ir/sequence.xml index df63ac675c..1c0bd9da77 100644 --- a/trytond/ir/sequence.xml +++ b/trytond/ir/sequence.xml @@ -71,7 +71,6 @@ this repository contains the full copyright notices and license terms. --> Sequences ir.action.act_window ir.sequence - form {'active_test': False} Sequences Strict ir.action.act_window ir.sequence.strict - form {'active_test': False} Sequence Types ir.action.act_window ir.sequence.type - form diff --git a/trytond/ir/translation.xml b/trytond/ir/translation.xml index 9cecb8651b..ed6b5283ef 100644 --- a/trytond/ir/translation.xml +++ b/trytond/ir/translation.xml @@ -52,7 +52,6 @@ this repository contains the full copyright notices and license terms. --> Translations ir.translation - form [('module', '!=', False)] Triggers ir.trigger - form diff --git a/trytond/ir/ui/icon.xml b/trytond/ir/ui/icon.xml index 96ef1ddf28..2a09b36354 100644 --- a/trytond/ir/ui/icon.xml +++ b/trytond/ir/ui/icon.xml @@ -38,7 +38,6 @@ Icons ir.ui.icon - form diff --git a/trytond/ir/ui/menu.xml b/trytond/ir/ui/menu.xml index 15b2238991..e4b6d22e89 100644 --- a/trytond/ir/ui/menu.xml +++ b/trytond/ir/ui/menu.xml @@ -9,40 +9,12 @@ this repository contains the full copyright notices and license terms. --> childs + ]]> - - Menu - ir.ui.menu - tree - menu - - - - - - - - - ir.ui.menu - tree - - - - - - - - - ]]> - - ir.ui.menu form @@ -69,24 +41,27 @@ this repository contains the full copyright notices and license terms. --> ]]> - - Menus + + + Menu ir.ui.menu - form + menu + + id="act_menu_tree_view1"> - - + + - + + + action="act_menu_tree" id="menu_menu_tree"/> diff --git a/trytond/ir/ui/tree.rnc b/trytond/ir/ui/tree.rnc index 47334de58e..7d46342c83 100644 --- a/trytond/ir/ui/tree.rnc +++ b/trytond/ir/ui/tree.rnc @@ -13,7 +13,7 @@ attlist.tree &= attribute colors { text }? attlist.tree &= [ a:defaultValue = "0" ] attribute fill { "0" | "1" }? attlist.tree &= - [ a:defaultValue = "0" ] attribute toolbar { "0" | "1" }? + [ a:defaultValue = "0" ] attribute keyword_open { "0" | "1" }? field = element field { attlist.field, empty } attlist.field &= attribute name { text } attlist.field &= attribute readonly { "0" | "1" }? diff --git a/trytond/ir/ui/tree.rng b/trytond/ir/ui/tree.rng index 5c33c33cc1..1dfdd1874d 100644 --- a/trytond/ir/ui/tree.rng +++ b/trytond/ir/ui/tree.rng @@ -53,7 +53,7 @@ - + 0 1 diff --git a/trytond/ir/ui/view.py b/trytond/ir/ui/view.py index cad1cd7000..19cad13e43 100644 --- a/trytond/ir/ui/view.py +++ b/trytond/ir/ui/view.py @@ -10,6 +10,7 @@ from trytond.backend import TableHandler from trytond.pyson import PYSONEncoder, CONTEXT, Eval, Not, Bool, Equal from trytond.tools import safe_eval from trytond.transaction import Transaction +from trytond.wizard import Wizard class View(ModelSQL, ModelView): @@ -253,6 +254,81 @@ class ViewShortcut(ModelSQL, ModelView): ViewShortcut() +class AddShortcut(Wizard): + 'Add shortcut' + _name = 'ir.ui.view_sc.add' + + states = { + 'init': { + 'result': { + 'type': 'action', + 'action': '_add_shortcut', + 'state': 'end', + }, + }, + } + + def _add_shortcut(self, data): + view_sc_obj = self.pool.get('ir.ui.view_sc') + model_obj = self.pool.get(data['model']) + + record = model_obj.browse(data['id']) + view_sc_obj.create({ + 'name': record.rec_name, + 'res_id': record.id, + 'user_id': Transaction().user, + 'resource': model_obj._name, + }) + return {} + +AddShortcut() + + +class OpenShortcut(Wizard): + 'Open a shortcut' + _name = 'ir.ui.view_sc.open' + + states = { + 'init': { + 'result': { + 'type': 'action', + 'action': '_open', + 'state': 'end', + } + } + } + + def _open(self, data): + view_sc_obj = self.pool.get('ir.ui.view_sc') + action_keyword_obj = self.pool.get('ir.action.keyword') + + view_sc = view_sc_obj.browse(data['id']) + models = ( + '%s,%d' % (view_sc.resource, view_sc.res_id), + '%s,0' % (view_sc.resource), + ) + action_keyword_ids = None + for model in models: + action_keyword_ids = action_keyword_obj.search([ + ('keyword', '=', 'tree_open'), + ('model', '=', model), + ]) + if action_keyword_ids: + break + if not action_keyword_ids: + return {} + action_keyword = action_keyword_obj.browse(action_keyword_ids[0]) + action_obj = self.pool.get(action_keyword.action.type) + action_ids = action_obj.search([ + ('action.id', '=', action_keyword.action.id), + ]) + if not action_ids: + return {} + return action_obj.read(action_ids[0]) + +OpenShortcut() + + class ViewTreeWidth(ModelSQL, ModelView): "View Tree Width" _name = 'ir.ui.view_tree_width' diff --git a/trytond/ir/ui/view.xml b/trytond/ir/ui/view.xml index cdbcd28f99..33d6fd25be 100644 --- a/trytond/ir/ui/view.xml +++ b/trytond/ir/ui/view.xml @@ -69,7 +69,9 @@ this repository contains the full copyright notices and license terms. --> - + + + + + + + Collections webdav.collection - form - + - + - - - Collections - webdav.collection - form - - - - - - - - - - - diff --git a/trytond/workflow/workflow.xml b/trytond/workflow/workflow.xml index 9abcd322ac..1e09ef63e6 100644 --- a/trytond/workflow/workflow.xml +++ b/trytond/workflow/workflow.xml @@ -38,7 +38,6 @@ this repository contains the full copyright notices and license terms. --> Workflows workflow - form @@ -170,7 +169,6 @@ this repository contains the full copyright notices and license terms. --> Activities workflow.activity - form @@ -245,7 +243,6 @@ this repository contains the full copyright notices and license terms. --> Transitions workflow.transition - form @@ -314,7 +311,6 @@ this repository contains the full copyright notices and license terms. --> Instances workflow.instance - form @@ -366,7 +362,6 @@ this repository contains the full copyright notices and license terms. --> Workitems workflow.workitem - form