From 8724d54fb083f8868db4ae520fb274a7ede97a15 Mon Sep 17 00:00:00 2001 From: Carlos Incaser Date: Fri, 11 Dec 2015 02:41:01 +0100 Subject: [PATCH] [IMP][8.0] base_custom_info: Actions and menus. Refactor strings Info to Property --- base_custom_info/__openerp__.py | 1 + .../models/custom_info_template.py | 10 +-- .../views/custom_info_template_view.xml | 81 ++++++++++++++++--- 3 files changed, 78 insertions(+), 14 deletions(-) diff --git a/base_custom_info/__openerp__.py b/base_custom_info/__openerp__.py index f9b4f68f4..7bcc581bf 100644 --- a/base_custom_info/__openerp__.py +++ b/base_custom_info/__openerp__.py @@ -12,6 +12,7 @@ 'base', ], 'data': [ + 'views/custom_info_template_view.xml' ], 'author': 'Antiun IngenierĂ­a S.L., ' 'Incaser Informatica S.L., ', diff --git a/base_custom_info/models/custom_info_template.py b/base_custom_info/models/custom_info_template.py index 37fb7fc45..505166abb 100644 --- a/base_custom_info/models/custom_info_template.py +++ b/base_custom_info/models/custom_info_template.py @@ -14,7 +14,7 @@ class CustomInfoTemplate(models.Model): info_ids = fields.One2many( comodel_name='custom.info.template.line', inverse_name='template_id', - string='Info') + string='Properties') class CustomInfoTemplateLine(models.Model): @@ -27,7 +27,7 @@ class CustomInfoTemplateLine(models.Model): info_value_ids = fields.One2many( comodel_name="custom.info.value", inverse_name="custom_info_name_id", - string="Info Values") + string="Property Values") class CustomInfoValue(models.Model): @@ -38,7 +38,7 @@ class CustomInfoValue(models.Model): res_id = fields.Integer(select=True) custom_info_name_id = fields.Many2one( comodel_name='custom.info.template.line', - string='Info Name') + string='Property Name') value = fields.Char() @@ -47,13 +47,13 @@ class CustomInfo(models.AbstractModel): custom_info_template_id = fields.Many2one( comodel_name='custom.info.template', - string='Info Template') + string='Property Template') custom_info_ids = fields.One2many( comodel_name='custom.info.value', inverse_name='res_id', domain=lambda self: [('model', '=', self._name)], auto_join=True, - string='Custom Info') + string='Custom Properties') @api.onchange('custom_info_template_id') def _onchange_custom_info_template_id(self): diff --git a/base_custom_info/views/custom_info_template_view.xml b/base_custom_info/views/custom_info_template_view.xml index 660577421..e432e5336 100644 --- a/base_custom_info/views/custom_info_template_view.xml +++ b/base_custom_info/views/custom_info_template_view.xml @@ -2,15 +2,29 @@ + + + + base.custom.info.template.tree + custom.info.template + + + + + + + + + base.custom.info.template.form - base.custom.info.template + custom.info.template
- + @@ -24,21 +38,46 @@ - - base.custom.info.template.tree - base.custom.info.template + + Templates + ir.actions.act_window + custom.info.template + tree,form + form + + + +

+ Click to define a new custom info template. +

+ You must define a custom info template for every different + product properties group. +

+
+
+ + + + + + + + + base.custom.info.template.line.tree + custom.info.template.line - - + base.custom.info.template.line.form - base.custom.info.template.line + custom.info.template.line @@ -54,9 +93,22 @@ + + Properties + ir.actions.act_window + custom.info.template.line + tree,form + form + + + + + + base.custom.info.value.tree - base.custom.info.value + custom.info.value @@ -67,5 +119,16 @@ + + Values + ir.actions.act_window + custom.info.value + tree,form + form + + + +