diff --git a/addons/board_manufacturing/board_manufacturing_view.xml b/addons/board_manufacturing/board_manufacturing_view.xml index b223f12e614..37624d6e025 100644 --- a/addons/board_manufacturing/board_manufacturing_view.xml +++ b/addons/board_manufacturing/board_manufacturing_view.xml @@ -15,7 +15,7 @@ - + diff --git a/addons/board_warehouse/board_warehouse_view.xml b/addons/board_warehouse/board_warehouse_view.xml index 4ce02a71dc4..08ece3f821d 100644 --- a/addons/board_warehouse/board_warehouse_view.xml +++ b/addons/board_warehouse/board_warehouse_view.xml @@ -23,7 +23,7 @@
- + diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index e720de2bee7..b5a0be6a776 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -837,7 +837,7 @@ class mrp_production(osv.osv): seq_obj = self.pool.get('ir.sequence') pick_obj = self.pool.get('stock.picking') move_obj = self.pool.get('stock.move') - proc_obj = self.pool.get('mrp.procurement') + proc_obj = self.pool.get('procurement.order') wf_service = netsvc.LocalService("workflow") for production in self.browse(cr, uid, ids): if not production.product_lines: @@ -931,7 +931,7 @@ class mrp_production(osv.osv): 'move_id': move_id, 'company_id': production.company_id.id, }) - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr) + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) proc_ids.append(proc_id) wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr) self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'}) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 6ee63420fae..74affb271da 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -406,9 +406,9 @@ Procurement --> - - + @@ -813,9 +813,9 @@ --> - mrp.procurement.form.inherit - mrp.procurement - + procurement.order.form.inherit + procurement.order + form diff --git a/addons/mrp/process/procurement_process.xml b/addons/mrp/process/procurement_process.xml index 25c204a2705..16369eef298 100644 --- a/addons/mrp/process/procurement_process.xml +++ b/addons/mrp/process/procurement_process.xml @@ -4,7 +4,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -95,7 +95,7 @@ - + diff --git a/addons/mrp/process/service_product_process.xml b/addons/mrp/process/service_product_process.xml index 60bf3b562b9..a96a7a7bd4d 100644 --- a/addons/mrp/process/service_product_process.xml +++ b/addons/mrp/process/service_product_process.xml @@ -8,7 +8,7 @@ - + @@ -18,7 +18,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/addons/mrp/process/stockable_product_process.xml b/addons/mrp/process/stockable_product_process.xml index c053103f476..bb5c36a015a 100644 --- a/addons/mrp/process/stockable_product_process.xml +++ b/addons/mrp/process/stockable_product_process.xml @@ -8,7 +8,7 @@ - + @@ -18,7 +18,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py index 4ebd11f3949..d704afa46d6 100644 --- a/addons/mrp/procurement.py +++ b/addons/mrp/procurement.py @@ -27,8 +27,8 @@ import ir import netsvc import time -class mrp_procurement(osv.osv): - _inherit = 'mrp.procurement' +class procurement_order(osv.osv): + _inherit = 'procurement.order' _columns = { 'bom_id': fields.many2one('mrp.bom', 'BoM', ondelete='cascade', select=True), } @@ -40,7 +40,7 @@ class mrp_procurement(osv.osv): properties = [x.id for x in procurement.property_ids] bom_id = self.pool.get('mrp.bom')._bom_find(cr, uid, procurement.product_id.id, procurement.product_uom.id, properties) if not bom_id: - cr.execute('update mrp_procurement set message=%s where id=%s', (_('No BoM defined for this product !'), procurement.id)) + cr.execute('update procurement_order set message=%s where id=%s', (_('No BoM defined for this product !'), procurement.id)) return False return True @@ -48,7 +48,7 @@ class mrp_procurement(osv.osv): """ This is action which call from workflow to assign production order to procurements @return: True """ - procurement_obj = self.pool.get('mrp.procurement') + procurement_obj = self.pool.get('procurement.order') res = procurement_obj.make_mo(cr, uid, ids, context=context) res = res.values() return len(res) and res[0] or 0 #TO CHECK: why workflow is generated error if return not integer value @@ -62,7 +62,7 @@ class mrp_procurement(osv.osv): production_obj = self.pool.get('mrp.production') move_obj = self.pool.get('stock.move') wf_service = netsvc.LocalService("workflow") - procurement_obj = self.pool.get('mrp.procurement') + procurement_obj = self.pool.get('procurement.order') for procurement in procurement_obj.browse(cr, uid, ids): res_id = procurement.move_id.id loc_id = procurement.location_id.id @@ -91,6 +91,6 @@ class mrp_procurement(osv.osv): {'location_id': procurement.location_id.id}) return res -mrp_procurement() +procurement_order() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv index d5e00b9cbda..8f58f7179ad 100644 --- a/addons/mrp/security/ir.model.access.csv +++ b/addons/mrp/security/ir.model.access.csv @@ -7,7 +7,7 @@ "access_mrp_production","mrp.production","model_mrp_production","mrp.group_mrp_user",1,1,1,1 "access_mrp_production_workcenter_line","mrp.production.workcenter.line","model_mrp_production_workcenter_line","mrp.group_mrp_user",1,1,1,1 "access_mrp_production_product_line","mrp.production.product.line","model_mrp_production_product_line","mrp.group_mrp_user",1,1,1,1 -"access_mrp_procurement","mrp.procurement","model_mrp_procurement","mrp.group_mrp_user",1,1,1,1 +"access_procurement","procurement.order","model_procurement_order","mrp.group_mrp_user",1,1,1,1 "access_mrp_workcenter_manager","mrp.workcenter.manager","model_mrp_workcenter","mrp.group_mrp_user",1,1,1,1 "access_mrp_routing_manager","mrp.routing.manager","model_mrp_routing","mrp.group_mrp_manager",1,1,1,1 "access_mrp_routing_workcenter_manager","mrp.routing.workcenter.manager","model_mrp_routing_workcenter","mrp.group_mrp_manager",1,1,1,1 @@ -22,7 +22,7 @@ "access_purchase_order_mrp_worker","purchase.order mrp_worker","purchase.model_purchase_order","mrp.group_mrp_user",1,0,0,0 "access_purchase_order_line_mrp_worker","purchase.order.line mrp_worker","purchase.model_purchase_order_line","mrp.group_mrp_user",1,0,0,0 "access_hr_timesheet_group_mrp_worker","resource.calendar mrp_worker","resource.model_resource_calendar","mrp.group_mrp_user",1,0,0,0 -"access_mrp_procurement_stock_worker","mrp.procurement stock_worker","model_mrp_procurement","stock.group_stock_user",1,1,1,1 +"access_procurement_stock_worker","procurement.order stock_worker","model_procurement_order","stock.group_stock_user",1,1,1,1 "access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0 "access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0 "access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0 diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 9bcc92e5c81..f319c2209fd 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -51,7 +51,7 @@ class stock_warehouse_orderpoint(osv.osv): "a procurement to bring the virtual stock to the Max Quantity."), 'qty_multiple': fields.integer('Qty Multiple', required=True, help="The procurement quantity will by rounded up to this multiple."), - 'procurement_id': fields.many2one('mrp.procurement', 'Latest procurement', ondelete="set null"), + 'procurement_id': fields.many2one('procurement.order', 'Latest procurement', ondelete="set null"), 'company_id': fields.many2one('res.company','Company',required=True), } _defaults = { @@ -103,7 +103,7 @@ class StockMove(osv.osv): _columns = { 'production_id': fields.many2one('mrp.production', 'Production', select=True), - 'procurements': fields.one2many('mrp.procurement', 'move_id', 'Procurements'), + 'procurements': fields.one2many('procurement.order', 'move_id', 'Procurements'), } def copy(self, cr, uid, id, default=None, context=None): @@ -118,7 +118,7 @@ class StockMove(osv.osv): """ bom_obj = self.pool.get('mrp.bom') move_obj = self.pool.get('stock.move') - procurement_obj = self.pool.get('mrp.procurement') + procurement_obj = self.pool.get('procurement.order') product_obj = self.pool.get('product.product') wf_service = netsvc.LocalService("workflow") if move.product_id.supply_method == 'produce' and move.product_id.procure_method == 'make_to_order': @@ -166,7 +166,7 @@ class StockMove(osv.osv): 'move_id': mid, 'company_id': line['company_id'], }) - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr) + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) move_obj.write(cr, uid, [move.id], { 'location_id': move.location_dest_id.id, 'auto_validate': True, @@ -175,7 +175,7 @@ class StockMove(osv.osv): 'state': 'waiting' }) for m in procurement_obj.search(cr, uid, [('move_id','=',move.id)], context): - wf_service.trg_validate(uid, 'mrp.procurement', m, 'button_wait_done', cr) + wf_service.trg_validate(uid, 'procurement.order', m, 'button_wait_done', cr) return True def action_consume(self, cr, uid, ids, product_qty, location_id=False, context=None): @@ -231,7 +231,7 @@ class StockPicking(osv.osv): for move in picking.move_lines: if move.state == 'done' and move.procurements: for procurement in move.procurements: - wf_service.trg_validate(user, 'mrp.procurement', + wf_service.trg_validate(user, 'procurement.order', procurement.id, 'button_check', cursor) return res diff --git a/addons/mrp/test/mrp_phantom_bom.yml b/addons/mrp/test/mrp_phantom_bom.yml index c95ab26dd93..4a3e2e3e1da 100644 --- a/addons/mrp/test/mrp_phantom_bom.yml +++ b/addons/mrp/test/mrp_phantom_bom.yml @@ -180,15 +180,15 @@ - I am checking Procurement orders. There are 3 orders generated for Oranges, Sugar and Water. - - !python {model: mrp.procurement}: | + !python {model: procurement.order}: | from tools.translate import _ proc_ids = self.search(cr, uid, [('state','!=','cofirmed')]) assert proc_ids, _('No Procurements!') - The scheduler runs. - - !function {model: mrp.procurement, name: run_scheduler}: - - model: mrp.procurement + !function {model: procurement.order, name: run_scheduler}: + - model: procurement.order search: "[('state','!=','cofirmed')]" - I am checking Internal picking. I see one picking for Orange juice and its diff --git a/addons/mrp/test/mrp_procurement.yml b/addons/mrp/test/mrp_procurement.yml index c52fa4a339b..1fe0f74fa6a 100644 --- a/addons/mrp/test/mrp_procurement.yml +++ b/addons/mrp/test/mrp_procurement.yml @@ -129,7 +129,7 @@ - I create a procurement order for product Shirt. - - !record {model: mrp.procurement, id: mrp_procurement_shirt0}: + !record {model: procurement.order, id: procurement_order_shirt0}: name: 'PROC: Shirt' product_id: product_product_shirt0 product_qty: 5.00 @@ -138,11 +138,11 @@ - I confirm the procurement order. - - !workflow {model: mrp.procurement, action: button_confirm, ref: mrp_procurement_shirt0} + !workflow {model: procurement.order, action: button_confirm, ref: procurement_order_shirt0} - I run the procurement. - - !workflow {model: mrp.procurement, action: button_check, ref: mrp_procurement_shirt0} + !workflow {model: procurement.order, action: button_check, ref: procurement_order_shirt0} - I see that there is a manufacturing order for Shirt. - @@ -153,15 +153,15 @@ - I also check that there are two more procurement orders for sub products Cloth and Buttons. - - !python {model: mrp.procurement}: | + !python {model: procurement.order}: | from tools.translate import _ proc_ids = self.search(cr, uid, [('product_id','in',[ref('product_product_cloth0'),ref('product_product_buttons0')])]) assert proc_ids, 'No Procurements.' - The scheduler runs. - - !function {model: mrp.procurement, name: run_scheduler}: - - model: mrp.procurement + !function {model: procurement.order, name: run_scheduler}: + - model: procurement.order search: "[]" - I check that there is one purchase order for Cloth. @@ -290,8 +290,8 @@ - Run scheduler again. - - !function {model: mrp.procurement, name: run_scheduler}: - - model: mrp.procurement + !function {model: procurement.order, name: run_scheduler}: + - model: procurement.order search: "[]" - Check state of manufacturing order for Shirt. diff --git a/addons/mrp/test/mrp_production_order.yml b/addons/mrp/test/mrp_production_order.yml index 861f52e9c61..0ceebfab107 100644 --- a/addons/mrp/test/mrp_production_order.yml +++ b/addons/mrp/test/mrp_production_order.yml @@ -84,15 +84,15 @@ - I am checking Procurement orders. - - !python {model: mrp.procurement}: | + !python {model: procurement.order}: | from tools.translate import _ proc_ids = self.search(cr, uid, [('state','!=','confirmed')]) assert proc_ids, _('No Procurements!') - The scheduler runs. - - !function {model: mrp.procurement, name: run_scheduler}: - - model: mrp.procurement + !function {model: procurement.order, name: run_scheduler}: + - model: procurement.order search: "[('state','=','confirmed')]" - I am checking Internal picking. diff --git a/addons/mrp_operations/test/mrp_operations.yml b/addons/mrp_operations/test/mrp_operations.yml index 32b596389e9..f5777d4cc95 100644 --- a/addons/mrp_operations/test/mrp_operations.yml +++ b/addons/mrp_operations/test/mrp_operations.yml @@ -36,15 +36,15 @@ - I am checking Procurement orders. - - !python {model: mrp.procurement}: | + !python {model: procurement.order}: | from tools.translate import _ proc_ids = self.search(cr, uid, [('state','=','confirmed')]) assert proc_ids, _('No Procurements!') - The scheduler runs. - - !function {model: mrp.procurement, name: run_scheduler}: - - model: mrp.procurement + !function {model: procurement.order, name: run_scheduler}: + - model: procurement.order search: "[('state','=','confirmed')]" - I am checking Internal picking. diff --git a/addons/point_of_sale/posrule_data.xml b/addons/point_of_sale/posrule_data.xml index 494571122ac..905e78e6e7a 100644 --- a/addons/point_of_sale/posrule_data.xml +++ b/addons/point_of_sale/posrule_data.xml @@ -132,7 +132,7 @@ - + @@ -474,12 +474,12 @@ - + - + diff --git a/addons/point_of_sale/posrule_data2.xml b/addons/point_of_sale/posrule_data2.xml index da802669d59..7ac787db54c 100644 --- a/addons/point_of_sale/posrule_data2.xml +++ b/addons/point_of_sale/posrule_data2.xml @@ -214,7 +214,7 @@ - + @@ -557,12 +557,12 @@ - + - + diff --git a/addons/procurement/process/procurement_process.xml b/addons/procurement/process/procurement_process.xml index b537eeed865..e5b94bb225d 100644 --- a/addons/procurement/process/procurement_process.xml +++ b/addons/procurement/process/procurement_process.xml @@ -8,7 +8,7 @@ - + diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index ceaefb4c4db..e3156707d4d 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -62,11 +62,11 @@ mrp_property() # Produce, Buy or Find products and place a move # then wizard for picking lists & move # -class mrp_procurement(osv.osv): +class procurement_order(osv.osv): """ Procurement Orders """ - _name = "mrp.procurement" + _name = "procurement.order" _description = "Procurement" _order = 'priority,date_planned desc' _log_create = False @@ -92,7 +92,7 @@ class mrp_procurement(osv.osv): 'note': fields.text('Note'), - 'property_ids': fields.many2many('mrp.property', 'mrp_procurement_property_rel', 'procurement_id','property_id', 'Properties'), + 'property_ids': fields.many2many('mrp.property', 'procurement_property_rel', 'procurement_id','property_id', 'Properties'), 'message': fields.char('Latest error', size=64, help="Exception occurred while computing procurement orders."), 'state': fields.selection([ @@ -115,7 +115,7 @@ class mrp_procurement(osv.osv): 'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), 'close_move': lambda *a: 0, 'procure_method': lambda *a: 'make_to_order', - 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.procurement', context=c) + 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'procurement.order', context=c) } def unlink(self, cr, uid, ids, context=None): @@ -176,7 +176,7 @@ class mrp_procurement(osv.osv): return res # - # This method may be overrided by objects that override mrp.procurment + # This method may be overrided by objects that override procurement.order # for computing their own purpose # def _quantity_compute_get(self, cr, uid, proc, context={}): @@ -286,7 +286,7 @@ class mrp_procurement(osv.osv): if procurement.product_id.product_tmpl_id.supply_method <> 'buy': return False if not procurement.product_id.seller_ids: - cr.execute('update mrp_procurement set message=%s where id=%s', (_('No supplier defined for this product !'), procurement.id)) + cr.execute('update procurement_order set message=%s where id=%s', (_('No supplier defined for this product !'), procurement.id)) return False partner = procurement.product_id.seller_ids[0].name if user.company_id and user.company_id.partner_id: @@ -294,7 +294,7 @@ class mrp_procurement(osv.osv): return False address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery'] if not address_id: - cr.execute('update mrp_procurement set message=%s where id=%s', (_('No address defined for the supplier'), procurement.id)) + cr.execute('update procurement_order set message=%s where id=%s', (_('No address defined for the supplier'), procurement.id)) return False return True @@ -358,7 +358,7 @@ class mrp_procurement(osv.osv): ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id]) cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,)) if not cr.fetchone()[0]: - cr.execute('update mrp_procurement set message=%s where id=%s', (_('Stock is not enough and No minimum orderpoint rule defined'), procurement.id)) + cr.execute('update procurement_order set message=%s where id=%s', (_('Stock is not enough and No minimum orderpoint rule defined'), procurement.id)) return ok def action_produce_assign_service(self, cr, uid, ids, context={}): @@ -403,7 +403,7 @@ class mrp_procurement(osv.osv): self.write(cr, uid, ids, {'state': 'cancel'}) wf_service = netsvc.LocalService("workflow") for id in ids: - wf_service.trg_trigger(uid, 'mrp.procurement', id, cr) + wf_service.trg_trigger(uid, 'procurement.order', id, cr) return True def action_check_finnished(self, cr, uid, ids): @@ -439,7 +439,7 @@ class mrp_procurement(osv.osv): res = self.write(cr, uid, ids, {'state': 'done', 'date_close': time.strftime('%Y-%m-%d')}) wf_service = netsvc.LocalService("workflow") for id in ids: - wf_service.trg_trigger(uid, 'mrp.procurement', id, cr) + wf_service.trg_trigger(uid, 'procurement.order', id, cr) return res def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, context=None): @@ -452,7 +452,7 @@ class mrp_procurement(osv.osv): self._procure_orderpoint_confirm(cr, uid, automatic=automatic,\ use_new_cursor=use_new_cursor, context=context) -mrp_procurement() +procurement_order() class stock_warehouse_orderpoint(osv.osv): @@ -460,16 +460,16 @@ class stock_warehouse_orderpoint(osv.osv): Defines Minimum stock rules. """ _name = "stock.warehouse.orderpoint" - _description = "Orderpoint minimum rule" - + _description = "Minimum Inventory Rule" + _columns = { 'name': fields.char('Name', size=32, required=True), 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the orderpoint without removing it."), 'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True), - 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True), - 'location_id': fields.many2one('stock.location', 'Location', required=True), + 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True, ondelete="cascade"), + 'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete="cascade"), 'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]), - 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True ), + 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True), 'product_min_qty': fields.float('Min Quantity', required=True, help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\ "a procurement to bring the virtual stock to the Max Quantity."), @@ -478,7 +478,7 @@ class stock_warehouse_orderpoint(osv.osv): "a procurement to bring the virtual stock to the Max Quantity."), 'qty_multiple': fields.integer('Qty Multiple', required=True, help="The procurement quantity will by rounded up to this multiple."), - 'procurement_id': fields.many2one('mrp.procurement', 'Latest procurement'), + 'procurement_id': fields.many2one('procurement.order', 'Latest procurement', ondelete="set null"), 'company_id': fields.many2one('res.company','Company',required=True), } _defaults = { @@ -489,7 +489,10 @@ class stock_warehouse_orderpoint(osv.osv): 'product_uom': lambda sel, cr, uid, context: context.get('product_uom', False), 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=c) } - + _sql_constraints = [ + ('qty_multiple_check', 'CHECK( qty_multiple > 0 )', _('Qty Multiple must be greater than zero.')), + ] + def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context={}): """ Finds location id for changed warehouse. @param warehouse_id: Changed id of warehouse. @@ -500,7 +503,7 @@ class stock_warehouse_orderpoint(osv.osv): v = {'location_id': w.lot_stock_id.id} return {'value': v} return {} - + def onchange_product_id(self, cr, uid, ids, product_id, context={}): """ Finds UoM for changed product. @param product_id: Changed id of product. @@ -511,7 +514,7 @@ class stock_warehouse_orderpoint(osv.osv): v = {'product_uom': prod.uom_id.id} return {'value': v} return {} - + def copy(self, cr, uid, id, default=None,context={}): if not default: default = {} @@ -519,6 +522,6 @@ class stock_warehouse_orderpoint(osv.osv): 'name': self.pool.get('ir.sequence').get(cr, uid, 'mrp.warehouse.orderpoint') or '', }) return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context) - + stock_warehouse_orderpoint() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/procurement/procurement_data.xml b/addons/procurement/procurement_data.xml index 256472bd2fd..9422e92c422 100644 --- a/addons/procurement/procurement_data.xml +++ b/addons/procurement/procurement_data.xml @@ -10,7 +10,7 @@ days -1 - + diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml index 1defa214754..b97caf6e630 100644 --- a/addons/procurement/procurement_view.xml +++ b/addons/procurement/procurement_view.xml @@ -5,9 +5,9 @@ Procurement --> - - mrp.procurement.tree - mrp.procurement + + procurement.order.tree + procurement.order tree @@ -22,9 +22,9 @@ - - mrp.procurement.form - mrp.procurement + + procurement.order.form + procurement.order form @@ -79,9 +79,9 @@ - - mrp.procurement.select - mrp.procurement + + procurement.order.select + procurement.order search @@ -109,51 +109,51 @@ - + Procurement Orders ir.actions.act_window - mrp.procurement + procurement.order form {'search_default_current':1} - + {'search_default_Current':1} - + Procurements ir.actions.act_window - mrp.procurement + procurement.order form tree,form - + [] {} - + Procurement Exceptions ir.actions.act_window - mrp.procurement + procurement.order form tree,form [('state','=','exception')] - + Procurement Exceptions to Fix ir.actions.act_window - mrp.procurement + procurement.order form tree,form [('state','=','exception'), ('message', '<>', '')] - + Temporary Procurement Exceptions ir.actions.act_window - mrp.procurement + procurement.order form tree,form [('state','=','exception'), ('message', '=', '')] @@ -255,17 +255,17 @@ + src_model="procurement.order"/> + src_model="procurement.order"/> diff --git a/addons/procurement/procurement_workflow.xml b/addons/procurement/procurement_workflow.xml index 599d11cfe01..17979868a03 100644 --- a/addons/procurement/procurement_workflow.xml +++ b/addons/procurement/procurement_workflow.xml @@ -3,8 +3,8 @@ - mrp.procurement.basic - mrp.procurement + procurement.order.basic + procurement.order True diff --git a/addons/procurement/schedulers.py b/addons/procurement/schedulers.py index 6ebc0f61fad..4251acf1d28 100644 --- a/addons/procurement/schedulers.py +++ b/addons/procurement/schedulers.py @@ -26,8 +26,8 @@ from mx import DateTime import time -class mrp_procurement(osv.osv): - _inherit = 'mrp.procurement' +class procurement_order(osv.osv): + _inherit = 'procurement.order' def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None): ''' @@ -40,11 +40,11 @@ class mrp_procurement(osv.osv): cr = pooler.get_db(use_new_cursor).cursor() wf_service = netsvc.LocalService("workflow") - procurement_obj = self.pool.get('mrp.procurement') + procurement_obj = self.pool.get('procurement.order') if not ids: ids = procurement_obj.search(cr, uid, [], order="date_planned") for id in ids: - wf_service.trg_validate(uid, 'mrp.procurement', id, 'button_restart', cr) + wf_service.trg_validate(uid, 'procurement.order', id, 'button_restart', cr) if use_new_cursor: cr.commit() @@ -57,11 +57,11 @@ class mrp_procurement(osv.osv): report_except = 0 report_later = 0 while True: - cr.execute('select id from mrp_procurement where state=%s and procure_method=%s order by priority,date_planned limit 500 offset %s', ('confirmed', 'make_to_order', offset)) + cr.execute('select id from procurement_order where state=%s and procure_method=%s order by priority,date_planned limit 500 offset %s', ('confirmed', 'make_to_order', offset)) ids = map(lambda x: x[0], cr.fetchall()) for proc in procurement_obj.browse(cr, uid, ids): if (maxdate.strftime('%Y-%m-%d') >= proc.date_planned): - wf_service.trg_validate(uid, 'mrp.procurement', proc.id, 'button_check', cr) + wf_service.trg_validate(uid, 'procurement.order', proc.id, 'button_check', cr) else: offset += 1 report_later += 1 @@ -84,7 +84,7 @@ class mrp_procurement(osv.osv): ids = procurement_obj.search(cr, uid, [('state', '=', 'confirmed'), ('procure_method', '=', 'make_to_stock')], offset=offset) for proc in procurement_obj.browse(cr, uid, ids): if ((maxdate).strftime('%Y-%m-%d') >= proc.date_planned) : - wf_service.trg_validate(uid, 'mrp.procurement', proc.id, 'button_check', cr) + wf_service.trg_validate(uid, 'procurement.order', proc.id, 'button_check', cr) report_ids.append(proc.id) else: report_later += 1 @@ -129,7 +129,7 @@ class mrp_procurement(osv.osv): if not context: context = {} product_obj = self.pool.get('product.product') - proc_obj = self.pool.get('mrp.procurement') + proc_obj = self.pool.get('procurement.order') warehouse_obj = self.pool.get('stock.warehouse') wf_service = netsvc.LocalService("workflow") @@ -161,8 +161,8 @@ class mrp_procurement(osv.osv): 'location_id': location_id, 'procure_method': 'make_to_order', }) - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr) - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_check', cr) + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr) def _procure_orderpoint_confirm(self, cr, uid, automatic=False,\ use_new_cursor=False, context=None, user_id=False): @@ -175,7 +175,7 @@ class mrp_procurement(osv.osv): cr = pooler.get_db(use_new_cursor).cursor() orderpoint_obj = self.pool.get('stock.warehouse.orderpoint') location_obj = self.pool.get('stock.location') - procurement_obj = self.pool.get('mrp.procurement') + procurement_obj = self.pool.get('procurement.order') request_obj = self.pool.get('res.request') wf_service = netsvc.LocalService("workflow") report = [] @@ -217,9 +217,9 @@ class mrp_procurement(osv.osv): 'procure_method': 'make_to_order', 'origin': op.name }) - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr) orderpoint_obj.write(cr, uid, [op.id], {'procurement_id': proc_id}) @@ -237,6 +237,6 @@ class mrp_procurement(osv.osv): cr.commit() cr.close() return {} -mrp_procurement() +procurement_order() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/procurement/scripts/scheduler.py b/addons/procurement/scripts/scheduler.py index d95e8246c70..648da5cdddc 100644 --- a/addons/procurement/scripts/scheduler.py +++ b/addons/procurement/scripts/scheduler.py @@ -22,7 +22,7 @@ import xmlrpclib sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/wizard') -wiz_id = sock.create('trunk', 1, 'admin', 'mrp.procurement.compute.all') +wiz_id = sock.create('trunk', 1, 'admin', 'procurement.order.compute.all') sock.execute('trunk', 1, 'admin', wiz_id, {'form': {'po_cycle': 1.0, 'po_lead': 1.0, 'user_id': 3, 'schedule_cycle': 1.0, 'picking_lead': 1.0, 'security_lead': 50.0, 'automatic': False}, 'ids': [], 'report_type': 'pdf', 'model': 'ir.ui.menu', 'id': False}, 'compute', {}) diff --git a/addons/procurement/security/ir.model.access.csv b/addons/procurement/security/ir.model.access.csv index ce022a730b0..f13decfa9f2 100644 --- a/addons/procurement/security/ir.model.access.csv +++ b/addons/procurement/security/ir.model.access.csv @@ -1,9 +1,9 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_mrp_property_group","mrp.property.group","model_mrp_property_group",,1,0,0,0 "access_mrp_property","mrp.property","model_mrp_property",,1,0,0,0 -"access_mrp_procurement","mrp.procurement","model_mrp_procurement",,1,0,0,0 +"access_procurement","procurement.order","model_procurement_order",,1,0,0,0 "access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint",,1,0,0,0 -"access_mrp_procurement_compute_all","mrp.procurement.compute.all","model_mrp_procurement_compute_all",,1,0,0,0 -"access_mrp_procurement_orderpoint_compute","mrp.procurement.orderpoint.compute","model_mrp_procurement_orderpoint_compute",,1,0,0,0 +"access_procurement_compute_all","procurement.order.compute.all","model_procurement_order_compute_all",,1,0,0,0 +"access_procurement_orderpoint_compute","procurement.orderpoint.compute","model_procurement_orderpoint_compute",,1,0,0,0 "access_mrp_make_procurement","make.procurement","model_make_procurement",,1,0,0,0 -"access_mrp_make_procurement","mrp.procurement.compute","model_mrp_procurement_compute",,1,0,0,0 +"access_mrp_make_procurement","procurement.order.compute","model_procurement_order_compute",,1,0,0,0 diff --git a/addons/procurement/security/procurement_security.xml b/addons/procurement/security/procurement_security.xml index a0f2ef431bf..cf32286fd2f 100644 --- a/addons/procurement/security/procurement_security.xml +++ b/addons/procurement/security/procurement_security.xml @@ -2,9 +2,9 @@ - - mrp_procurement multi-company - + + procurement multi-company + ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)] diff --git a/addons/procurement/wizard/make_procurement_product.py b/addons/procurement/wizard/make_procurement_product.py index fa447e5abe2..a7bea3b247a 100644 --- a/addons/procurement/wizard/make_procurement_product.py +++ b/addons/procurement/wizard/make_procurement_product.py @@ -64,7 +64,7 @@ class make_procurement(osv.osv_memory): """ user = self.pool.get('res.users').browse(cr, uid, uid, context).login wh_obj = self.pool.get('stock.warehouse') - procurement_obj = self.pool.get('mrp.procurement') + procurement_obj = self.pool.get('procurement.order') wf_service = netsvc.LocalService("workflow") data_obj = self.pool.get('ir.model.data') @@ -80,11 +80,11 @@ class make_procurement(osv.osv_memory): 'procure_method':'make_to_order', }) - wf_service.trg_validate(uid, 'mrp.procurement', procure_id, 'button_confirm', cr) + wf_service.trg_validate(uid, 'procurement.order', procure_id, 'button_confirm', cr) - id2 = data_obj._get_id(cr, uid, 'procurement', 'mrp_procurement_tree_view') - id3 = data_obj._get_id(cr, uid, 'procurement', 'mrp_procurement_form_view') + id2 = data_obj._get_id(cr, uid, 'procurement', 'procurement_tree_view') + id3 = data_obj._get_id(cr, uid, 'procurement', 'procurement_form_view') if id2: id2 = data_obj.browse(cr, uid, id2, context=context).res_id @@ -94,7 +94,7 @@ class make_procurement(osv.osv_memory): return { 'view_type': 'form', 'view_mode': 'tree,form', - 'res_model': 'mrp.procurement', + 'res_model': 'procurement.order', 'res_id' : procure_id, 'views': [(id3,'form'),(id2,'tree')], 'type': 'ir.actions.act_window', diff --git a/addons/procurement/wizard/mrp_procurement.py b/addons/procurement/wizard/mrp_procurement.py index 1c3f3dd5c8a..466a462a55d 100644 --- a/addons/procurement/wizard/mrp_procurement.py +++ b/addons/procurement/wizard/mrp_procurement.py @@ -23,12 +23,12 @@ import threading from osv import osv, fields class procurement_compute(osv.osv_memory): - _name = 'mrp.procurement.compute' + _name = 'procurement.order.compute' _description = 'Compute Procurement' def _procure_calculation_procure(self, cr, uid, ids, context): try: - proc_obj = self.pool.get('mrp.procurement') + proc_obj = self.pool.get('procurement.order') proc_obj._procure_confirm(cr, uid, use_new_cursor=cr.dbname, context=context) finally: cr.close() diff --git a/addons/procurement/wizard/mrp_procurement_view.xml b/addons/procurement/wizard/mrp_procurement_view.xml index 817f7011e0c..c1cf71b1abb 100644 --- a/addons/procurement/wizard/mrp_procurement_view.xml +++ b/addons/procurement/wizard/mrp_procurement_view.xml @@ -6,7 +6,7 @@ Compute Procurements - mrp.procurement.compute + procurement.order.compute form
@@ -23,8 +23,8 @@ - - + + diff --git a/addons/procurement/wizard/orderpoint_procurement.py b/addons/procurement/wizard/orderpoint_procurement.py index 56302660939..ee3207833d3 100644 --- a/addons/procurement/wizard/orderpoint_procurement.py +++ b/addons/procurement/wizard/orderpoint_procurement.py @@ -28,7 +28,7 @@ import threading from osv import fields,osv class procurement_compute(osv.osv_memory): - _name = 'mrp.procurement.orderpoint.compute' + _name = 'procurement.orderpoint.compute' _description = 'Automatic Order Point' _columns = { @@ -47,7 +47,7 @@ class procurement_compute(osv.osv_memory): @param ids: List of IDs selected @param context: A standard dictionary """ - proc_obj = self.pool.get('mrp.procurement') + proc_obj = self.pool.get('procurement.order') for proc in self.browse(cr, uid, ids): proc_obj._procure_orderpoint_confirm(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname, context=context) diff --git a/addons/procurement/wizard/orderpoint_procurement_view.xml b/addons/procurement/wizard/orderpoint_procurement_view.xml index c17bedae84f..a56c46bd299 100644 --- a/addons/procurement/wizard/orderpoint_procurement_view.xml +++ b/addons/procurement/wizard/orderpoint_procurement_view.xml @@ -6,7 +6,7 @@ Compute Stock Minimum Rules Only - mrp.procurement.orderpoint.compute + procurement.orderpoint.compute form @@ -23,8 +23,8 @@ Compute Schedulers - mrp.procurement.compute.all + procurement.order.compute.all form @@ -23,8 +23,8 @@ - mrp.procurement.form.inherit - mrp.procurement - + procurement.order.form.inherit + procurement.order + form diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py index 85c35b277c5..5aaf3a995e2 100644 --- a/addons/purchase_requisition/purchase_requisition.py +++ b/addons/purchase_requisition/purchase_requisition.py @@ -136,11 +136,11 @@ class product_product(osv.osv): product_product() -class mrp_procurement(osv.osv): - _inherit = 'mrp.procurement' +class procurement_order(osv.osv): + _inherit = 'procurement.order' def make_po(self, cr, uid, ids, context={}): sequence_obj=self.pool.get('ir.sequence') - res = super(mrp_procurement, self).make_po(cr, uid, ids, context) + res = super(procurement_order, self).make_po(cr, uid, ids, context) for proc_id,po_id in res.items(): procurement = self.browse(cr, uid, proc_id) if procurement.product_id.purchase_requisition: @@ -157,4 +157,4 @@ class mrp_procurement(osv.osv): 'purchase_ids': [(6,0,[po_id])] }) return res -mrp_procurement() +procurement_order() diff --git a/addons/purchase_requisition/test/purchase_requisition.yml b/addons/purchase_requisition/test/purchase_requisition.yml index 8983d238e0e..0ace2312034 100644 --- a/addons/purchase_requisition/test/purchase_requisition.yml +++ b/addons/purchase_requisition/test/purchase_requisition.yml @@ -59,8 +59,8 @@ - I launch he scheduler to compute all procurements, and specify all requisitions orders. - - !python {model: mrp.procurement.compute.all}: | - proc_obj = self.pool.get('mrp.procurement') + !python {model: procurement.order.compute.all}: | + proc_obj = self.pool.get('procurement.order') proc_obj._procure_confirm(cr,uid) - On the purchase tender, I create a new purchase order for the supplier 'DistriPC' by clicking on diff --git a/addons/purchase_requisition/test/purchase_requisition_exclusive.yml b/addons/purchase_requisition/test/purchase_requisition_exclusive.yml index e2cba67fca9..641fd740de3 100644 --- a/addons/purchase_requisition/test/purchase_requisition_exclusive.yml +++ b/addons/purchase_requisition/test/purchase_requisition_exclusive.yml @@ -52,8 +52,8 @@ - I launch he scheduler to compute all procurements, and planify all requisitions orders. - - !python {model: mrp.procurement.compute.all}: | - proc_obj = self.pool.get('mrp.procurement') + !python {model: procurement.order.compute.all}: | + proc_obj = self.pool.get('procurement.order') proc_obj._procure_confirm(cr,uid) - I should find a purchase requisition with the origin 'TEST/TENDER/0002', that includes a request for diff --git a/addons/sale/process/sale_process.xml b/addons/sale/process/sale_process.xml index 5b71c050704..1ebbc267de7 100644 --- a/addons/sale/process/sale_process.xml +++ b/addons/sale/process/sale_process.xml @@ -64,11 +64,11 @@ - + - + diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 43d8d6768cc..779e13cfc33 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -113,7 +113,7 @@ class sale_order(osv.osv): LEFT JOIN stock_picking p on (p.id=m.picking_id) LEFT JOIN - mrp_procurement mp on (mp.move_id=m.id) + procurement_order mp on (mp.move_id=m.id) WHERE p.sale_id = ANY(%s) GROUP BY mp.state, p.sale_id''',(ids,)) for oid, nbr, mp_state in cr.fetchall(): @@ -659,7 +659,7 @@ class sale_order(osv.osv): 'note': line.notes, 'company_id': order.company_id.id, }) - proc_id = self.pool.get('mrp.procurement').create(cr, uid, { + proc_id = self.pool.get('procurement.order').create(cr, uid, { 'name': order.name, 'origin': order.name, 'date_planned': date_planned, @@ -677,10 +677,10 @@ class sale_order(osv.osv): 'company_id': order.company_id.id, }) wf_service = netsvc.LocalService("workflow") - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr) + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id}) elif line.product_id and line.product_id.product_tmpl_id.type == 'service': - proc_id = self.pool.get('mrp.procurement').create(cr, uid, { + proc_id = self.pool.get('procurement.order').create(cr, uid, { 'name': line.name, 'origin': order.name, 'date_planned': date_planned, @@ -694,7 +694,7 @@ class sale_order(osv.osv): }) self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id}) wf_service = netsvc.LocalService("workflow") - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr) + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) else: # # No procurement because no product in the sale.order.line. @@ -815,7 +815,7 @@ class sale_order_line(osv.osv): 'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True), 'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True), 'invoiced': fields.boolean('Invoiced', readonly=True), - 'procurement_id': fields.many2one('mrp.procurement', 'Procurement'), + 'procurement_id': fields.many2one('procurement.order', 'Procurement'), 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price'), readonly=True, states={'draft':[('readonly',False)]}), 'price_net': fields.function(_amount_line_net, method=True, string='Net Price', digits_compute= dp.get_precision('Sale Price')), 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute= dp.get_precision('Sale Price')), @@ -865,7 +865,7 @@ class sale_order_line(osv.osv): return line.product_uos_qty or 0.0 return line.product_uom_qty else: - return self.pool.get('mrp.procurement').quantity_get(cr, uid, + return self.pool.get('procurement.order').quantity_get(cr, uid, line.procurement_id.id, context=context) def _get_line_uom(line): @@ -874,7 +874,7 @@ class sale_order_line(osv.osv): return line.product_uos.id return line.product_uom.id else: - return self.pool.get('mrp.procurement').uom_get(cr, uid, + return self.pool.get('procurement.order').uom_get(cr, uid, line.procurement_id.id, context=context) create_ids = [] diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml index d6ab6a7bc0c..0920cdeebb2 100644 --- a/addons/sale/sale_demo.xml +++ b/addons/sale/sale_demo.xml @@ -206,7 +206,7 @@ - + diff --git a/addons/sale/sale_unit_test.xml b/addons/sale/sale_unit_test.xml index dc507edb4a0..95a23024412 100644 --- a/addons/sale/sale_unit_test.xml +++ b/addons/sale/sale_unit_test.xml @@ -112,7 +112,7 @@ - + done diff --git a/addons/sale/sale_workflow.xml b/addons/sale/sale_workflow.xml index 213605929ba..effe7cb6fff 100644 --- a/addons/sale/sale_workflow.xml +++ b/addons/sale/sale_workflow.xml @@ -218,7 +218,7 @@ - mrp.procurement + procurement.order procurement_lines_get() test_state('finished') @@ -226,7 +226,7 @@ test_state('canceled') diff --git a/addons/sale/security/ir.model.access.csv b/addons/sale/security/ir.model.access.csv index 726cd679212..de0f55b80b1 100644 --- a/addons/sale/security/ir.model.access.csv +++ b/addons/sale/security/ir.model.access.csv @@ -11,7 +11,7 @@ "access_account_analytic_account_salesman","account_analytic_account salesman","analytic.model_account_analytic_account","group_sale_user",1,1,1,1 "access_stock_picking_salesman","stock_picking salesman","stock.model_stock_picking","group_sale_user",1,1,1,1 "access_stock_move_salesman","stock_move salesman","stock.model_stock_move","group_sale_user",1,1,1,0 -"access_mrp_procurement_salesman","mrp.procurement salesman","procurement.model_mrp_procurement","group_sale_user",1,1,1,1 +"access_procurement_salesman","procurement.order salesman","procurement.model_procurement_order","group_sale_user",1,1,1,1 "access_sale_order_stock_worker","sale.order stock worker","model_sale_order","stock.group_stock_user",1,1,0,0 "access_sale_order_line_stock_worker","sale.order.line stock worker","model_sale_order_line","stock.group_stock_user",1,1,0,0 "access_sale_order_manager","sale.order.manager","model_sale_order","group_sale_manager",1,1,1,1 diff --git a/addons/sale/test/sale_procurement.yml b/addons/sale/test/sale_procurement.yml index a5e78117674..33ba22667ec 100644 --- a/addons/sale/test/sale_procurement.yml +++ b/addons/sale/test/sale_procurement.yml @@ -72,21 +72,21 @@ - I check that one procurement is generated. - - !python {model: mrp.procurement}: | + !python {model: procurement.order}: | from tools.translate import _ proc_ids = self.search(cr, uid, [('state','=','confirmed')]) assert proc_ids, _('No Procurements!') - The scheduler runs. - - !function {model: mrp.procurement, name: run_scheduler}: - - model: mrp.procurement + !function {model: procurement.order, name: run_scheduler}: + - model: procurement.order search: "[('state','=','confirmed')]" - I check that the procurement for the product table is in exception state. As my product's supply method is produce and mrp module is yet not installed. - - !python {model: mrp.procurement}: | + !python {model: procurement.order}: | from tools.translate import _ proc_ids = self.search(cr, uid, [('state','=','exception')]) assert proc_ids, _('No Procurements are in exception state!') diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py index 3bdc14bce82..d4d7337bbb0 100644 --- a/addons/stock_planning/stock_planning.py +++ b/addons/stock_planning/stock_planning.py @@ -899,7 +899,7 @@ class stock_planning(osv.osv): raise osv.except_osv(_('Error !'), _('Incoming Left must be greater than 0 !')) uom_qty, uom, uos_qty, uos = self._qty_to_standard(cr, uid, obj, context) user = self.pool.get('res.users').browse(cr, uid, uid, context) - proc_id = self.pool.get('mrp.procurement').create(cr, uid, { + proc_id = self.pool.get('procurement.order').create(cr, uid, { 'company_id' : obj.company_id.id, 'name': _('Manual planning for ') + obj.period_id.name, 'origin': _('MPS(') + str(user.login) +') '+ obj.period_id.name, @@ -926,7 +926,7 @@ class stock_planning(osv.osv): }, context=context) wf_service = netsvc.LocalService("workflow") - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr) + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) self.calculate_planning(cr, uid, ids, context) prev_text = obj.history or "" self.write(cr, uid, ids, {