From 68e0b2ae981f5327a9c5fcf398e2348380c5adab Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Fri, 28 Nov 2014 14:25:08 +0100 Subject: [PATCH] [REV] stock: revert of f229d40fb7a2a16c6f211a059694b18124b9719a Reintroduction of field mes_type on product.template. This field was not used in the code anymore, but we keep it for future use. This field allows the user to express that there is no fixed conversion rate between uom and uos. (also very partial revert of 52c3b52bf09fea7e0920ebcec3f0e8acb066b2b7) --- addons/point_of_sale/static/src/js/models.js | 2 +- addons/product/product.py | 2 ++ addons/product/product_view.xml | 1 + .../project_timesheet/test/worktask_entry_to_timesheetline_entry.yml | 1 + addons/sale_mrp/test/sale_mrp.yml | 2 ++ 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index f68f689..355d0ef 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -268,7 +268,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal },{ model: 'product.product', fields: ['display_name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code', - 'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'description_sale', 'description', + 'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description', 'product_tmpl_id'], domain: function(self){ return [['sale_ok','=',true],['available_in_pos','=',true]]; }, context: function(self){ return { pricelist: self.pricelist.id, display_default_code: false }; }, diff --git a/addons/product/product.py b/addons/product/product.py index 9ac7014..128aae5 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -530,6 +530,7 @@ class product_template(osv.osv): 'uos_coeff': fields.float('Unit of Measure -> UOS Coeff', digits_compute= dp.get_precision('Product UoS'), help='Coefficient to convert default Unit of Measure to Unit of Sale\n' ' uos = uom * coeff'), + 'mes_type': fields.selection((('fixed', 'Fixed'), ('variable', 'Variable')), 'Measure Type'), 'company_id': fields.many2one('res.company', 'Company', select=1), # image: all image fields are base64 encoded and PIL-supported 'image': fields.binary("Image", @@ -745,6 +746,7 @@ class product_template(osv.osv): 'uom_id': _get_uom_id, 'uom_po_id': _get_uom_id, 'uos_coeff': 1.0, + 'mes_type': 'fixed', 'categ_id' : _default_category, 'type' : 'consu', 'active': True, diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index c225169..e43da2c 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -126,6 +126,7 @@ + diff --git a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml index 6761d8c..5ba4b83 100644 --- a/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml +++ b/addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml @@ -13,6 +13,7 @@ - !record {model: product.product, id: product_product_hrmanger0}: categ_id: product.product_category_6 + mes_type: fixed name: HR Manager standard_price: 1.0 type: service diff --git a/addons/sale_mrp/test/sale_mrp.yml b/addons/sale_mrp/test/sale_mrp.yml index c74d708..442b341 100644 --- a/addons/sale_mrp/test/sale_mrp.yml +++ b/addons/sale_mrp/test/sale_mrp.yml @@ -16,6 +16,7 @@ !record {model: product.template, id: product_template_slidermobile0}: categ_id: product_category_allproductssellable0 list_price: 200.0 + mes_type: fixed name: Slider Mobile standard_price: 189.0 type: product @@ -27,6 +28,7 @@ !record {model: product.product, id: product_product_slidermobile0}: categ_id: product_category_allproductssellable0 list_price: 200.0 + mes_type: fixed name: Slider Mobile seller_delay: '1' seller_ids: -- 1.7.10.4