[REV] stock: revert of f229d40fb7a2a16c6f211a059694b18124b9719a
authorRichard Mathot <rim@openerp.com>
Fri, 28 Nov 2014 13:25:08 +0000 (14:25 +0100)
committerRichard Mathot <rim@openerp.com>
Fri, 28 Nov 2014 13:25:08 +0000 (14:25 +0100)
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
addons/product/product.py
addons/product/product_view.xml
addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml
addons/sale_mrp/test/sale_mrp.yml

index f68f689..355d0ef 100644 (file)
@@ -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 }; },
index 9ac7014..128aae5 100644 (file)
@@ -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,
index c225169..e43da2c 100644 (file)
                                     <group groups="product.group_uos" string="Unit of Measure">
                                         <field name="uos_id"/>
                                         <field name="uos_coeff"/>
+                                        <field name="mes_type"/>
                                     </group>
                                 </group>
                                 <group name="website_and_pos" col="2">
index 6761d8c..5ba4b83 100644 (file)
@@ -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
index c74d708..442b341 100644 (file)
@@ -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: