diff --git a/__tryton__.py b/__tryton__.py index 5865043cce..dfaaf68bac 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -1,12 +1,11 @@ { - "name" : "Products", + "name" : "Product", "version" : "0.1", "author" : "B2CK", "category" : "Generic Modules", - "description": "Define products, categories of product, units" - "of measure, categories of units of measure.", - "depends" : ["ir","res"], - "xml" : ["product.xml","category.xml","template.xml","uom.xml"], - "installable": True, + "description": "Define products, categories of product, units" \ + "of measure, categories of units of measure.", + "depends" : ["ir", "res"], + "xml" : ["product.xml", "category.xml", "uom.xml"], } diff --git a/category.py b/category.py index 48b60e2881..7c821150dc 100644 --- a/category.py +++ b/category.py @@ -1,5 +1,6 @@ from trytond.osv import fields, OSV + class Category(OSV): "Product Category" _name = "product.category" @@ -10,9 +11,10 @@ class Category(OSV): complete_name = fields.Function('complete_name', type="char", string='Name') parent = fields.Many2One('product.category','Parent Category', select=True) childs = fields.One2Many('product.category', 'parent', - string='Child Categories') + string='Child Categories') - def complete_name(self, cursor, user, ids, name, arg, context=None): + def complete_name(self, cursor, user, obj_id, name, value, arg, + context=None): res = self.name_get(cursor, user, ids, context) return dict(res) @@ -29,9 +31,4 @@ class Category(OSV): res.append((category.id, name)) return res - _constraints = [ - ('check_recursion', - 'Error! You can not create recursive categories.', ['parent']) - ] - Category() diff --git a/category.xml b/category.xml index a0c82b1299..04eaf8a846 100644 --- a/category.xml +++ b/category.xml @@ -1,90 +1,71 @@ - - - - product.category - tree - - - - - - - ]]> - - - - - product.category - form - - - - - - - - - Product category - ir.action.act_window - product.category - form - - - - - - - - - - - - - - - - - - - Product Category - ir.action.act_window - product.category - form - - - - - - - - - - - - - - - - - + + + product.category + tree + + + + + + + ]]> + + + + product.category + form + + + + + Product Categories + product.category + form + + + + + + + + + + + + + + Product Categories + product.category + form + + + + + + + + + + + + + diff --git a/product.xml b/product.xml index fd5bfcac73..1974846325 100644 --- a/product.xml +++ b/product.xml @@ -4,7 +4,7 @@ - + product.product tree @@ -13,6 +13,7 @@ + @@ -22,7 +23,7 @@ - + product.product form @@ -58,56 +59,50 @@ - + Products - ir.action.act_window product.product form - + - - + + - + - - + + + action="act_product_form"/> - - - - + Products - ir.action.act_window product.product form - - + - - + + - + - - + + + action="act_product_form2"/> diff --git a/template.xml b/template.xml deleted file mode 100644 index b13e7d7ae0..0000000000 --- a/template.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/uom.py b/uom.py index da12b0ea3e..f67a9e214c 100644 --- a/uom.py +++ b/uom.py @@ -7,11 +7,9 @@ STATES = { class UomCategory(OSV): 'Product uom category' - _name = 'product.uom.category' _description = __doc__ _order = 'name' - name = fields.Char('Name', size=64, required=True) @@ -20,7 +18,6 @@ UomCategory() class Uom(OSV): 'Unit of measure' - _name = 'product.uom' _description = __doc__ _order = 'name' @@ -43,7 +40,6 @@ class Uom(OSV): required=True,states=STATES,) active = fields.Boolean('Active') - def _factor(self, cursor, user, ids, name, arg, context): res = {} for uom in self.browse(cursor, user, ids, context=context): @@ -87,7 +83,6 @@ class Uom(OSV): def default_rounding(self, cursor, user, context=None): return 0.01 - def on_change_factor(self, cursor, user, ids, value, context=None): if value.get('factor', 0.0) == 0.0: return {'value': {'rate': 0}} diff --git a/uom.xml b/uom.xml index 588888e6e7..d542dd153c 100644 --- a/uom.xml +++ b/uom.xml @@ -1,184 +1,143 @@ - - - - product.uom - tree - - - - - - - - - - ]]> - - - - - product.uom - form - - - - - - - - Units of measure - ir.action.act_window - product.uom - form - - - - - - - - - - - - - - - - - - - Units of measure - ir.action.act_window - product.uom - form - - - - - - - - - - - - - - - - ------------uom categ--------------- - - - product.uom.category - tree - - - - - - - ]]> - - - - - product.uom.category - form - - - - - - - - Categories of Unit of Measure - ir.action.act_window - product.uom.category - form - - - - - - - - - - - - - - - - - - - Categories of Unit of measure - ir.action.act_window - product.uom.category - form - - - - - - - - - - - - - - - - - + + + product.uom + tree + + + + + + + + + + ]]> + + + + product.uom + form + + + + + Units of Measure + product.uom + form + + + + + + + + + + + + + + Units of Measure + product.uom + form + + + + + + + + + + + + + + product.uom.category + tree + + + + + + + ]]> + + + + product.uom.category + form + + + + + Categories of Unit of Measure + product.uom.category + form + + + + + + + + + + + + + + Categories of Unit of measure + product.uom.category + form + + + + + + + + + + + + +