diff --git a/addons/mrp/mrp_stock_data.yml b/addons/mrp/mrp_stock_data.yml index 8b9c9abcb65..ac6fc146c76 100644 --- a/addons/mrp/mrp_stock_data.yml +++ b/addons/mrp/mrp_stock_data.yml @@ -1,7 +1,7 @@ - - Set "can_manufacture_for_resupply" at true for warehouse0 by default + Enable the manufacturing in warehouse0 - !python {model: stock.warehouse}: | main_warehouse = self.browse(cr, uid, ref('stock.warehouse0'), context=context) - self.write(cr,uid,main_warehouse.id,{'can_manufacture_for_resupply':True},context=context) + self.write(cr, uid, main_warehouse.id, {'manufacture_to_resupply': True}, context=context) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 129f4b9d667..8e708638331 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -1035,7 +1035,7 @@ - + diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 87716735078..165f5623bb6 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -164,7 +164,6 @@ class StockPicking(osv.osv): return list(set(todo)) - class split_in_production_lot(osv.osv_memory): _inherit = "stock.move.split" @@ -182,19 +181,13 @@ class split_in_production_lot(osv.osv_memory): class stock_warehouse(osv.osv): _inherit = 'stock.warehouse' - _columns = { - 'can_manufacture_for_resupply': fields.boolean('Can manufacture for resupply this warehouse'), - 'manufacture_pull_id': fields.many2one('procurement.rule', 'Manufacture rule'), + _columns = { + 'manufacture_to_resupply': fields.boolean('Manufacture in this Warehouse'), + 'manufacture_pull_id': fields.many2one('procurement.rule', 'Manufacture Rule'), } - _defaults= { - 'manufacture_pull_id' : False - } - - def _get_manufacture_pull_rule(self, cr, uid, warehouse, context=None): - if not warehouse.can_manufacture_for_resupply: - return False -# - route_obj = self.pool.get('stock.location.route') + + def _get_manufacture_pull_rule(self, cr, uid, warehouse, context=None): + route_obj = self.pool.get('stock.location.route') data_obj = self.pool.get('ir.model.data') try: manufacture_route_id = data_obj.get_object_reference(cr, uid, 'stock', 'route_warehouse0_manufacture')[1] @@ -202,68 +195,56 @@ class stock_warehouse(osv.osv): manufacture_route_id = route_obj.search(cr, uid, [('name', 'like', _('Manufacture'))], context=context) manufacture_route_id = manufacture_route_id and manufacture_route_id[0] or False if not manufacture_route_id: - raise osv.except_osv(_('Error!'), _('Can\'t find any generic Manufacture route.')) - - dest_loc = warehouse.in_type_id + raise osv.except_osv(_('Error!'), _('Can\'t find any generic Manufacture route.')) + return { - 'name': warehouse.name + ': ' + _(' Manufacture') + ' -> ' + dest_loc.name, + 'name': self._format_routename(cr, uid, warehouse, _(' Manufacture'), context=context), 'location_id': warehouse.lot_stock_id.id, 'route_id': manufacture_route_id, 'action': 'manufacture', - 'picking_type_id': dest_loc.id, + 'picking_type_id': warehouse.int_type_id.id, 'procure_method': 'make_to_order', - 'active': True, } - - - - def create_routes(self, cr, uid, ids, warehouse, context=None): - pull_obj = self.pool.get('procurement.rule') + + def create_routes(self, cr, uid, ids, warehouse, context=None): + pull_obj = self.pool.get('procurement.rule') res = super(stock_warehouse, self).create_routes(cr, uid, ids, warehouse, context=context) - manufacture_pull_vals = self._get_manufacture_pull_rule(cr, uid, warehouse, context=context) - if manufacture_pull_vals: + if warehouse.manufacture_to_resupply: + manufacture_pull_vals = self._get_manufacture_pull_rule(cr, uid, warehouse, context=context) manufacture_pull_id = pull_obj.create(cr, uid, manufacture_pull_vals, context=context) res['manufacture_pull_id'] = manufacture_pull_id - else: - res['manufacture_pull_id'] = False return res - - + def write(self, cr, uid, ids, vals, context=None): pull_obj = self.pool.get('procurement.rule') if isinstance(ids, (int, long)): ids = [ids] - - #only if update and checkbox have changed ! - if not vals.get("can_manufacture_for_resupply",None) is None: - - if vals.get("can_manufacture_for_resupply",False): + + if 'manufacture_to_resupply' in vals: + if vals.get("manufacture_to_resupply"): for warehouse in self.browse(cr, uid, ids, context=context): if not warehouse.manufacture_pull_id: - warehouse.can_manufacture_for_resupply = True manufacture_pull_vals = self._get_manufacture_pull_rule(cr, uid, warehouse, context=context) manufacture_pull_id = pull_obj.create(cr, uid, manufacture_pull_vals, context=context) vals['manufacture_pull_id'] = manufacture_pull_id else: - for warehouse in self.browse(cr, uid, ids, context=context): + for warehouse in self.browse(cr, uid, ids, context=context): if warehouse.manufacture_pull_id: - pull_obj.unlink(cr, uid, warehouse.manufacture_pull_id.id, context=context) - vals['manufacture_pull_id'] = False - - return super(stock_warehouse,self).write(cr, uid, ids, vals, context=None) - + pull_obj.unlink(cr, uid, warehouse.manufacture_pull_id.id, context=context) + return super(stock_warehouse, self).write(cr, uid, ids, vals, context=None) + def get_all_routes_for_wh(self, cr, uid, warehouse, context=None): - all_routes = super(stock_warehouse,self).get_all_routes_for_wh(cr,uid,warehouse,context=context) - if warehouse.can_manufacture_for_resupply and warehouse.manufacture_pull_id and warehouse.manufacture_pull_id.route_id: - all_routes += [warehouse.manufacture_pull_id.route_id.id] + all_routes = super(stock_warehouse, self).get_all_routes_for_wh(cr, uid, warehouse, context=context) + if warehouse.manufacture_to_resupply and warehouse.manufacture_pull_id and warehouse.manufacture_pull_id.route_id: + all_routes += [warehouse.manufacture_pull_id.route_id.id] return all_routes def _get_all_products_to_resupply(self, cr, uid, warehouse, context=None): - res = super(stock_warehouse,self)._get_all_products_to_resupply(cr, uid, warehouse, context=context) - if warehouse.manufacture_pull_id and warehouse.manufacture_pull_id.route_id: + res = super(stock_warehouse, self)._get_all_products_to_resupply(cr, uid, warehouse, context=context) + if warehouse.manufacture_pull_id and warehouse.manufacture_pull_id.route_id: for product_id in res: - for route in self.pool.get('product.product').browse(cr, uid, product_id, context=context).route_ids: - if route.id == warehouse.manufacture_pull_id.route_id.id: - res.remove(product_id) - break + for route in self.pool.get('product.product').browse(cr, uid, product_id, context=context).route_ids: + if route.id == warehouse.manufacture_pull_id.route_id.id: + res.remove(product_id) + break return res diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index ab1424c2a20..78e6f85b457 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -65,7 +65,6 @@ Dashboard / Reports for Purchase Management will include: 'report/purchase_report_view.xml', 'board_purchase_view.xml', 'edi/purchase_order_action_data.xml', - 'purchase_stock_data.yml', 'res_config_view.xml', ], 'test': [ diff --git a/addons/purchase/purchase_data.xml b/addons/purchase/purchase_data.xml index 9efdf34452c..7bc6478022e 100644 --- a/addons/purchase/purchase_data.xml +++ b/addons/purchase/purchase_data.xml @@ -62,26 +62,14 @@ + --> Buy 5 - - - - diff --git a/addons/purchase/purchase_data.yml b/addons/purchase/purchase_data.yml index bac800958c5..4919470b520 100644 --- a/addons/purchase/purchase_data.yml +++ b/addons/purchase/purchase_data.yml @@ -2,5 +2,12 @@ !python {model: ir.values, id: purchase_default_set}: | whr = self.pool.get('stock.warehouse').browse(cr, uid, ref('stock.warehouse0'), context=context) self.set(cr, uid, 'default',False,'picking_type_id', [('purchase.order', False)], whr.in_type_id.id, True, False, False, False, True) +- + !python {model: stock.warehouse}: | + main_warehouse = self.browse(cr, uid, ref('stock.warehouse0'), context=context) + #Force the rewriting of route and rule + self.write(cr, uid, main_warehouse.id, {'buy_to_resupply': True}, context=context) + + diff --git a/addons/purchase/purchase_stock_data.yml b/addons/purchase/purchase_stock_data.yml deleted file mode 100644 index 84ea1dd7395..00000000000 --- a/addons/purchase/purchase_stock_data.yml +++ /dev/null @@ -1,6 +0,0 @@ -- - !python {model: stock.warehouse}: | - main_warehouse = self.browse(cr, uid, ref('stock.warehouse0'), context=context) - #Force the rewriting of route and rule - self.write(cr,uid,main_warehouse.id,{'can_buy_for_resupply':True},context=context) - diff --git a/addons/purchase/purchase_stock_demo.yml b/addons/purchase/purchase_stock_demo.yml index 71ae5c4bd50..eee20f7c2bc 100644 --- a/addons/purchase/purchase_stock_demo.yml +++ b/addons/purchase/purchase_stock_demo.yml @@ -5,7 +5,7 @@ for wh_ref in wh_to_assign: warehouse = self.browse(cr, uid, ref('stock.' + wh_ref), context=context) #Force the rewriting of route and rule - self.write(cr,uid,warehouse.id,{'can_buy_for_resupply':True},context=context) + self.write(cr, uid, warehouse.id, {'buy_to_resupply': True}, context=context) diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py index aaf8d9e4e6a..0ff88d4ac36 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.py @@ -77,20 +77,16 @@ class stock_picking(osv.osv): class stock_warehouse(osv.osv): _inherit = 'stock.warehouse' - _columns = { - 'can_buy_for_resupply': fields.boolean('Can buy for resupply this warehouse'), - 'buy_pull_id': fields.many2one('procurement.rule', 'BUY rule'), + _columns = { + 'buy_to_resupply': fields.boolean('Purchase to resupply this warehouse'), + 'buy_pull_id': fields.many2one('procurement.rule', 'BUY rule'), } - _defaults= { + _defaults = { 'can_buy_for_resupply': True, - 'buy_pull_id' : False } - - def _get_buy_pull_rule(self, cr, uid, warehouse, context=None): - if not warehouse.can_buy_for_resupply: - return False -# - route_obj = self.pool.get('stock.location.route') + + def _get_buy_pull_rule(self, cr, uid, warehouse, context=None): + route_obj = self.pool.get('stock.location.route') data_obj = self.pool.get('ir.model.data') try: buy_route_id = data_obj.get_object_reference(cr, uid, 'stock', 'route_warehouse0_buy')[1] @@ -98,66 +94,56 @@ class stock_warehouse(osv.osv): buy_route_id = route_obj.search(cr, uid, [('name', 'like', _('Buy'))], context=context) buy_route_id = buy_route_id and buy_route_id[0] or False if not buy_route_id: - raise osv.except_osv(_('Error!'), _('Can\'t find any generic Buy route.')) - - dest_loc = warehouse.in_type_id + raise osv.except_osv(_('Error!'), _('Can\'t find any generic Buy route.')) + return { - 'name': warehouse.name + ': ' + _(' Buy') + ' -> ' + dest_loc.name, + 'name': self._format_routename(cr, uid, warehouse, _(' Buy'), context=context), 'location_id': warehouse.wh_input_stock_loc_id.id, 'route_id': buy_route_id, - 'action': 'move', - 'picking_type_id': dest_loc.id, + 'action': 'buy', + 'picking_type_id': warehouse.in_type_id.id, 'procure_method': 'make_to_order', - 'active': True, } - - def create_routes(self, cr, uid, ids, warehouse, context=None): - pull_obj = self.pool.get('procurement.rule') + + def create_routes(self, cr, uid, ids, warehouse, context=None): + pull_obj = self.pool.get('procurement.rule') res = super(stock_warehouse, self).create_routes(cr, uid, ids, warehouse, context=context) - buy_pull_vals = self._get_buy_pull_rule(cr, uid, warehouse, context=context) - if buy_pull_vals: + if warehouse.buy_to_resupply: + buy_pull_vals = self._get_buy_pull_rule(cr, uid, warehouse, context=context) buy_pull_id = pull_obj.create(cr, uid, buy_pull_vals, context=context) res['buy_pull_id'] = buy_pull_id - else: - res['buy_pull_id'] = False return res - - + def write(self, cr, uid, ids, vals, context=None): pull_obj = self.pool.get('procurement.rule') if isinstance(ids, (int, long)): ids = [ids] - - #only if update and checkbox have changed ! - if not vals.get("can_buy_for_resupply",None) is None: - - if vals.get("can_buy_for_resupply",False): + + if 'buy_to_resupply' in vals: + if vals.get("buy_to_resupply"): for warehouse in self.browse(cr, uid, ids, context=context): if not warehouse.buy_pull_id: - warehouse.can_buy_for_resupply = True buy_pull_vals = self._get_buy_pull_rule(cr, uid, warehouse, context=context) buy_pull_id = pull_obj.create(cr, uid, buy_pull_vals, context=context) vals['buy_pull_id'] = buy_pull_id else: - for warehouse in self.browse(cr, uid, ids, context=context): + for warehouse in self.browse(cr, uid, ids, context=context): if warehouse.buy_pull_id: - buy_pull_id = pull_obj.unlink(cr, uid, warehouse.buy_pull_id.id, context=context) - vals['buy_pull_id'] = False - - return super(stock_warehouse,self).write(cr, uid, ids, vals, context=None) - + buy_pull_id = pull_obj.unlink(cr, uid, warehouse.buy_pull_id.id, context=context) + return super(stock_warehouse, self).write(cr, uid, ids, vals, context=None) + def get_all_routes_for_wh(self, cr, uid, warehouse, context=None): - all_routes = super(stock_warehouse,self).get_all_routes_for_wh(cr,uid,warehouse,context=context) + all_routes = super(stock_warehouse, self).get_all_routes_for_wh(cr, uid, warehouse, context=context) if warehouse.can_buy_for_resupply and warehouse.buy_pull_id and warehouse.buy_pull_id.route_id: - all_routes += [warehouse.buy_pull_id.route_id.id] + all_routes += [warehouse.buy_pull_id.route_id.id] return all_routes def _get_all_products_to_resupply(self, cr, uid, warehouse, context=None): - res = super(stock_warehouse,self)._get_all_products_to_resupply(cr, uid, warehouse, context=context) + res = super(stock_warehouse, self)._get_all_products_to_resupply(cr, uid, warehouse, context=context) if warehouse.buy_pull_id and warehouse.buy_pull_id.route_id: for product_id in res: - for route in self.pool.get('product.product').browse(cr, uid, product_id, context=context).route_ids: - if route.id == warehouse.buy_pull_id.route_id.id: - res.remove(product_id) - break - return res \ No newline at end of file + for route in self.pool.get('product.product').browse(cr, uid, product_id, context=context).route_ids: + if route.id == warehouse.buy_pull_id.route_id.id: + res.remove(product_id) + break + return res diff --git a/addons/purchase/stock_view.xml b/addons/purchase/stock_view.xml index 2d396a8da21..e6f8a211984 100644 --- a/addons/purchase/stock_view.xml +++ b/addons/purchase/stock_view.xml @@ -47,12 +47,10 @@ - + - - On Incoming Shipments diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index 3494fa1fd26..998810b42d6 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -65,7 +65,7 @@ Dashboard / Reports for Warehouse Management will include: 'stock_orderpoint.yml', 'stock_demo.yml', 'stock_location_demo_cpu1.xml', - 'stock_location_demo_cpu3.yml', + 'stock_location_demo_cpu3.yml', ], 'data': [ 'security/stock_security.xml', @@ -113,7 +113,7 @@ Dashboard / Reports for Warehouse Management will include: 'static/lib/sparkline/jquery.sparkline.js', 'static/lib/justgage.js', 'static/src/js/stock_picking_type.js', - 'static/src/js/widgets.js', + 'static/src/js/widgets.js', ], 'qweb': ['static/src/xml/picking.xml'], } diff --git a/addons/stock/static/description/index.html b/addons/stock/static/description/index.html index 3a6881ccb8c..6a197b154bc 100644 --- a/addons/stock/static/description/index.html +++ b/addons/stock/static/description/index.html @@ -234,30 +234,6 @@ picking, batch picking and "by order" picking. - -
-
-

Double Entry Inventory Management

-

Nothing is lost, everything is moved

-
-

-Based on the concept of double entry that revolutionized accounting, OpenERP's -inventory management isn't about consumption, loss or missing products; -products are just moved from one location to another. -

-This allows full traceability (from customer to supplier, not limited to your -warehouse), advanced reporting (e.g. inventory valuation on manufacturing -counter-parts locations) and a very simple user interface. -

-
-
-
- -
-
-
-
-

Cross-Docking some products

@@ -363,6 +339,5 @@ efficiently incoming materials.
-
diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 8cf000e876d..f909c2138ff 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2280,11 +2280,10 @@ class stock_warehouse(osv.osv): 'resupply_wh_ids': fields.many2many('stock.warehouse', 'stock_wh_resupply_table', 'supplied_wh_id', 'supplier_wh_id', 'Resupply Warehouses'), 'resupply_route_ids': fields.one2many('stock.location.route', 'supplied_wh_id', 'Resupply Routes'), 'default_resupply_wh_id': fields.many2one('stock.warehouse', 'Default Resupply Warehouse', domain="[('id','in',resupply_init_filter)]"), - 'show_default_resupply_wh_id': fields.function(show_field_default_wh_resupply,type='boolean',string="Show field default_resupply_wh_id"), - 'resupply_init_filter' : fields.function(init_filtre_default_resupply_wh_id, type='many2one', string='test',relation='stock.warehouse'), - } - - + 'show_default_resupply_wh_id': fields.function(show_field_default_wh_resupply,type='boolean',string="Show field default_resupply_wh_id"), + 'resupply_init_filter' : fields.function(init_filtre_default_resupply_wh_id, type='many2one', string='test',relation='stock.warehouse'), + } + def onchange_filtre_default_resupply_wh_id(self, cr, uid, ids, resupply_wh_ids,default_resupply_wh_id, context=None): resupply_wh_ids = [x['id'] for x in (self.resolve_2many_commands(cr, uid, 'resupply_wh_ids',resupply_wh_ids, ['id']))] print(default_resupply_wh_id,resupply_wh_ids) @@ -2303,7 +2302,7 @@ class stock_warehouse(osv.osv): 'domain':{ 'default_resupply_wh_id':[('id','in',resupply_wh_ids)] }, 'warning': warning } - + def _get_inter_wh_location(self, cr, uid, warehouse, context=None): ''' returns a tuple made of the browse record of customer location and the browse record of supplier location''' data_obj = self.pool.get('ir.model.data') @@ -2371,7 +2370,7 @@ class stock_warehouse(osv.osv): } _sql_constraints = [ ('warehouse_name_uniq', 'unique(name, company_id)', 'The name of the warehouse must be unique per company!'), - ('warehouse_code_uniq', 'unique(code, company_id)', 'The code of the warehouse must be unique per company !'), + ('warehouse_code_uniq', 'unique(code, company_id)', 'The code of the warehouse must be unique per company !'), ] def _get_partner_locations(self, cr, uid, ids, context=None): @@ -2527,12 +2526,12 @@ class stock_warehouse(osv.osv): #return routes and mto pull rule for warehouse return { - 'route_ids': wh_route_ids, - 'mto_pull_id': mto_pull_id, - 'reception_route_id': reception_route_id, - 'delivery_route_id': delivery_route_id, - 'crossdock_route_id': crossdock_route_id, - } + 'route_ids': wh_route_ids, + 'mto_pull_id': mto_pull_id, + 'reception_route_id': reception_route_id, + 'delivery_route_id': delivery_route_id, + 'crossdock_route_id': crossdock_route_id, + } def change_route(self, cr, uid, ids, warehouse, new_reception_step=False, new_delivery_step=False, context=None): picking_type_obj = self.pool.get('stock.picking.type') @@ -2588,7 +2587,6 @@ class stock_warehouse(osv.osv): def create(self, cr, uid, vals, context=None): if context is None: context = {} - if vals is None: vals = {} data_obj = self.pool.get('ir.model.data') @@ -2717,8 +2715,8 @@ class stock_warehouse(osv.osv): warehouse.refresh() #create routes and push/pull rules - ret = self.create_routes(cr, uid, new_id, warehouse, context=context) - self.write(cr, uid, warehouse.id, ret , context=context) + new_objects_dict = self.create_routes(cr, uid, new_id, warehouse, context=context) + self.write(cr, uid, warehouse.id, new_objects_dict, context=context) return new_id def _format_rulename(self, cr, uid, obj, from_loc, dest_loc, context=None): @@ -2738,7 +2736,7 @@ class stock_warehouse(osv.osv): 'crossdock': (_('Cross-Dock'), [(warehouse.wh_input_stock_loc_id, warehouse.wh_output_stock_loc_id, warehouse.int_type_id.id), (warehouse.wh_output_stock_loc_id, customer_loc, warehouse.out_type_id.id)]), 'ship_only': (_('Ship Only'), [(warehouse.lot_stock_id, customer_loc, warehouse.out_type_id.id)]), 'pick_ship': (_('Pick + Ship'), [(warehouse.lot_stock_id, warehouse.wh_output_stock_loc_id, warehouse.pick_type_id.id), (warehouse.wh_output_stock_loc_id, customer_loc, warehouse.out_type_id.id)]), - 'pick_pack_ship': (_('Pick + Pack + Ship'), [(warehouse.lot_stock_id, warehouse.wh_pack_stock_loc_id, warehouse.int_type_id.id), (warehouse.wh_pack_stock_loc_id, warehouse.wh_output_stock_loc_id, warehouse.pack_type_id.id), (warehouse.wh_output_stock_loc_id, customer_loc, warehouse.out_type_id.id)]), + 'pick_pack_ship': (_('Pick + Pack + Ship'), [(warehouse.lot_stock_id, warehouse.wh_pack_stock_loc_id, warehouse.int_type_id.id), (warehouse.wh_pack_stock_loc_id, warehouse.wh_output_stock_loc_id, warehouse.pack_type_id.id), (warehouse.wh_output_stock_loc_id, customer_loc, warehouse.out_type_id.id)]), } def write(self, cr, uid, ids, vals, context=None): @@ -2746,7 +2744,6 @@ class stock_warehouse(osv.osv): context = {} if isinstance(ids, (int, long)): ids = [ids] - seq_obj = self.pool.get('ir.sequence') location_obj = self.pool.get('stock.location') route_obj = self.pool.get('stock.location.route') @@ -3227,16 +3224,6 @@ class stock_warehouse_orderpoint(osv.osv): return True - def _check_uniq_name(self, cr, uid, ids, context=None): - if not context: - context = {} - - for name in self.browse(cr, uid, ids, context=context): - if rule.product_id.uom_id.category_id.id != rule.product_uom.category_id.id: - return False - - return True - _columns = { 'name': fields.char('Name', size=32, required=True), 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the orderpoint without removing it."), @@ -3267,10 +3254,10 @@ class stock_warehouse_orderpoint(osv.osv): 'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=context) } _sql_constraints = [ - ('qty_multiple_check', 'CHECK( qty_multiple > 0 )', 'Qty Multiple must be greater than zero.'), + ('qty_multiple_check', 'CHECK( qty_multiple > 0 )', 'Qty Multiple must be greater than zero.'), ] _constraints = [ - (_check_product_uom, 'You have to select a product unit of measure in the same category than the default unit of measure of the product', ['product_id', 'product_uom']), + (_check_product_uom, 'You have to select a product unit of measure in the same category than the default unit of measure of the product', ['product_id', 'product_uom']), ] def default_get(self, cr, uid, fields, context=None): diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index ba690ef045c..47b32f17ff0 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -676,7 +676,7 @@ - +