From 0a807a60d9981375e7bdfa23591e759702f66482 Mon Sep 17 00:00:00 2001 From: mtr Date: Thu, 27 May 2010 13:39:18 +0530 Subject: [PATCH 1/3] [IMP] purchase: Added doc string bzr revid: mtr@mtr-20100527080918-sny35vm81lc4rbjc --- addons/purchase/purchase.py | 114 +++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 3 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 849e586335c..85e7c46f452 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -39,6 +39,9 @@ from osv.orm import browse_record, browse_null # Model definition # class purchase_order(osv.osv): + """ + For specifying the purchase order. + """ def _calc_amount(self, cr, uid, ids, prop, unknow_none, unknow_dict): res = {} for order in self.browse(cr, uid, ids): @@ -48,6 +51,16 @@ class purchase_order(osv.osv): return res def _amount_all(self, cr, uid, ids, field_name, arg, context): + """ Gets amount. + @param self: The object pointer + @param cr: The current row, from the database cursor + @param uid: The current user ID for security checks + @param ids: List of selected IDs + @param field_name: List of field names + @param arg: User defined argument + @param context: A standard dictionary for contextual values + @return: Dictionary of values + """ res = {} cur_obj=self.pool.get('res.currency') for order in self.browse(cr, uid, ids): @@ -68,6 +81,11 @@ class purchase_order(osv.osv): return res def _set_minimum_planned_date(self, cr, uid, ids, name, value, arg, context): + """ Sets Expected Date. + @param name: Name of the field + @param value: It gives date + @return: True + """ if not value: return False if type(ids)!=type([]): ids=[ids] @@ -80,6 +98,10 @@ class purchase_order(osv.osv): return True def _minimum_planned_date(self, cr, uid, ids, field_name, arg, context): + """ Binds the Expected Date field with date. + @param field_name: Name of the field + @return: Dictionary of values + """ res={} purchase_obj=self.browse(cr, uid, ids, context=context) for purchase in purchase_obj: @@ -93,6 +115,10 @@ class purchase_order(osv.osv): return res def _invoiced_rate(self, cursor, user, ids, name, arg, context=None): + """ Invoice Rate. + @param name: Name of the field + @return: Dictionary of values + """ res = {} for purchase in self.browse(cursor, user, ids, context=context): tot = 0.0 @@ -105,6 +131,9 @@ class purchase_order(osv.osv): return res def _shipped_rate(self, cr, uid, ids, name, arg, context=None): + """ Shipped Rate. + @return: Dictionary of values + """ if not ids: return {} res = {} for id in ids: @@ -133,12 +162,18 @@ class purchase_order(osv.osv): return res def _get_order(self, cr, uid, ids, context={}): + """ It calls the _amount_all function + @return:Dictionary of values + """ result = {} for line in self.pool.get('purchase.order.line').browse(cr, uid, ids, context=context): result[line.order_id.id] = True return result.keys() def _invoiced(self, cursor, user, ids, name, arg, context=None): + """ Purchase order is invoiced or not. + @return: Dictionary of values + """ res = {} for purchase in self.browse(cursor, user, ids, context=context): if purchase.invoice_id.reconciled: @@ -235,6 +270,10 @@ class purchase_order(osv.osv): return True def onchange_dest_address_id(self, cr, uid, ids, adr_id): + """ It removes the warehouse link and set the customer location if destination address changes. + @param adr_id: Changed address id + @return: Dictionary of changed values + """ if not adr_id: return {} part_id = self.pool.get('res.partner.address').read(cr, uid, [adr_id], ['partner_id'])[0]['partner_id'][0] @@ -242,13 +281,20 @@ class purchase_order(osv.osv): return {'value':{'location_id': loc_id, 'warehouse_id': False}} def onchange_warehouse_id(self, cr, uid, ids, warehouse_id): + """ Sets location_id and dest_address_id to False if warehouse_id changes. + @param warehouse_id: Changed warehouse_id + @return: Dictionary of changed values + """ if not warehouse_id: return {} res = self.pool.get('stock.warehouse').read(cr, uid, [warehouse_id], ['lot_input_id'])[0]['lot_input_id'][0] return {'value':{'location_id': res, 'dest_address_id': False}} def onchange_partner_id(self, cr, uid, ids, part): - + """ Sets partner_address_id ,pricelist_id and fiscal_position if partner_id changes. + @param part: Changed partner_id + @return: Dictionary of changed values + """ if not part: return {'value':{'partner_address_id': False, 'fiscal_position': False}} addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['default']) @@ -256,12 +302,18 @@ class purchase_order(osv.osv): pricelist = part.property_product_pricelist_purchase.id fiscal_position = part.property_account_position and part.property_account_position.id or False return {'value':{'partner_address_id': addr['default'], 'pricelist_id': pricelist, 'fiscal_position': fiscal_position}} - + def wkf_approve_order(self, cr, uid, ids, context={}): + """ Workflow action for purchase order approval + @return: True + """ self.write(cr, uid, ids, {'state': 'approved', 'date_approve': time.strftime('%Y-%m-%d')}) return True def wkf_confirm_order(self, cr, uid, ids, context={}): + """ Workflow action for purchase order confirmation. + @return: True + """ todo = [] for po in self.browse(cr, uid, ids): @@ -309,6 +361,10 @@ class purchase_order(osv.osv): }) def action_cancel_draft(self, cr, uid, ids, *args): + """ Sets purchase order in the draft state. + @param *args: Arguments + @return: True + """ if not len(ids): return False self.write(cr, uid, ids, {'state':'draft','shipped':0}) @@ -320,6 +376,10 @@ class purchase_order(osv.osv): return True def action_invoice_create(self, cr, uid, ids, *args): + """ Creates invoice. + @param *args: Arguments + @return: Invoice id + """ res = False journal_obj = self.pool.get('account.journal') @@ -369,6 +429,10 @@ class purchase_order(osv.osv): return res def has_stockable_product(self,cr, uid, ids, *args): + """ This action gets called from workflow to check the product type + @param *args: Arguments + @return: True or False + """ for order in self.browse(cr, uid, ids): for order_line in order.order_line: if order_line.product_id and order_line.product_id.product_tmpl_id.type in ('product', 'consu'): @@ -376,6 +440,9 @@ class purchase_order(osv.osv): return False def action_cancel(self, cr, uid, ids, context={}): + """ Cancels purchase order after it has been approved. + @return: True + """ ok = True purchase_order_line_obj = self.pool.get('purchase.order.line') for purchase in self.browse(cr, uid, ids): @@ -399,6 +466,10 @@ class purchase_order(osv.osv): return True def action_picking_create(self,cr, uid, ids, *args): + """ Creates picking. + @param *args: Arguments + @return: Picking id + """ picking_id = False for order in self.browse(cr, uid, ids): loc_id = order.partner_id.property_stock_supplier.id @@ -571,7 +642,16 @@ class purchase_order(osv.osv): purchase_order() class purchase_order_line(osv.osv): + """ + For specifying the purchase order lines. + """ def _amount_line(self, cr, uid, ids, prop, unknow_none,unknow_dict): + """ It gives the subtotal for purchase order line. + @param prop: Name of the field + @param unknow_none: None + @param unknow_dict: Contextual dictionary + @return: Dictionary of values + """ res = {} cur_obj=self.pool.get('res.currency') for line in self.browse(cr, uid, ids): @@ -613,6 +693,7 @@ class purchase_order_line(osv.osv): _table = 'purchase_order_line' _name = 'purchase.order.line' _description = 'Purchase Order Line' + def copy_data(self, cr, uid, id, default=None,context={}): if not default: default = {} @@ -622,6 +703,20 @@ class purchase_order_line(osv.osv): def product_id_change(self, cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=False, fiscal_position=False, date_planned=False, name=False, price_unit=False, notes=False): + """ Changes purchase order line when product_id changes . + @param pricelist: Pricelist id + @param product: Changed product_id + @param qty: Quantity of a product + @param uom: Unit of measure of a product + @param partner_id: Partner id + @param date_order: Order date + @param fiscal_position: Fiscal Position + @param date_planned: Scheduled date + @param name: Product name + @param price_unit: Price per unit + @param notes: Notes mentioned + @return: Dictionary of values. + """ if not pricelist: raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the purchase form !\nPlease set one before choosing a product.')) if not partner_id: @@ -679,12 +774,21 @@ class purchase_order_line(osv.osv): domain = {'product_uom':[('category_id','=',res2[0]['category_id'][0])]} if res2[0]['category_id'][0] != res3: raise osv.except_osv(_('Wrong Product UOM !'), _('You have to select a product UOM in the same category than the purchase UOM of the product')) - res['domain'] = domain return res def product_uom_change(self, cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=False,fiscal_position=False): + """ Changes product_uom. + @param pricelist: Pricelist id + @param product: Product id + @param qty: Quantity of a product + @param uom: changed product_uom + @param partner_id: Partner id + @param date_order: Order date + @param fiscal_position: Fiscal Position + @return: Dictionary of values. + """ res = self.product_id_change(cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=date_order,fiscal_position=fiscal_position) if 'product_uom' in res['value']: @@ -692,7 +796,11 @@ class purchase_order_line(osv.osv): if not uom: res['value']['price_unit'] = 0.0 return res + def action_confirm(self, cr, uid, ids, context={}): + """ Confirms purchase order. + @return: True + """ self.write(cr, uid, ids, {'state': 'confirmed'}, context) return True purchase_order_line() From 2ab8eb07b807dcf602fc60966c0a31610f9fee62 Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 28 May 2010 15:25:05 +0530 Subject: [PATCH 2/3] [IMP] stock_location : stock_location_pull is merged with stock_location bzr revid: mtr@mtr-20100528095505-81wa1f9vc1lgmhwu --- addons/stock_location/__init__.py | 1 + addons/stock_location/__openerp__.py | 4 +- addons/stock_location/mrp_pull.py | 131 ++++++++++++++++++++ addons/stock_location/mrp_pull_workflow.xml | 23 ++++ addons/stock_location/stock.py | 40 +++++- addons/stock_location/stock_view.xml | 59 ++++++--- 6 files changed, 240 insertions(+), 18 deletions(-) create mode 100755 addons/stock_location/mrp_pull.py create mode 100755 addons/stock_location/mrp_pull_workflow.xml diff --git a/addons/stock_location/__init__.py b/addons/stock_location/__init__.py index 1b86a7eb0c3..7a3970f9f44 100644 --- a/addons/stock_location/__init__.py +++ b/addons/stock_location/__init__.py @@ -20,5 +20,6 @@ ############################################################################## import stock +import mrp_pull # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_location/__openerp__.py b/addons/stock_location/__openerp__.py index b13769b3458..72698b9c390 100644 --- a/addons/stock_location/__openerp__.py +++ b/addons/stock_location/__openerp__.py @@ -37,9 +37,9 @@ This module may be useful for different purposes: * Manage products to be rent. """, 'author': 'Tiny', - 'depends': ['stock'], + 'depends': ['mrp','stock'], 'init_xml': [], - 'update_xml': ['stock_view.xml', 'security/ir.model.access.csv'], + 'update_xml': ['stock_view.xml', 'security/ir.model.access.csv', 'mrp_pull_workflow.xml'], 'demo_xml': [], 'installable': True, 'test':[ diff --git a/addons/stock_location/mrp_pull.py b/addons/stock_location/mrp_pull.py new file mode 100755 index 00000000000..9f79923c34f --- /dev/null +++ b/addons/stock_location/mrp_pull.py @@ -0,0 +1,131 @@ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields,osv +import tools +import ir +import pooler +import netsvc +from mx import DateTime +import time +from tools.translate import _ + +class mrp_procurement(osv.osv): + _inherit = 'mrp.procurement' + def check_buy(self, cr, uid, ids, context=None): + for procurement in self.browse(cr, uid, ids): + for line in procurement.product_id.flow_pull_ids: + print line.location_src_id.name, line.location_id.name, line.type_proc + if line.location_id==procurement.location_id: + return line.type_proc=='buy' + return super(mrp_procurement, self).check_buy(cr, uid, ids) + + def check_produce(self, cr, uid, ids, context=None): + for procurement in self.browse(cr, uid, ids): + for line in procurement.product_id.flow_pull_ids: + if line.location_id==procurement.location_id: + return line.type_proc=='produce' + return super(mrp_procurement, self).check_produce(cr, uid, ids) + + def check_move(self, cr, uid, ids, context=None): + for procurement in self.browse(cr, uid, ids): + for line in procurement.product_id.flow_pull_ids: + if line.location_id==procurement.location_id: + if not line.location_src_id: + self.write(cr, uid, procurement.id, {'message': _('No source location defined to generate the picking !')}) + return (line.type_proc=='move') and (line.location_src_id) + return False + + def action_move_create(self, cr, uid, ids,context=None): + proc_obj = self.pool.get('mrp.procurement') + move_obj = self.pool.get('stock.move') + location_obj = self.pool.get('stock.location') + wf_service = netsvc.LocalService("workflow") + + for proc in proc_obj.browse(cr, uid, ids, context=context): + line = None + for line in proc.product_id.flow_pull_ids: + if line.location_id==proc.location_id: + break + assert line, 'Line can not be False if we are on this state of the workflow' + origin = (proc.origin or proc.name or '').split(':')[0] +':'+line.name + picking_id = self.pool.get('stock.picking').create(cr, uid, { + 'origin': origin, + 'company_id': line.company_id and line.company_id.id or False, + 'type': line.picking_type, + 'move_type': 'one', + 'address_id': line.partner_address_id.id, + 'note': line.name, # TODO: note on procurement ? + 'invoice_state': 'none', + }) + move_id = self.pool.get('stock.move').create(cr, uid, { + 'name': line.name, + 'picking_id': picking_id, + 'company_id': line.company_id and line.company_id.id or False, + 'product_id': proc.product_id.id, + 'date_planned': proc.date_planned, + 'product_qty': proc.product_qty, + 'product_uom': proc.product_uom.id, + 'product_uos_qty': (proc.product_uos and proc.product_uos_qty)\ + or proc.product_qty, + 'product_uos': (proc.product_uos and proc.product_uos.id)\ + or proc.product_uom.id, + 'address_id': line.partner_address_id.id, + 'location_id': line.location_src_id.id, + 'location_dest_id': line.location_id.id, + 'move_dest_id': proc.move_id and proc.move_id.id or False, # to verif, about history ? + 'tracking_id': False, + 'cancel_cascade': line.cancel_cascade, + 'state': 'confirmed', + 'note': line.name, # TODO: same as above + }) + if proc.move_id and proc.move_id.state in ('confirmed'): + self.pool.get('stock.move').write(cr,uid, [proc.move_id.id], { + 'state':'waiting' + }, context=context) + proc_id = self.pool.get('mrp.procurement').create(cr, uid, { + 'name': line.name, + 'origin': origin, + 'company_id': line.company_id and line.company_id.id or False, + 'date_planned': proc.date_planned, + 'product_id': proc.product_id.id, + 'product_qty': proc.product_qty, + 'product_uom': proc.product_uom.id, + 'product_uos_qty': (proc.product_uos and proc.product_uos_qty)\ + or proc.product_qty, + 'product_uos': (proc.product_uos and proc.product_uos.id)\ + or proc.product_uom.id, + 'location_id': line.location_src_id.id, + 'procure_method': line.procure_method, + 'move_id': move_id, + }) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr) + wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr) + if proc.move_id: + self.pool.get('stock.move').write(cr, uid, [proc.move_id.id], + {'location_id':proc.location_id.id}) + + self.write(cr, uid, [proc.id], {'state':'running','message':_('Moved from other location')}) + + return False + + +mrp_procurement() diff --git a/addons/stock_location/mrp_pull_workflow.xml b/addons/stock_location/mrp_pull_workflow.xml new file mode 100755 index 00000000000..d1cad552115 --- /dev/null +++ b/addons/stock_location/mrp_pull_workflow.xml @@ -0,0 +1,23 @@ + + + + + + + + move + function + action_move_create() + + + + + + check_move() + + + + + + + diff --git a/addons/stock_location/stock.py b/addons/stock_location/stock.py index 3249dbef255..5dbbd7be9ab 100644 --- a/addons/stock_location/stock.py +++ b/addons/stock_location/stock.py @@ -28,6 +28,7 @@ class stock_location_path(osv.osv): _name = "stock.location.path" _columns = { 'name': fields.char('Operation', size=64), + 'company_id': fields.many2one('res.company', 'Company'), 'product_id' : fields.many2one('product.product', 'Products', ondelete='cascade', select=1), 'location_from_id' : fields.many2one('stock.location', 'Source Location', ondelete='cascade', select=1), 'location_dest_id' : fields.many2one('stock.location', 'Destination Location', ondelete='cascade', select=1), @@ -48,16 +49,53 @@ class stock_location_path(osv.osv): } stock_location_path() +class product_pulled_flow(osv.osv): + _name = 'product.pulled.flow' + _description = "Pulled Flows." + _columns = { + 'name': fields.char('Name', size=64, required=True, help="This field will fill the packing Origin and the name of its moves"), + 'cancel_cascade': fields.boolean('Cancel Cascade', help="Allow you to cancel moves related to the product pull flow"), + 'location_id': fields.many2one('stock.location','Location', required=True, help="Is the destination location that needs supplying"), + 'location_src_id': fields.many2one('stock.location','Location Source', help="Location used by Destination Location to supply"), + 'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procure Method', required=True, help="'Make to Stock': When needed, take from the stock or wait until re-supplying. 'Make to Order': When needed, purchase or produce for the procurement request."), + 'type_proc': fields.selection([('produce','Produce'),('buy','Buy'),('move','Move')], 'Type of Procurement', required=True), + 'company_id': fields.many2one('res.company', 'Company', help="Is used to know to which company belong packings and moves"), + 'partner_address_id': fields.many2one('res.partner.address', 'Partner Address'), + 'picking_type': fields.selection([('out','Sending Goods'),('in','Getting Goods'),('internal','Internal'),('delivery','Delivery')], 'Shipping Type', required=True, select=True, help="Depending on the company, choose whatever you want to receive or send products"), + 'product_id':fields.many2one('product.product','Product'), + } + _defaults = { + 'cancel_cascade': lambda *arg: False, + 'procure_method': lambda *args: 'make_to_stock', + 'type_proc': lambda *args: 'move', + 'picking_type':lambda *args:'out', + } +product_pulled_flow() + class product_product(osv.osv): _inherit = 'product.product' _columns = { + 'flow_pull_ids': fields.one2many('product.pulled.flow', 'product_id', 'Pulled Flows'), 'path_ids': fields.one2many('stock.location.path', 'product_id', - 'Location Paths', + 'Pushed Flow', help="These rules set the right path of the product in the "\ "whole location tree.") } product_product() +class stock_move(osv.osv): + _inherit = 'stock.move' + _columns = { + 'cancel_cascade': fields.boolean('Cancel Cascade', help='If checked, when this move is cancelled, cancel the linked move too') + } + def action_cancel(self,cr,uid,ids,context={ }): + for m in self.browse(cr, uid, ids, context=context): + if m.cancel_cascade and m.move_dest_id: + self.action_cancel(cr, uid, [m.move_dest_id.id], context=context) + res = super(stock_move,self).action_cancel(cr,uid,ids,context) + return res +stock_move() + class stock_location(osv.osv): _inherit = 'stock.location' def chained_location_get(self, cr, uid, location, partner=None, product=None, context={}): diff --git a/addons/stock_location/stock_view.xml b/addons/stock_location/stock_view.xml index f7ba12fe480..be8ac097406 100644 --- a/addons/stock_location/stock_view.xml +++ b/addons/stock_location/stock_view.xml @@ -8,7 +8,6 @@ tree - @@ -24,7 +23,7 @@
- + @@ -40,19 +39,49 @@ form - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + From 826f384cf86b02013741a2f04632c7d94d202040 Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 28 May 2010 18:07:09 +0530 Subject: [PATCH 3/3] [IMP] stock_location : mrp.procurement object is replaced with procurement.order bzr revid: mtr@mtr-20100528123709-1p6051bhqb7z0e7x --- addons/stock_location/__openerp__.py | 2 +- addons/stock_location/mrp_pull.py | 16 ++++++++-------- addons/stock_location/mrp_pull_workflow.xml | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/stock_location/__openerp__.py b/addons/stock_location/__openerp__.py index 72698b9c390..8c58fcc2c13 100644 --- a/addons/stock_location/__openerp__.py +++ b/addons/stock_location/__openerp__.py @@ -37,7 +37,7 @@ This module may be useful for different purposes: * Manage products to be rent. """, 'author': 'Tiny', - 'depends': ['mrp','stock'], + 'depends': ['procurement','stock'], 'init_xml': [], 'update_xml': ['stock_view.xml', 'security/ir.model.access.csv', 'mrp_pull_workflow.xml'], 'demo_xml': [], diff --git a/addons/stock_location/mrp_pull.py b/addons/stock_location/mrp_pull.py index 9f79923c34f..5ec5ceafe67 100755 --- a/addons/stock_location/mrp_pull.py +++ b/addons/stock_location/mrp_pull.py @@ -27,22 +27,22 @@ from mx import DateTime import time from tools.translate import _ -class mrp_procurement(osv.osv): - _inherit = 'mrp.procurement' +class procurement_order(osv.osv): + _inherit = 'procurement.order' def check_buy(self, cr, uid, ids, context=None): for procurement in self.browse(cr, uid, ids): for line in procurement.product_id.flow_pull_ids: print line.location_src_id.name, line.location_id.name, line.type_proc if line.location_id==procurement.location_id: return line.type_proc=='buy' - return super(mrp_procurement, self).check_buy(cr, uid, ids) + return super(procurement_order, self).check_buy(cr, uid, ids) def check_produce(self, cr, uid, ids, context=None): for procurement in self.browse(cr, uid, ids): for line in procurement.product_id.flow_pull_ids: if line.location_id==procurement.location_id: return line.type_proc=='produce' - return super(mrp_procurement, self).check_produce(cr, uid, ids) + return super(procurement_order, self).check_produce(cr, uid, ids) def check_move(self, cr, uid, ids, context=None): for procurement in self.browse(cr, uid, ids): @@ -54,7 +54,7 @@ class mrp_procurement(osv.osv): return False def action_move_create(self, cr, uid, ids,context=None): - proc_obj = self.pool.get('mrp.procurement') + proc_obj = self.pool.get('procurement.order') move_obj = self.pool.get('stock.move') location_obj = self.pool.get('stock.location') wf_service = netsvc.LocalService("workflow") @@ -100,7 +100,7 @@ class mrp_procurement(osv.osv): self.pool.get('stock.move').write(cr,uid, [proc.move_id.id], { 'state':'waiting' }, context=context) - proc_id = self.pool.get('mrp.procurement').create(cr, uid, { + proc_id = self.pool.get('procurement.order').create(cr, uid, { 'name': line.name, 'origin': origin, 'company_id': line.company_id and line.company_id.id or False, @@ -118,7 +118,7 @@ class mrp_procurement(osv.osv): }) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr) - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr) + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) if proc.move_id: self.pool.get('stock.move').write(cr, uid, [proc.move_id.id], {'location_id':proc.location_id.id}) @@ -128,4 +128,4 @@ class mrp_procurement(osv.osv): return False -mrp_procurement() +procurement_order() diff --git a/addons/stock_location/mrp_pull_workflow.xml b/addons/stock_location/mrp_pull_workflow.xml index d1cad552115..d45942ae5a6 100755 --- a/addons/stock_location/mrp_pull_workflow.xml +++ b/addons/stock_location/mrp_pull_workflow.xml @@ -4,20 +4,20 @@ - + move function action_move_create() - + check_move() - +