[IMP] procurment: Task ID-819: mrp_procurement should be renamed in procurement : renamed 'mrp.procurment' object to 'procurement.order'.
bzr revid: uco@tinyerp.com-20100527124706-uptnmyrdopc9yht9
This commit is contained in:
parent
9591ea287f
commit
fb6d7e5b9b
|
@ -15,7 +15,7 @@
|
||||||
<child1>
|
<child1>
|
||||||
<action colspan="4" height="200" name="%(mrp.mrp_production_action2)d" string="Next production orders" width="510"/>
|
<action colspan="4" height="200" name="%(mrp.mrp_production_action2)d" string="Next production orders" width="510"/>
|
||||||
<action colspan="4" name="%(stock.action_picking_tree)d" string="Deliveries (Out picking)" domain="[('state','=','assigned'),('type','=','out')]"/>
|
<action colspan="4" name="%(stock.action_picking_tree)d" string="Deliveries (Out picking)" domain="[('state','=','assigned'),('type','=','out')]"/>
|
||||||
<action colspan="4" name="%(procurement.mrp_procurement_action4)d" string="Procurements in Exception"/>
|
<action colspan="4" name="%(procurement.procurement_action4)d" string="Procurements in Exception"/>
|
||||||
</child1>
|
</child1>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<form string="Warehouse board">
|
<form string="Warehouse board">
|
||||||
<hpaned position="100">
|
<hpaned position="100">
|
||||||
<child1>
|
<child1>
|
||||||
<action colspan="4" name="%(procurement.mrp_procurement_action5)d" string="Procurement Exceptions" width="510" />
|
<action colspan="4" name="%(procurement.procurement_action5)d" string="Procurement Exceptions" width="510" />
|
||||||
<action colspan="4" name="%(action_reception_picking_move_board)d" string="Products To Receive" />
|
<action colspan="4" name="%(action_reception_picking_move_board)d" string="Products To Receive" />
|
||||||
</child1>
|
</child1>
|
||||||
|
|
||||||
|
|
|
@ -837,7 +837,7 @@ class mrp_production(osv.osv):
|
||||||
seq_obj = self.pool.get('ir.sequence')
|
seq_obj = self.pool.get('ir.sequence')
|
||||||
pick_obj = self.pool.get('stock.picking')
|
pick_obj = self.pool.get('stock.picking')
|
||||||
move_obj = self.pool.get('stock.move')
|
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")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
for production in self.browse(cr, uid, ids):
|
for production in self.browse(cr, uid, ids):
|
||||||
if not production.product_lines:
|
if not production.product_lines:
|
||||||
|
@ -931,7 +931,7 @@ class mrp_production(osv.osv):
|
||||||
'move_id': move_id,
|
'move_id': move_id,
|
||||||
'company_id': production.company_id.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)
|
proc_ids.append(proc_id)
|
||||||
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
|
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'})
|
self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'})
|
||||||
|
|
|
@ -406,9 +406,9 @@
|
||||||
Procurement
|
Procurement
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<menuitem action="procurement.mrp_procurement_action" id="menu_mrp_procurement_action"
|
<menuitem action="procurement.procurement_action" id="menu_mrp_procurement_action"
|
||||||
parent="mrp.menu_mrp_manufacturing" sequence="2" />
|
parent="mrp.menu_mrp_manufacturing" sequence="2" />
|
||||||
<!-- <menuitem action="procurement.mrp_procurement_action5" id="menu_mrp_procurement_exception_action"-->
|
<!-- <menuitem action="procurement.procurement_action5" id="menu_mrp_procurement_exception_action"-->
|
||||||
<!-- parent="mrp.menu_mrp_control" sequence="1" />-->
|
<!-- parent="mrp.menu_mrp_control" sequence="1" />-->
|
||||||
|
|
||||||
<menuitem id="menu_mrp_scheduler" name="Schedulers" parent="base.menu_mrp_root" sequence="4"/>
|
<menuitem id="menu_mrp_scheduler" name="Schedulers" parent="base.menu_mrp_root" sequence="4"/>
|
||||||
|
@ -813,9 +813,9 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<record id="view_procurement_form_inherit" model="ir.ui.view">
|
<record id="view_procurement_form_inherit" model="ir.ui.view">
|
||||||
<field name="name">mrp.procurement.form.inherit</field>
|
<field name="name">procurement.order.form.inherit</field>
|
||||||
<field name="model">mrp.procurement</field>
|
<field name="model">procurement.order</field>
|
||||||
<field name="inherit_id" ref="procurement.mrp_procurement_form_view"/>
|
<field name="inherit_id" ref="procurement.procurement_form_view"/>
|
||||||
<field name="type">form</field>
|
<field name="type">form</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="/form/notebook/page/field[@name='move_id']" position="before">
|
<xpath expr="/form/notebook/page/field[@name='move_id']" position="before">
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<record id="process_node_procureproducts0" model="process.node">
|
<record id="process_node_procureproducts0" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="procurement.model_mrp_procurement"/>
|
<field name="model_id" ref="procurement.model_procurement_order"/>
|
||||||
<field eval=""""state"""" name="kind"/>
|
<field eval=""""state"""" name="kind"/>
|
||||||
<field eval=""""The way to procurement depends on the product type."""" name="note"/>
|
<field eval=""""The way to procurement depends on the product type."""" name="note"/>
|
||||||
<field eval=""""Procure Products"""" name="name"/>
|
<field eval=""""Procure Products"""" name="name"/>
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
<record id="process_node_procureproducts0" model="process.node">
|
<record id="process_node_procureproducts0" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval=""""state"""" name="kind"/>
|
<field eval=""""state"""" name="kind"/>
|
||||||
<field eval=""""The way to procurement depends on the product type."""" name="note"/>
|
<field eval=""""The way to procurement depends on the product type."""" name="note"/>
|
||||||
<field eval=""""Procure Products"""" name="name"/>
|
<field eval=""""Procure Products"""" name="name"/>
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
<record id="process_node_stockproduct0" model="process.node">
|
<record id="process_node_stockproduct0" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval=""""subflow"""" name="kind"/>
|
<field eval=""""subflow"""" name="kind"/>
|
||||||
<field eval=""""Product type is Stockable or Consumable."""" name="note"/>
|
<field eval=""""Product type is Stockable or Consumable."""" name="note"/>
|
||||||
<field eval=""""Stockable Product"""" name="name"/>
|
<field eval=""""Stockable Product"""" name="name"/>
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
|
|
||||||
<record id="process_node_stockproduct1" model="process.node">
|
<record id="process_node_stockproduct1" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval=""""subflow"""" name="kind"/>
|
<field eval=""""subflow"""" name="kind"/>
|
||||||
<field eval=""""For stockable products and consumables"""" name="note"/>
|
<field eval=""""For stockable products and consumables"""" name="note"/>
|
||||||
<field eval=""""Stockable Product"""" name="name"/>
|
<field eval=""""Stockable Product"""" name="name"/>
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
|
|
||||||
<record id="process_node_serviceproduct0" model="process.node">
|
<record id="process_node_serviceproduct0" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval=""""subflow"""" name="kind"/>
|
<field eval=""""subflow"""" name="kind"/>
|
||||||
<field eval=""""Product type is service"""" name="note"/>
|
<field eval=""""Product type is service"""" name="note"/>
|
||||||
<field eval=""""Service"""" name="name"/>
|
<field eval=""""Service"""" name="name"/>
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
<record id="process_node_serviceproduct1" model="process.node">
|
<record id="process_node_serviceproduct1" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval=""""subflow"""" name="kind"/>
|
<field eval=""""subflow"""" name="kind"/>
|
||||||
<field eval=""""For Services."""" name="note"/>
|
<field eval=""""For Services."""" name="note"/>
|
||||||
<field eval=""""Service"""" name="name"/>
|
<field eval=""""Service"""" name="name"/>
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
|
|
||||||
<record id="process_node_purchaseprocure0" model="process.node">
|
<record id="process_node_purchaseprocure0" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval=""""subflow"""" name="kind"/>
|
<field eval=""""subflow"""" name="kind"/>
|
||||||
<field eval=""""Procurement Orders"""" name="name"/>
|
<field eval=""""Procurement Orders"""" name="name"/>
|
||||||
<field eval=""""For purchased material"""" name="note"/>
|
<field eval=""""For purchased material"""" name="note"/>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<record id="process_process_serviceproductprocess0" model="process.process">
|
<record id="process_process_serviceproductprocess0" model="process.process">
|
||||||
<field eval=""""Service"""" name="name"/>
|
<field eval=""""Service"""" name="name"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval="1" name="active"/>
|
<field eval="1" name="active"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<record id="process_node_serviceonorder0" model="process.node">
|
<record id="process_node_serviceonorder0" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval=""""state"""" name="kind"/>
|
<field eval=""""state"""" name="kind"/>
|
||||||
<field eval=""""Assignment from Production or Purchase Order."""" name="note"/>
|
<field eval=""""Assignment from Production or Purchase Order."""" name="note"/>
|
||||||
<field eval=""""Make to Order"""" name="name"/>
|
<field eval=""""Make to Order"""" name="name"/>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
<record id="process_node_servicemts0" model="process.node">
|
<record id="process_node_servicemts0" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval=""""state"""" name="kind"/>
|
<field eval=""""state"""" name="kind"/>
|
||||||
<field eval=""""Assignment from stock."""" name="note"/>
|
<field eval=""""Assignment from stock."""" name="note"/>
|
||||||
<field eval=""""Make to stock"""" name="name"/>
|
<field eval=""""Make to stock"""" name="name"/>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<record id="process_process_stockableproductprocess0" model="process.process">
|
<record id="process_process_stockableproductprocess0" model="process.process">
|
||||||
<field eval=""""Stockable Product"""" name="name"/>
|
<field eval=""""Stockable Product"""" name="name"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval="1" name="active"/>
|
<field eval="1" name="active"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<record id="process_node_mts0" model="process.node">
|
<record id="process_node_mts0" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval=""""state"""" name="kind"/>
|
<field eval=""""state"""" name="kind"/>
|
||||||
<field eval=""""Assignment from stock."""" name="note"/>
|
<field eval=""""Assignment from stock."""" name="note"/>
|
||||||
<field eval=""""Make to Stock"""" name="name"/>
|
<field eval=""""Make to Stock"""" name="name"/>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
<record id="process_node_stock0" model="process.node">
|
<record id="process_node_stock0" model="process.node">
|
||||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
<field name="model_id" ref="mrp.model_procurement_order"/>
|
||||||
<field eval=""""state"""" name="kind"/>
|
<field eval=""""state"""" name="kind"/>
|
||||||
<field eval=""""Assignment from Production or Purchase Order."""" name="note"/>
|
<field eval=""""Assignment from Production or Purchase Order."""" name="note"/>
|
||||||
<field eval=""""Make to Order"""" name="name"/>
|
<field eval=""""Make to Order"""" name="name"/>
|
||||||
|
|
|
@ -27,8 +27,8 @@ import ir
|
||||||
import netsvc
|
import netsvc
|
||||||
import time
|
import time
|
||||||
|
|
||||||
class mrp_procurement(osv.osv):
|
class procurement_order(osv.osv):
|
||||||
_inherit = 'mrp.procurement'
|
_inherit = 'procurement.order'
|
||||||
_columns = {
|
_columns = {
|
||||||
'bom_id': fields.many2one('mrp.bom', 'BoM', ondelete='cascade', select=True),
|
'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]
|
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)
|
bom_id = self.pool.get('mrp.bom')._bom_find(cr, uid, procurement.product_id.id, procurement.product_uom.id, properties)
|
||||||
if not bom_id:
|
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 False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class mrp_procurement(osv.osv):
|
||||||
""" This is action which call from workflow to assign production order to procurements
|
""" This is action which call from workflow to assign production order to procurements
|
||||||
@return: True
|
@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 = procurement_obj.make_mo(cr, uid, ids, context=context)
|
||||||
res = res.values()
|
res = res.values()
|
||||||
return len(res) and res[0] or 0 #TO CHECK: why workflow is generated error if return not integer value
|
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')
|
production_obj = self.pool.get('mrp.production')
|
||||||
move_obj = self.pool.get('stock.move')
|
move_obj = self.pool.get('stock.move')
|
||||||
wf_service = netsvc.LocalService("workflow")
|
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):
|
for procurement in procurement_obj.browse(cr, uid, ids):
|
||||||
res_id = procurement.move_id.id
|
res_id = procurement.move_id.id
|
||||||
loc_id = procurement.location_id.id
|
loc_id = procurement.location_id.id
|
||||||
|
@ -91,6 +91,6 @@ class mrp_procurement(osv.osv):
|
||||||
{'location_id': procurement.location_id.id})
|
{'location_id': procurement.location_id.id})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
mrp_procurement()
|
procurement_order()
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"access_mrp_production","mrp.production","model_mrp_production","mrp.group_mrp_user",1,1,1,1
|
"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_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_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_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_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
|
"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_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_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_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_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_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
|
"access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0
|
||||||
|
|
|
|
@ -51,7 +51,7 @@ class stock_warehouse_orderpoint(osv.osv):
|
||||||
"a procurement to bring the virtual stock to the Max Quantity."),
|
"a procurement to bring the virtual stock to the Max Quantity."),
|
||||||
'qty_multiple': fields.integer('Qty Multiple', required=True,
|
'qty_multiple': fields.integer('Qty Multiple', required=True,
|
||||||
help="The procurement quantity will by rounded up to this multiple."),
|
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),
|
'company_id': fields.many2one('res.company','Company',required=True),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
|
@ -103,7 +103,7 @@ class StockMove(osv.osv):
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'production_id': fields.many2one('mrp.production', 'Production', select=True),
|
'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):
|
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')
|
bom_obj = self.pool.get('mrp.bom')
|
||||||
move_obj = self.pool.get('stock.move')
|
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')
|
product_obj = self.pool.get('product.product')
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
if move.product_id.supply_method == 'produce' and move.product_id.procure_method == 'make_to_order':
|
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,
|
'move_id': mid,
|
||||||
'company_id': line['company_id'],
|
'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], {
|
move_obj.write(cr, uid, [move.id], {
|
||||||
'location_id': move.location_dest_id.id,
|
'location_id': move.location_dest_id.id,
|
||||||
'auto_validate': True,
|
'auto_validate': True,
|
||||||
|
@ -175,7 +175,7 @@ class StockMove(osv.osv):
|
||||||
'state': 'waiting'
|
'state': 'waiting'
|
||||||
})
|
})
|
||||||
for m in procurement_obj.search(cr, uid, [('move_id','=',move.id)], context):
|
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
|
return True
|
||||||
|
|
||||||
def action_consume(self, cr, uid, ids, product_qty, location_id=False, context=None):
|
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:
|
for move in picking.move_lines:
|
||||||
if move.state == 'done' and move.procurements:
|
if move.state == 'done' and move.procurements:
|
||||||
for procurement in 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)
|
procurement.id, 'button_check', cursor)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
|
@ -180,15 +180,15 @@
|
||||||
-
|
-
|
||||||
I am checking Procurement orders. There are 3 orders generated for Oranges, Sugar and Water.
|
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 _
|
from tools.translate import _
|
||||||
proc_ids = self.search(cr, uid, [('state','!=','cofirmed')])
|
proc_ids = self.search(cr, uid, [('state','!=','cofirmed')])
|
||||||
assert proc_ids, _('No Procurements!')
|
assert proc_ids, _('No Procurements!')
|
||||||
-
|
-
|
||||||
The scheduler runs.
|
The scheduler runs.
|
||||||
-
|
-
|
||||||
!function {model: mrp.procurement, name: run_scheduler}:
|
!function {model: procurement.order, name: run_scheduler}:
|
||||||
- model: mrp.procurement
|
- model: procurement.order
|
||||||
search: "[('state','!=','cofirmed')]"
|
search: "[('state','!=','cofirmed')]"
|
||||||
-
|
-
|
||||||
I am checking Internal picking. I see one picking for Orange juice and its
|
I am checking Internal picking. I see one picking for Orange juice and its
|
||||||
|
|
|
@ -129,7 +129,7 @@
|
||||||
-
|
-
|
||||||
I create a procurement order for product Shirt.
|
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'
|
name: 'PROC: Shirt'
|
||||||
product_id: product_product_shirt0
|
product_id: product_product_shirt0
|
||||||
product_qty: 5.00
|
product_qty: 5.00
|
||||||
|
@ -138,11 +138,11 @@
|
||||||
-
|
-
|
||||||
I confirm the procurement order.
|
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.
|
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.
|
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.
|
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 _
|
from tools.translate import _
|
||||||
proc_ids = self.search(cr, uid, [('product_id','in',[ref('product_product_cloth0'),ref('product_product_buttons0')])])
|
proc_ids = self.search(cr, uid, [('product_id','in',[ref('product_product_cloth0'),ref('product_product_buttons0')])])
|
||||||
assert proc_ids, 'No Procurements.'
|
assert proc_ids, 'No Procurements.'
|
||||||
-
|
-
|
||||||
The scheduler runs.
|
The scheduler runs.
|
||||||
-
|
-
|
||||||
!function {model: mrp.procurement, name: run_scheduler}:
|
!function {model: procurement.order, name: run_scheduler}:
|
||||||
- model: mrp.procurement
|
- model: procurement.order
|
||||||
search: "[]"
|
search: "[]"
|
||||||
-
|
-
|
||||||
I check that there is one purchase order for Cloth.
|
I check that there is one purchase order for Cloth.
|
||||||
|
@ -290,8 +290,8 @@
|
||||||
-
|
-
|
||||||
Run scheduler again.
|
Run scheduler again.
|
||||||
-
|
-
|
||||||
!function {model: mrp.procurement, name: run_scheduler}:
|
!function {model: procurement.order, name: run_scheduler}:
|
||||||
- model: mrp.procurement
|
- model: procurement.order
|
||||||
search: "[]"
|
search: "[]"
|
||||||
-
|
-
|
||||||
Check state of manufacturing order for Shirt.
|
Check state of manufacturing order for Shirt.
|
||||||
|
|
|
@ -84,15 +84,15 @@
|
||||||
-
|
-
|
||||||
I am checking Procurement orders.
|
I am checking Procurement orders.
|
||||||
-
|
-
|
||||||
!python {model: mrp.procurement}: |
|
!python {model: procurement.order}: |
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
proc_ids = self.search(cr, uid, [('state','!=','confirmed')])
|
proc_ids = self.search(cr, uid, [('state','!=','confirmed')])
|
||||||
assert proc_ids, _('No Procurements!')
|
assert proc_ids, _('No Procurements!')
|
||||||
-
|
-
|
||||||
The scheduler runs.
|
The scheduler runs.
|
||||||
-
|
-
|
||||||
!function {model: mrp.procurement, name: run_scheduler}:
|
!function {model: procurement.order, name: run_scheduler}:
|
||||||
- model: mrp.procurement
|
- model: procurement.order
|
||||||
search: "[('state','=','confirmed')]"
|
search: "[('state','=','confirmed')]"
|
||||||
-
|
-
|
||||||
I am checking Internal picking.
|
I am checking Internal picking.
|
||||||
|
|
|
@ -36,15 +36,15 @@
|
||||||
-
|
-
|
||||||
I am checking Procurement orders.
|
I am checking Procurement orders.
|
||||||
-
|
-
|
||||||
!python {model: mrp.procurement}: |
|
!python {model: procurement.order}: |
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
proc_ids = self.search(cr, uid, [('state','=','confirmed')])
|
proc_ids = self.search(cr, uid, [('state','=','confirmed')])
|
||||||
assert proc_ids, _('No Procurements!')
|
assert proc_ids, _('No Procurements!')
|
||||||
-
|
-
|
||||||
The scheduler runs.
|
The scheduler runs.
|
||||||
-
|
-
|
||||||
!function {model: mrp.procurement, name: run_scheduler}:
|
!function {model: procurement.order, name: run_scheduler}:
|
||||||
- model: mrp.procurement
|
- model: procurement.order
|
||||||
search: "[('state','=','confirmed')]"
|
search: "[('state','=','confirmed')]"
|
||||||
-
|
-
|
||||||
I am checking Internal picking.
|
I am checking Internal picking.
|
||||||
|
|
|
@ -132,7 +132,7 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="ir_modelsmrp_pdt0" model="ir.model.access">
|
<record id="ir_modelsmrp_pdt0" model="ir.model.access">
|
||||||
<field name="model_id" ref="procurement.model_mrp_procurement"/>
|
<field name="model_id" ref="procurement.model_procurement_order"/>
|
||||||
<field eval="1" name="perm_read"/>
|
<field eval="1" name="perm_read"/>
|
||||||
<field eval=""""MRP - Procurement"""" name="name"/>
|
<field eval=""""MRP - Procurement"""" name="name"/>
|
||||||
<field eval="0" name="perm_unlink"/>
|
<field eval="0" name="perm_unlink"/>
|
||||||
|
@ -474,12 +474,12 @@
|
||||||
<field name="group_id" ref="res_groups_posuser0"/>
|
<field name="group_id" ref="res_groups_posuser0"/>
|
||||||
</record>
|
</record>
|
||||||
<record id="ir_model_access_procurement0" model="ir.model.access">
|
<record id="ir_model_access_procurement0" model="ir.model.access">
|
||||||
<field name="model_id" ref="procurement.model_mrp_procurement" />
|
<field name="model_id" ref="procurement.model_procurement_order" />
|
||||||
<field eval="1" name="perm_read" />
|
<field eval="1" name="perm_read" />
|
||||||
<field eval="1" name="perm_write" />
|
<field eval="1" name="perm_write" />
|
||||||
<field eval="1" name="perm_create" />
|
<field eval="1" name="perm_create" />
|
||||||
<field eval="0" name="perm_unlink" />
|
<field eval="0" name="perm_unlink" />
|
||||||
<field name="name" eval=""""mrp.procurement"""" />
|
<field name="name" eval=""""procurement.order"""" />
|
||||||
<field name="group_id" ref="res_groups_posuser0"/>
|
<field name="group_id" ref="res_groups_posuser0"/>
|
||||||
</record>
|
</record>
|
||||||
<record id="ir_model_access_tax0" model="ir.model.access">
|
<record id="ir_model_access_tax0" model="ir.model.access">
|
||||||
|
|
|
@ -214,7 +214,7 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="ir_modelsmrp_pdt0" model="ir.model.access">
|
<record id="ir_modelsmrp_pdt0" model="ir.model.access">
|
||||||
<field name="model_id" ref="procurement.model_mrp_procurement"/>
|
<field name="model_id" ref="procurement.model_procurement_order"/>
|
||||||
<field eval="1" name="perm_read"/>
|
<field eval="1" name="perm_read"/>
|
||||||
<field eval=""""MRP - Procurement"""" name="name"/>
|
<field eval=""""MRP - Procurement"""" name="name"/>
|
||||||
<field eval="0" name="perm_unlink"/>
|
<field eval="0" name="perm_unlink"/>
|
||||||
|
@ -557,12 +557,12 @@
|
||||||
<field name="group_id" ref="res_groups_posuser0"/>
|
<field name="group_id" ref="res_groups_posuser0"/>
|
||||||
</record>
|
</record>
|
||||||
<record id="ir_model_access_procurement0" model="ir.model.access">
|
<record id="ir_model_access_procurement0" model="ir.model.access">
|
||||||
<field name="model_id" ref="mrp_procurement.model_mrp_procurement" />
|
<field name="model_id" ref="procurement.model_procurement_order" />
|
||||||
<field eval="1" name="perm_read" />
|
<field eval="1" name="perm_read" />
|
||||||
<field eval="1" name="perm_write" />
|
<field eval="1" name="perm_write" />
|
||||||
<field eval="1" name="perm_create" />
|
<field eval="1" name="perm_create" />
|
||||||
<field eval="0" name="perm_unlink" />
|
<field eval="0" name="perm_unlink" />
|
||||||
<field name="name" eval=""""mrp.procurement"""" />
|
<field name="name" eval=""""procurement.order"""" />
|
||||||
<field name="group_id" ref="res_groups_posuser0"/>
|
<field name="group_id" ref="res_groups_posuser0"/>
|
||||||
</record>
|
</record>
|
||||||
<record id="ir_model_access_tax0" model="ir.model.access">
|
<record id="ir_model_access_tax0" model="ir.model.access">
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<record id="process_process_procurementprocess0" model="process.process">
|
<record id="process_process_procurementprocess0" model="process.process">
|
||||||
<field eval=""""Procurement"""" name="name"/>
|
<field eval=""""Procurement"""" name="name"/>
|
||||||
<field name="model_id" ref="procurement.model_mrp_procurement"/>
|
<field name="model_id" ref="procurement.model_procurement_order"/>
|
||||||
<field eval="1" name="active"/>
|
<field eval="1" name="active"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
|
@ -62,11 +62,11 @@ mrp_property()
|
||||||
# Produce, Buy or Find products and place a move
|
# Produce, Buy or Find products and place a move
|
||||||
# then wizard for picking lists & move
|
# then wizard for picking lists & move
|
||||||
#
|
#
|
||||||
class mrp_procurement(osv.osv):
|
class procurement_order(osv.osv):
|
||||||
"""
|
"""
|
||||||
Procurement Orders
|
Procurement Orders
|
||||||
"""
|
"""
|
||||||
_name = "mrp.procurement"
|
_name = "procurement.order"
|
||||||
_description = "Procurement"
|
_description = "Procurement"
|
||||||
_order = 'priority,date_planned desc'
|
_order = 'priority,date_planned desc'
|
||||||
_log_create = False
|
_log_create = False
|
||||||
|
@ -92,7 +92,7 @@ class mrp_procurement(osv.osv):
|
||||||
|
|
||||||
'note': fields.text('Note'),
|
'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."),
|
'message': fields.char('Latest error', size=64, help="Exception occurred while computing procurement orders."),
|
||||||
'state': fields.selection([
|
'state': fields.selection([
|
||||||
|
@ -115,7 +115,7 @@ class mrp_procurement(osv.osv):
|
||||||
'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||||
'close_move': lambda *a: 0,
|
'close_move': lambda *a: 0,
|
||||||
'procure_method': lambda *a: 'make_to_order',
|
'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):
|
def unlink(self, cr, uid, ids, context=None):
|
||||||
|
@ -176,7 +176,7 @@ class mrp_procurement(osv.osv):
|
||||||
return res
|
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
|
# for computing their own purpose
|
||||||
#
|
#
|
||||||
def _quantity_compute_get(self, cr, uid, proc, context={}):
|
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':
|
if procurement.product_id.product_tmpl_id.supply_method <> 'buy':
|
||||||
return False
|
return False
|
||||||
if not procurement.product_id.seller_ids:
|
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
|
return False
|
||||||
partner = procurement.product_id.seller_ids[0].name
|
partner = procurement.product_id.seller_ids[0].name
|
||||||
if user.company_id and user.company_id.partner_id:
|
if user.company_id and user.company_id.partner_id:
|
||||||
|
@ -294,7 +294,7 @@ class mrp_procurement(osv.osv):
|
||||||
return False
|
return False
|
||||||
address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery']
|
address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery']
|
||||||
if not address_id:
|
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 False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ class mrp_procurement(osv.osv):
|
||||||
ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id])
|
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,))
|
cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,))
|
||||||
if not cr.fetchone()[0]:
|
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
|
return ok
|
||||||
|
|
||||||
def action_produce_assign_service(self, cr, uid, ids, context={}):
|
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'})
|
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
for id in ids:
|
for id in ids:
|
||||||
wf_service.trg_trigger(uid, 'mrp.procurement', id, cr)
|
wf_service.trg_trigger(uid, 'procurement.order', id, cr)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_check_finnished(self, cr, uid, ids):
|
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')})
|
res = self.write(cr, uid, ids, {'state': 'done', 'date_close': time.strftime('%Y-%m-%d')})
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
for id in ids:
|
for id in ids:
|
||||||
wf_service.trg_trigger(uid, 'mrp.procurement', id, cr)
|
wf_service.trg_trigger(uid, 'procurement.order', id, cr)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
|
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,\
|
self._procure_orderpoint_confirm(cr, uid, automatic=automatic,\
|
||||||
use_new_cursor=use_new_cursor, context=context)
|
use_new_cursor=use_new_cursor, context=context)
|
||||||
|
|
||||||
mrp_procurement()
|
procurement_order()
|
||||||
|
|
||||||
|
|
||||||
class stock_warehouse_orderpoint(osv.osv):
|
class stock_warehouse_orderpoint(osv.osv):
|
||||||
|
@ -460,16 +460,16 @@ class stock_warehouse_orderpoint(osv.osv):
|
||||||
Defines Minimum stock rules.
|
Defines Minimum stock rules.
|
||||||
"""
|
"""
|
||||||
_name = "stock.warehouse.orderpoint"
|
_name = "stock.warehouse.orderpoint"
|
||||||
_description = "Orderpoint minimum rule"
|
_description = "Minimum Inventory Rule"
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Name', size=32, required=True),
|
'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."),
|
'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),
|
'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),
|
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True, ondelete="cascade"),
|
||||||
'location_id': fields.many2one('stock.location', 'Location', required=True),
|
'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_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,
|
'product_min_qty': fields.float('Min Quantity', required=True,
|
||||||
help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
|
help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
|
||||||
"a procurement to bring the virtual stock to the Max Quantity."),
|
"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."),
|
"a procurement to bring the virtual stock to the Max Quantity."),
|
||||||
'qty_multiple': fields.integer('Qty Multiple', required=True,
|
'qty_multiple': fields.integer('Qty Multiple', required=True,
|
||||||
help="The procurement quantity will by rounded up to this multiple."),
|
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),
|
'company_id': fields.many2one('res.company','Company',required=True),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
|
@ -489,7 +489,10 @@ class stock_warehouse_orderpoint(osv.osv):
|
||||||
'product_uom': lambda sel, cr, uid, context: context.get('product_uom', False),
|
'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)
|
'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={}):
|
def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context={}):
|
||||||
""" Finds location id for changed warehouse.
|
""" Finds location id for changed warehouse.
|
||||||
@param warehouse_id: Changed id of 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}
|
v = {'location_id': w.lot_stock_id.id}
|
||||||
return {'value': v}
|
return {'value': v}
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
|
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
|
||||||
""" Finds UoM for changed product.
|
""" Finds UoM for changed product.
|
||||||
@param product_id: Changed id of 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}
|
v = {'product_uom': prod.uom_id.id}
|
||||||
return {'value': v}
|
return {'value': v}
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def copy(self, cr, uid, id, default=None,context={}):
|
def copy(self, cr, uid, id, default=None,context={}):
|
||||||
if not default:
|
if not default:
|
||||||
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 '',
|
'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)
|
return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context)
|
||||||
|
|
||||||
stock_warehouse_orderpoint()
|
stock_warehouse_orderpoint()
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<field name="interval_type">days</field>
|
<field name="interval_type">days</field>
|
||||||
<field name="numbercall">-1</field>
|
<field name="numbercall">-1</field>
|
||||||
<field eval="False" name="doall"/>
|
<field eval="False" name="doall"/>
|
||||||
<field eval="'mrp.procurement'" name="model"/>
|
<field eval="'procurement.order'" name="model"/>
|
||||||
<field eval="'run_scheduler'" name="function"/>
|
<field eval="'run_scheduler'" name="function"/>
|
||||||
<field eval="'(False,)'" name="args"/>
|
<field eval="'(False,)'" name="args"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
Procurement
|
Procurement
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<record id="mrp_procurement_tree_view" model="ir.ui.view">
|
<record id="procurement_tree_view" model="ir.ui.view">
|
||||||
<field name="name">mrp.procurement.tree</field>
|
<field name="name">procurement.order.tree</field>
|
||||||
<field name="model">mrp.procurement</field>
|
<field name="model">procurement.order</field>
|
||||||
<field name="type">tree</field>
|
<field name="type">tree</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Procurement Lines" colors="red:date_planned<current_date and state in ('exception');black:state=='running';green:state=='confirmed';gray:state in ['done','cancel'];blue:state in ('ready')">
|
<tree string="Procurement Lines" colors="red:date_planned<current_date and state in ('exception');black:state=='running';green:state=='confirmed';gray:state in ['done','cancel'];blue:state in ('ready')">
|
||||||
|
@ -22,9 +22,9 @@
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="mrp_procurement_form_view" model="ir.ui.view">
|
<record id="procurement_form_view" model="ir.ui.view">
|
||||||
<field name="name">mrp.procurement.form</field>
|
<field name="name">procurement.order.form</field>
|
||||||
<field name="model">mrp.procurement</field>
|
<field name="model">procurement.order</field>
|
||||||
<field name="type">form</field>
|
<field name="type">form</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Procurement">
|
<form string="Procurement">
|
||||||
|
@ -79,9 +79,9 @@
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="view_mrp_procurement_filter" model="ir.ui.view">
|
<record id="view_procurement_filter" model="ir.ui.view">
|
||||||
<field name="name">mrp.procurement.select</field>
|
<field name="name">procurement.order.select</field>
|
||||||
<field name="model">mrp.procurement</field>
|
<field name="model">procurement.order</field>
|
||||||
<field name="type">search</field>
|
<field name="type">search</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="Search Procurement">
|
<search string="Search Procurement">
|
||||||
|
@ -109,51 +109,51 @@
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="mrp_procurement_action" model="ir.actions.act_window">
|
<record id="procurement_action" model="ir.actions.act_window">
|
||||||
<field name="name">Procurement Orders</field>
|
<field name="name">Procurement Orders</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrp.procurement</field>
|
<field name="res_model">procurement.order</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_id" eval="False"/>
|
<field name="view_id" eval="False"/>
|
||||||
<field name="context">{'search_default_current':1}</field>
|
<field name="context">{'search_default_current':1}</field>
|
||||||
<field name="search_view_id" ref="view_mrp_procurement_filter"/>
|
<field name="search_view_id" ref="view_procurement_filter"/>
|
||||||
<field name="context">{'search_default_Current':1}</field>
|
<field name="context">{'search_default_Current':1}</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="mrp_procurement_action3" model="ir.actions.act_window">
|
<record id="procurement_action3" model="ir.actions.act_window">
|
||||||
<field name="name">Procurements</field>
|
<field name="name">Procurements</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrp.procurement</field>
|
<field name="res_model">procurement.order</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="search_view_id" ref="view_mrp_procurement_filter"/>
|
<field name="search_view_id" ref="view_procurement_filter"/>
|
||||||
<field name="domain">[]</field>
|
<field name="domain">[]</field>
|
||||||
<field name="context">{}</field>
|
<field name="context">{}</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="mrp_procurement_action5" model="ir.actions.act_window">
|
<record id="procurement_action5" model="ir.actions.act_window">
|
||||||
<field name="name">Procurement Exceptions</field>
|
<field name="name">Procurement Exceptions</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrp.procurement</field>
|
<field name="res_model">procurement.order</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('state','=','exception')]</field>
|
<field name="domain">[('state','=','exception')]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="mrp_procurement_action4" model="ir.actions.act_window">
|
<record id="procurement_action4" model="ir.actions.act_window">
|
||||||
<field name="name">Procurement Exceptions to Fix</field>
|
<field name="name">Procurement Exceptions to Fix</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrp.procurement</field>
|
<field name="res_model">procurement.order</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('state','=','exception'), ('message', '<>', '')]</field>
|
<field name="domain">[('state','=','exception'), ('message', '<>', '')]</field>
|
||||||
<field name="filter" eval="True"/>
|
<field name="filter" eval="True"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="mrp_procurement_action11" model="ir.actions.act_window">
|
<record id="procurement_action11" model="ir.actions.act_window">
|
||||||
<field name="name">Temporary Procurement Exceptions</field>
|
<field name="name">Temporary Procurement Exceptions</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">mrp.procurement</field>
|
<field name="res_model">procurement.order</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('state','=','exception'), ('message', '=', '')]</field>
|
<field name="domain">[('state','=','exception'), ('message', '=', '')]</field>
|
||||||
|
@ -255,17 +255,17 @@
|
||||||
<act_window
|
<act_window
|
||||||
context="{'product_uom': locals().has_key('uom_id') and uom_id}"
|
context="{'product_uom': locals().has_key('uom_id') and uom_id}"
|
||||||
domain="[('product_id', '=', active_id)]"
|
domain="[('product_id', '=', active_id)]"
|
||||||
id="act_mrp_procurement_2_stock_warehouse_orderpoint"
|
id="act_procurement_2_stock_warehouse_orderpoint"
|
||||||
name="Minimum Stock Rules"
|
name="Minimum Stock Rules"
|
||||||
res_model="stock.warehouse.orderpoint"
|
res_model="stock.warehouse.orderpoint"
|
||||||
src_model="mrp.procurement"/>
|
src_model="procurement.order"/>
|
||||||
|
|
||||||
<act_window
|
<act_window
|
||||||
domain="[('id', '=', product_id)]"
|
domain="[('id', '=', product_id)]"
|
||||||
id="act_product_product_2_stock_warehouse_orderpoint"
|
id="act_product_product_2_stock_warehouse_orderpoint"
|
||||||
name="Product"
|
name="Product"
|
||||||
res_model="product.product"
|
res_model="product.product"
|
||||||
src_model="mrp.procurement"/>
|
src_model="procurement.order"/>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<record id="wkf_procurement" model="workflow">
|
<record id="wkf_procurement" model="workflow">
|
||||||
<field name="name">mrp.procurement.basic</field>
|
<field name="name">procurement.order.basic</field>
|
||||||
<field name="osv">mrp.procurement</field>
|
<field name="osv">procurement.order</field>
|
||||||
<field name="on_create">True</field>
|
<field name="on_create">True</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@ from mx import DateTime
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
class mrp_procurement(osv.osv):
|
class procurement_order(osv.osv):
|
||||||
_inherit = 'mrp.procurement'
|
_inherit = 'procurement.order'
|
||||||
|
|
||||||
def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None):
|
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()
|
cr = pooler.get_db(use_new_cursor).cursor()
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
|
|
||||||
procurement_obj = self.pool.get('mrp.procurement')
|
procurement_obj = self.pool.get('procurement.order')
|
||||||
if not ids:
|
if not ids:
|
||||||
ids = procurement_obj.search(cr, uid, [], order="date_planned")
|
ids = procurement_obj.search(cr, uid, [], order="date_planned")
|
||||||
for id in ids:
|
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:
|
if use_new_cursor:
|
||||||
cr.commit()
|
cr.commit()
|
||||||
|
|
||||||
|
@ -57,11 +57,11 @@ class mrp_procurement(osv.osv):
|
||||||
report_except = 0
|
report_except = 0
|
||||||
report_later = 0
|
report_later = 0
|
||||||
while True:
|
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())
|
ids = map(lambda x: x[0], cr.fetchall())
|
||||||
for proc in procurement_obj.browse(cr, uid, ids):
|
for proc in procurement_obj.browse(cr, uid, ids):
|
||||||
if (maxdate.strftime('%Y-%m-%d') >= proc.date_planned):
|
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:
|
else:
|
||||||
offset += 1
|
offset += 1
|
||||||
report_later += 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)
|
ids = procurement_obj.search(cr, uid, [('state', '=', 'confirmed'), ('procure_method', '=', 'make_to_stock')], offset=offset)
|
||||||
for proc in procurement_obj.browse(cr, uid, ids):
|
for proc in procurement_obj.browse(cr, uid, ids):
|
||||||
if ((maxdate).strftime('%Y-%m-%d') >= proc.date_planned) :
|
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)
|
report_ids.append(proc.id)
|
||||||
else:
|
else:
|
||||||
report_later += 1
|
report_later += 1
|
||||||
|
@ -129,7 +129,7 @@ class mrp_procurement(osv.osv):
|
||||||
if not context:
|
if not context:
|
||||||
context = {}
|
context = {}
|
||||||
product_obj = self.pool.get('product.product')
|
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')
|
warehouse_obj = self.pool.get('stock.warehouse')
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
|
|
||||||
|
@ -161,8 +161,8 @@ class mrp_procurement(osv.osv):
|
||||||
'location_id': location_id,
|
'location_id': location_id,
|
||||||
'procure_method': 'make_to_order',
|
'procure_method': 'make_to_order',
|
||||||
})
|
})
|
||||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
|
wf_service.trg_validate(uid, 'procurement.order', 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_check', cr)
|
||||||
|
|
||||||
def _procure_orderpoint_confirm(self, cr, uid, automatic=False,\
|
def _procure_orderpoint_confirm(self, cr, uid, automatic=False,\
|
||||||
use_new_cursor=False, context=None, user_id=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()
|
cr = pooler.get_db(use_new_cursor).cursor()
|
||||||
orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
|
orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
|
||||||
location_obj = self.pool.get('stock.location')
|
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')
|
request_obj = self.pool.get('res.request')
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
report = []
|
report = []
|
||||||
|
@ -217,9 +217,9 @@ class mrp_procurement(osv.osv):
|
||||||
'procure_method': 'make_to_order',
|
'procure_method': 'make_to_order',
|
||||||
'origin': op.name
|
'origin': op.name
|
||||||
})
|
})
|
||||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id,
|
wf_service.trg_validate(uid, 'procurement.order', proc_id,
|
||||||
'button_confirm', cr)
|
'button_confirm', cr)
|
||||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id,
|
wf_service.trg_validate(uid, 'procurement.order', proc_id,
|
||||||
'button_check', cr)
|
'button_check', cr)
|
||||||
orderpoint_obj.write(cr, uid, [op.id],
|
orderpoint_obj.write(cr, uid, [op.id],
|
||||||
{'procurement_id': proc_id})
|
{'procurement_id': proc_id})
|
||||||
|
@ -237,6 +237,6 @@ class mrp_procurement(osv.osv):
|
||||||
cr.commit()
|
cr.commit()
|
||||||
cr.close()
|
cr.close()
|
||||||
return {}
|
return {}
|
||||||
mrp_procurement()
|
procurement_order()
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
import xmlrpclib
|
import xmlrpclib
|
||||||
|
|
||||||
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/wizard')
|
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', {})
|
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', {})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
"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_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_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_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_procurement_compute_all","procurement.order.compute.all","model_procurement_order_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_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","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
|
||||||
|
|
|
|
@ -2,9 +2,9 @@
|
||||||
<openerp>
|
<openerp>
|
||||||
<data noupdate="0">
|
<data noupdate="0">
|
||||||
|
|
||||||
<record model="ir.rule" id="mrp_procurement_rule">
|
<record model="ir.rule" id="procurement_rule">
|
||||||
<field name="name">mrp_procurement multi-company</field>
|
<field name="name">procurement multi-company</field>
|
||||||
<field name="model_id" search="[('model','=','mrp.procurement')]" model="ir.model"/>
|
<field name="model_id" search="[('model','=','procurement.order')]" model="ir.model"/>
|
||||||
<field name="global" eval="True"/>
|
<field name="global" eval="True"/>
|
||||||
<field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
|
<field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
@ -64,7 +64,7 @@ class make_procurement(osv.osv_memory):
|
||||||
"""
|
"""
|
||||||
user = self.pool.get('res.users').browse(cr, uid, uid, context).login
|
user = self.pool.get('res.users').browse(cr, uid, uid, context).login
|
||||||
wh_obj = self.pool.get('stock.warehouse')
|
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")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
data_obj = self.pool.get('ir.model.data')
|
data_obj = self.pool.get('ir.model.data')
|
||||||
|
|
||||||
|
@ -80,11 +80,11 @@ class make_procurement(osv.osv_memory):
|
||||||
'procure_method':'make_to_order',
|
'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')
|
id2 = data_obj._get_id(cr, uid, 'procurement', 'procurement_tree_view')
|
||||||
id3 = data_obj._get_id(cr, uid, 'procurement', 'mrp_procurement_form_view')
|
id3 = data_obj._get_id(cr, uid, 'procurement', 'procurement_form_view')
|
||||||
|
|
||||||
if id2:
|
if id2:
|
||||||
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||||
|
@ -94,7 +94,7 @@ class make_procurement(osv.osv_memory):
|
||||||
return {
|
return {
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'tree,form',
|
'view_mode': 'tree,form',
|
||||||
'res_model': 'mrp.procurement',
|
'res_model': 'procurement.order',
|
||||||
'res_id' : procure_id,
|
'res_id' : procure_id,
|
||||||
'views': [(id3,'form'),(id2,'tree')],
|
'views': [(id3,'form'),(id2,'tree')],
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
|
|
|
@ -23,12 +23,12 @@ import threading
|
||||||
from osv import osv, fields
|
from osv import osv, fields
|
||||||
|
|
||||||
class procurement_compute(osv.osv_memory):
|
class procurement_compute(osv.osv_memory):
|
||||||
_name = 'mrp.procurement.compute'
|
_name = 'procurement.order.compute'
|
||||||
_description = 'Compute Procurement'
|
_description = 'Compute Procurement'
|
||||||
|
|
||||||
def _procure_calculation_procure(self, cr, uid, ids, context):
|
def _procure_calculation_procure(self, cr, uid, ids, context):
|
||||||
try:
|
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)
|
proc_obj._procure_confirm(cr, uid, use_new_cursor=cr.dbname, context=context)
|
||||||
finally:
|
finally:
|
||||||
cr.close()
|
cr.close()
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<record id="view_compute_procurment_wizard" model="ir.ui.view">
|
<record id="view_compute_procurment_wizard" model="ir.ui.view">
|
||||||
<field name="name">Compute Procurements</field>
|
<field name="name">Compute Procurements</field>
|
||||||
<field name="model">mrp.procurement.compute</field>
|
<field name="model">procurement.order.compute</field>
|
||||||
<field name="type">form</field>
|
<field name="type">form</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Parameters">
|
<form string="Parameters">
|
||||||
|
@ -23,8 +23,8 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- <act_window name="Compute Procurements" -->
|
<!-- <act_window name="Compute Procurements" -->
|
||||||
<!-- res_model="mrp.procurement.compute"-->
|
<!-- res_model="procurement.order.compute"-->
|
||||||
<!-- src_model="mrp.procurement"-->
|
<!-- src_model="procurement.order"-->
|
||||||
<!-- view_mode="form"-->
|
<!-- view_mode="form"-->
|
||||||
<!-- target="new" -->
|
<!-- target="new" -->
|
||||||
<!-- key2="client_action_multi" -->
|
<!-- key2="client_action_multi" -->
|
||||||
|
|
|
@ -28,7 +28,7 @@ import threading
|
||||||
from osv import fields,osv
|
from osv import fields,osv
|
||||||
|
|
||||||
class procurement_compute(osv.osv_memory):
|
class procurement_compute(osv.osv_memory):
|
||||||
_name = 'mrp.procurement.orderpoint.compute'
|
_name = 'procurement.orderpoint.compute'
|
||||||
_description = 'Automatic Order Point'
|
_description = 'Automatic Order Point'
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
|
@ -47,7 +47,7 @@ class procurement_compute(osv.osv_memory):
|
||||||
@param ids: List of IDs selected
|
@param ids: List of IDs selected
|
||||||
@param context: A standard dictionary
|
@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):
|
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)
|
proc_obj._procure_orderpoint_confirm(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname, context=context)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<record id="view_procurement_compute_wizard" model="ir.ui.view">
|
<record id="view_procurement_compute_wizard" model="ir.ui.view">
|
||||||
<field name="name">Compute Stock Minimum Rules Only</field>
|
<field name="name">Compute Stock Minimum Rules Only</field>
|
||||||
<field name="model">mrp.procurement.orderpoint.compute</field>
|
<field name="model">procurement.orderpoint.compute</field>
|
||||||
<field name="type">form</field>
|
<field name="type">form</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Parameters">
|
<form string="Parameters">
|
||||||
|
@ -23,8 +23,8 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<act_window name="Compute Stock Minimum Rules Only"
|
<act_window name="Compute Stock Minimum Rules Only"
|
||||||
res_model="mrp.procurement.orderpoint.compute"
|
res_model="procurement.orderpoint.compute"
|
||||||
src_model="mrp.procurement"
|
src_model="procurement.order"
|
||||||
view_mode="form"
|
view_mode="form"
|
||||||
target="new"
|
target="new"
|
||||||
key2="client_action_multi"
|
key2="client_action_multi"
|
||||||
|
|
|
@ -24,7 +24,7 @@ import threading
|
||||||
from osv import osv, fields
|
from osv import osv, fields
|
||||||
|
|
||||||
class procurement_compute_all(osv.osv_memory):
|
class procurement_compute_all(osv.osv_memory):
|
||||||
_name = 'mrp.procurement.compute.all'
|
_name = 'procurement.order.compute.all'
|
||||||
_description = 'Compute all schedulers'
|
_description = 'Compute all schedulers'
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
|
@ -43,7 +43,7 @@ class procurement_compute_all(osv.osv_memory):
|
||||||
@param ids: List of IDs selected
|
@param ids: List of IDs selected
|
||||||
@param context: A standard dictionary
|
@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):
|
for proc in self.browse(cr, uid, ids):
|
||||||
proc_obj.run_scheduler(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname,\
|
proc_obj.run_scheduler(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname,\
|
||||||
context=context)
|
context=context)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<record id="view_compute_schedulers_wizard" model="ir.ui.view">
|
<record id="view_compute_schedulers_wizard" model="ir.ui.view">
|
||||||
<field name="name">Compute Schedulers</field>
|
<field name="name">Compute Schedulers</field>
|
||||||
<field name="model">mrp.procurement.compute.all</field>
|
<field name="model">procurement.order.compute.all</field>
|
||||||
<field name="type">form</field>
|
<field name="type">form</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Scheduler Parameters">
|
<form string="Scheduler Parameters">
|
||||||
|
@ -23,8 +23,8 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<act_window name="Compute Schedulers"
|
<act_window name="Compute Schedulers"
|
||||||
res_model="mrp.procurement.compute.all"
|
res_model="procurement.order.compute.all"
|
||||||
src_model="mrp.procurement"
|
src_model="procurement.order"
|
||||||
view_mode="form"
|
view_mode="form"
|
||||||
target="new"
|
target="new"
|
||||||
key2="client_action_multi"
|
key2="client_action_multi"
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
from osv import fields, osv, orm
|
from osv import fields, osv, orm
|
||||||
import tools
|
import tools
|
||||||
|
|
||||||
class mrp_procurement(osv.osv):
|
class procurement_order(osv.osv):
|
||||||
_name = "mrp.procurement"
|
_name = "procurement.order"
|
||||||
_inherit = "mrp.procurement"
|
_inherit = "procurement.order"
|
||||||
|
|
||||||
def action_produce_assign_service(self, cr, uid, ids, context={}):
|
def action_produce_assign_service(self, cr, uid, ids, context={}):
|
||||||
for procurement in self.browse(cr, uid, ids):
|
for procurement in self.browse(cr, uid, ids):
|
||||||
|
@ -90,7 +90,7 @@ class mrp_procurement(osv.osv):
|
||||||
'project_id': project_id,
|
'project_id': project_id,
|
||||||
},context=context)
|
},context=context)
|
||||||
return task_id
|
return task_id
|
||||||
mrp_procurement()
|
procurement_order()
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ class project_task(osv.osv):
|
||||||
_name = "project.task"
|
_name = "project.task"
|
||||||
_inherit = "project.task"
|
_inherit = "project.task"
|
||||||
_columns = {
|
_columns = {
|
||||||
'procurement_id': fields.many2one('mrp.procurement', 'Procurement', ondelete='set null')
|
'procurement_id': fields.many2one('procurement.order', 'Procurement', ondelete='set null')
|
||||||
}
|
}
|
||||||
|
|
||||||
def do_close(self, cr, uid, ids, *args):
|
def do_close(self, cr, uid, ids, *args):
|
||||||
|
@ -35,7 +35,7 @@ class project_task(osv.osv):
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
if task.procurement_id:
|
if task.procurement_id:
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
wf_service.trg_validate(uid, 'mrp.procurement', task.procurement_id.id, 'subflow.done', cr)
|
wf_service.trg_validate(uid, 'procurement.order', task.procurement_id.id, 'subflow.done', cr)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def do_cancel(self, cr, uid, ids, *args):
|
def do_cancel(self, cr, uid, ids, *args):
|
||||||
|
@ -44,7 +44,7 @@ class project_task(osv.osv):
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
if task.procurement_id:
|
if task.procurement_id:
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
wf_service.trg_validate(uid, 'mrp.procurement', task.procurement_id.id, 'subflow.cancel', cr)
|
wf_service.trg_validate(uid, 'procurement.order', task.procurement_id.id, 'subflow.cancel', cr)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
project_task()
|
project_task()
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||||
"access_mrp_procurement_project_user","mrp.procurement project_user","model_mrp_procurement","project.group_project_user",1,1,1,1
|
"access_procurement_project_user","procurement.order project_user","model_procurement_order","project.group_project_user",1,1,1,1
|
||||||
"access_mrp_procurement_project_manager","mrp.procurement project_manager","model_mrp_procurement","project.group_project_manager",1,1,1,1
|
"access_procurement_project_manager","procurement.order project_manager","model_procurement_order","project.group_project_manager",1,1,1,1
|
||||||
|
|
|
|
@ -48,7 +48,7 @@
|
||||||
-
|
-
|
||||||
I check the procurements.
|
I check the procurements.
|
||||||
-
|
-
|
||||||
!python {model: mrp.procurement}: |
|
!python {model: procurement.order}: |
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
orderline_obj = self.pool.get('sale.order.line')
|
orderline_obj = self.pool.get('sale.order.line')
|
||||||
line_ids = orderline_obj.search(cr, uid, [('order_id','=', ref('sale_order_so0'))])
|
line_ids = orderline_obj.search(cr, uid, [('order_id','=', ref('sale_order_so0'))])
|
||||||
|
@ -58,8 +58,8 @@
|
||||||
-
|
-
|
||||||
The scheduler runs.
|
The scheduler runs.
|
||||||
-
|
-
|
||||||
!function {model: mrp.procurement, name: run_scheduler}:
|
!function {model: procurement.order, name: run_scheduler}:
|
||||||
- model: mrp.procurement
|
- model: procurement.order
|
||||||
search: "[('state','=','confirmed')]"
|
search: "[('state','=','confirmed')]"
|
||||||
-
|
-
|
||||||
Now I check the tasks.
|
Now I check the tasks.
|
||||||
|
|
|
@ -697,8 +697,8 @@ class purchase_order_line(osv.osv):
|
||||||
return True
|
return True
|
||||||
purchase_order_line()
|
purchase_order_line()
|
||||||
|
|
||||||
class mrp_procurement(osv.osv):
|
class procurement_order(osv.osv):
|
||||||
_inherit = 'mrp.procurement'
|
_inherit = 'procurement.order'
|
||||||
_columns = {
|
_columns = {
|
||||||
'purchase_id': fields.many2one('purchase.order', 'Latest Requisition'),
|
'purchase_id': fields.many2one('purchase.order', 'Latest Requisition'),
|
||||||
}
|
}
|
||||||
|
@ -776,7 +776,7 @@ class mrp_procurement(osv.osv):
|
||||||
res[procurement.id] = purchase_id
|
res[procurement.id] = purchase_id
|
||||||
self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': purchase_id})
|
self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': purchase_id})
|
||||||
return res
|
return res
|
||||||
mrp_procurement()
|
procurement_order()
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
||||||
|
|
|
@ -329,9 +329,9 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<record id="view_procurement_form_inherit" model="ir.ui.view">
|
<record id="view_procurement_form_inherit" model="ir.ui.view">
|
||||||
<field name="name">mrp.procurement.form.inherit</field>
|
<field name="name">procurement.order.form.inherit</field>
|
||||||
<field name="model">mrp.procurement</field>
|
<field name="model">procurement.order</field>
|
||||||
<field name="inherit_id" ref="procurement.mrp_procurement_form_view"/>
|
<field name="inherit_id" ref="procurement.procurement_form_view"/>
|
||||||
<field name="type">form</field>
|
<field name="type">form</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="/form/notebook/page/field[@name='close_move']" position="before">
|
<xpath expr="/form/notebook/page/field[@name='close_move']" position="before">
|
||||||
|
|
|
@ -136,11 +136,11 @@ class product_product(osv.osv):
|
||||||
product_product()
|
product_product()
|
||||||
|
|
||||||
|
|
||||||
class mrp_procurement(osv.osv):
|
class procurement_order(osv.osv):
|
||||||
_inherit = 'mrp.procurement'
|
_inherit = 'procurement.order'
|
||||||
def make_po(self, cr, uid, ids, context={}):
|
def make_po(self, cr, uid, ids, context={}):
|
||||||
sequence_obj=self.pool.get('ir.sequence')
|
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():
|
for proc_id,po_id in res.items():
|
||||||
procurement = self.browse(cr, uid, proc_id)
|
procurement = self.browse(cr, uid, proc_id)
|
||||||
if procurement.product_id.purchase_requisition:
|
if procurement.product_id.purchase_requisition:
|
||||||
|
@ -157,4 +157,4 @@ class mrp_procurement(osv.osv):
|
||||||
'purchase_ids': [(6,0,[po_id])]
|
'purchase_ids': [(6,0,[po_id])]
|
||||||
})
|
})
|
||||||
return res
|
return res
|
||||||
mrp_procurement()
|
procurement_order()
|
||||||
|
|
|
@ -59,8 +59,8 @@
|
||||||
-
|
-
|
||||||
I launch he scheduler to compute all procurements, and specify all requisitions orders.
|
I launch he scheduler to compute all procurements, and specify all requisitions orders.
|
||||||
-
|
-
|
||||||
!python {model: mrp.procurement.compute.all}: |
|
!python {model: procurement.order.compute.all}: |
|
||||||
proc_obj = self.pool.get('mrp.procurement')
|
proc_obj = self.pool.get('procurement.order')
|
||||||
proc_obj._procure_confirm(cr,uid)
|
proc_obj._procure_confirm(cr,uid)
|
||||||
-
|
-
|
||||||
On the purchase tender, I create a new purchase order for the supplier 'DistriPC' by clicking on
|
On the purchase tender, I create a new purchase order for the supplier 'DistriPC' by clicking on
|
||||||
|
|
|
@ -52,8 +52,8 @@
|
||||||
-
|
-
|
||||||
I launch he scheduler to compute all procurements, and planify all requisitions orders.
|
I launch he scheduler to compute all procurements, and planify all requisitions orders.
|
||||||
-
|
-
|
||||||
!python {model: mrp.procurement.compute.all}: |
|
!python {model: procurement.order.compute.all}: |
|
||||||
proc_obj = self.pool.get('mrp.procurement')
|
proc_obj = self.pool.get('procurement.order')
|
||||||
proc_obj._procure_confirm(cr,uid)
|
proc_obj._procure_confirm(cr,uid)
|
||||||
-
|
-
|
||||||
I should find a purchase requisition with the origin 'TEST/TENDER/0002', that includes a request for
|
I should find a purchase requisition with the origin 'TEST/TENDER/0002', that includes a request for
|
||||||
|
|
|
@ -64,11 +64,11 @@
|
||||||
|
|
||||||
<record id="process_node_saleprocurement0" model="process.node">
|
<record id="process_node_saleprocurement0" model="process.node">
|
||||||
<field name="menu_id" ref="procurement.menu_mrp_procurement_action"/>
|
<field name="menu_id" ref="procurement.menu_mrp_procurement_action"/>
|
||||||
<field name="model_id" ref="procurement.model_mrp_procurement"/>
|
<field name="model_id" ref="procurement.model_procurement_order"/>
|
||||||
<field eval=""""subflow"""" name="kind"/>
|
<field eval=""""subflow"""" name="kind"/>
|
||||||
<field eval=""""Procurement Order"""" name="name"/>
|
<field eval=""""Procurement Order"""" name="name"/>
|
||||||
<field eval=""""One Procurement order for each sale order line and for each of the components."""" name="note"/>
|
<field eval=""""One Procurement order for each sale order line and for each of the components."""" name="note"/>
|
||||||
<field name="subflow_id" ref="mrp_procurement.process_process_procurementprocess0"/>
|
<field name="subflow_id" ref="procurement.process_process_procurementprocess0"/>
|
||||||
<field name="process_id" ref="process_process_salesprocess0"/>
|
<field name="process_id" ref="process_process_salesprocess0"/>
|
||||||
<field eval=""""object.state=='confirmed'"""" name="model_states"/>
|
<field eval=""""object.state=='confirmed'"""" name="model_states"/>
|
||||||
<field eval="1" name="flow_start"/>
|
<field eval="1" name="flow_start"/>
|
||||||
|
|
|
@ -113,7 +113,7 @@ class sale_order(osv.osv):
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
stock_picking p on (p.id=m.picking_id)
|
stock_picking p on (p.id=m.picking_id)
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
mrp_procurement mp on (mp.move_id=m.id)
|
procurement_order mp on (mp.move_id=m.id)
|
||||||
WHERE
|
WHERE
|
||||||
p.sale_id = ANY(%s) GROUP BY mp.state, p.sale_id''',(ids,))
|
p.sale_id = ANY(%s) GROUP BY mp.state, p.sale_id''',(ids,))
|
||||||
for oid, nbr, mp_state in cr.fetchall():
|
for oid, nbr, mp_state in cr.fetchall():
|
||||||
|
@ -659,7 +659,7 @@ class sale_order(osv.osv):
|
||||||
'note': line.notes,
|
'note': line.notes,
|
||||||
'company_id': order.company_id.id,
|
'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,
|
'name': order.name,
|
||||||
'origin': order.name,
|
'origin': order.name,
|
||||||
'date_planned': date_planned,
|
'date_planned': date_planned,
|
||||||
|
@ -677,10 +677,10 @@ class sale_order(osv.osv):
|
||||||
'company_id': order.company_id.id,
|
'company_id': order.company_id.id,
|
||||||
})
|
})
|
||||||
wf_service = netsvc.LocalService("workflow")
|
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})
|
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':
|
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,
|
'name': line.name,
|
||||||
'origin': order.name,
|
'origin': order.name,
|
||||||
'date_planned': date_planned,
|
'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})
|
self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
|
||||||
wf_service = netsvc.LocalService("workflow")
|
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:
|
else:
|
||||||
#
|
#
|
||||||
# No procurement because no product in the sale.order.line.
|
# 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),
|
'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),
|
'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),
|
'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_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_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')),
|
'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_uos_qty or 0.0
|
||||||
return line.product_uom_qty
|
return line.product_uom_qty
|
||||||
else:
|
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)
|
line.procurement_id.id, context=context)
|
||||||
|
|
||||||
def _get_line_uom(line):
|
def _get_line_uom(line):
|
||||||
|
@ -874,7 +874,7 @@ class sale_order_line(osv.osv):
|
||||||
return line.product_uos.id
|
return line.product_uos.id
|
||||||
return line.product_uom.id
|
return line.product_uom.id
|
||||||
else:
|
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)
|
line.procurement_id.id, context=context)
|
||||||
|
|
||||||
create_ids = []
|
create_ids = []
|
||||||
|
|
|
@ -206,7 +206,7 @@
|
||||||
<workflow action="order_confirm" model="sale.order" ref="order5"/>
|
<workflow action="order_confirm" model="sale.order" ref="order5"/>
|
||||||
|
|
||||||
<!-- Run all schedulers -->
|
<!-- Run all schedulers -->
|
||||||
<function model="mrp.procurement" name="run_scheduler"/>
|
<function model="procurement.order" name="run_scheduler"/>
|
||||||
|
|
||||||
|
|
||||||
<!-- sale advance demo.. -->
|
<!-- sale advance demo.. -->
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
</assert>
|
</assert>
|
||||||
|
|
||||||
<!-- Run all schedulers -->
|
<!-- Run all schedulers -->
|
||||||
<function model="mrp.procurement" name="run_scheduler"/>
|
<function model="procurement.order" name="run_scheduler"/>
|
||||||
|
|
||||||
<assert id="test_order_1" model="sale.order" string="the sale order is now done">
|
<assert id="test_order_1" model="sale.order" string="the sale order is now done">
|
||||||
<test expr="state">done</test>
|
<test expr="state">done</test>
|
||||||
|
|
|
@ -218,7 +218,7 @@
|
||||||
<record id="trans_ship_ship_end" model="workflow.transition">
|
<record id="trans_ship_ship_end" model="workflow.transition">
|
||||||
<field name="act_from" ref="act_ship"/>
|
<field name="act_from" ref="act_ship"/>
|
||||||
<field name="act_to" ref="act_ship_end"/>
|
<field name="act_to" ref="act_ship_end"/>
|
||||||
<field name="trigger_model">mrp.procurement</field>
|
<field name="trigger_model">procurement.order</field>
|
||||||
<field name="trigger_expr_id">procurement_lines_get()</field>
|
<field name="trigger_expr_id">procurement_lines_get()</field>
|
||||||
<field name="condition">test_state('finished')</field>
|
<field name="condition">test_state('finished')</field>
|
||||||
</record>
|
</record>
|
||||||
|
@ -226,7 +226,7 @@
|
||||||
<field name="act_from" ref="act_ship"/>
|
<field name="act_from" ref="act_ship"/>
|
||||||
<field name="act_to" ref="act_ship_except"/>
|
<field name="act_to" ref="act_ship_except"/>
|
||||||
<!--
|
<!--
|
||||||
<field name="trigger_model">mrp.procurement</field>
|
<field name="trigger_model">procurement.order</field>
|
||||||
<field name="trigger_expr_id">procurement_lines_get()</field>
|
<field name="trigger_expr_id">procurement_lines_get()</field>
|
||||||
-->
|
-->
|
||||||
<field name="condition">test_state('canceled')</field>
|
<field name="condition">test_state('canceled')</field>
|
||||||
|
|
|
@ -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_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_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_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_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_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
|
"access_sale_order_manager","sale.order.manager","model_sale_order","group_sale_manager",1,1,1,1
|
||||||
|
|
|
|
@ -72,21 +72,21 @@
|
||||||
-
|
-
|
||||||
I check that one procurement is generated.
|
I check that one procurement is generated.
|
||||||
-
|
-
|
||||||
!python {model: mrp.procurement}: |
|
!python {model: procurement.order}: |
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
proc_ids = self.search(cr, uid, [('state','=','confirmed')])
|
proc_ids = self.search(cr, uid, [('state','=','confirmed')])
|
||||||
assert proc_ids, _('No Procurements!')
|
assert proc_ids, _('No Procurements!')
|
||||||
-
|
-
|
||||||
The scheduler runs.
|
The scheduler runs.
|
||||||
-
|
-
|
||||||
!function {model: mrp.procurement, name: run_scheduler}:
|
!function {model: procurement.order, name: run_scheduler}:
|
||||||
- model: mrp.procurement
|
- model: procurement.order
|
||||||
search: "[('state','=','confirmed')]"
|
search: "[('state','=','confirmed')]"
|
||||||
-
|
-
|
||||||
I check that the procurement for the product table is in exception state.
|
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.
|
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 _
|
from tools.translate import _
|
||||||
proc_ids = self.search(cr, uid, [('state','=','exception')])
|
proc_ids = self.search(cr, uid, [('state','=','exception')])
|
||||||
assert proc_ids, _('No Procurements are in exception state!')
|
assert proc_ids, _('No Procurements are in exception state!')
|
||||||
|
|
|
@ -899,7 +899,7 @@ class stock_planning(osv.osv):
|
||||||
raise osv.except_osv(_('Error !'), _('Incoming Left must be greater than 0 !'))
|
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)
|
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)
|
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,
|
'company_id' : obj.company_id.id,
|
||||||
'name': _('Manual planning for ') + obj.period_id.name,
|
'name': _('Manual planning for ') + obj.period_id.name,
|
||||||
'origin': _('MPS(') + str(user.login) +') '+ obj.period_id.name,
|
'origin': _('MPS(') + str(user.login) +') '+ obj.period_id.name,
|
||||||
|
@ -926,7 +926,7 @@ class stock_planning(osv.osv):
|
||||||
|
|
||||||
}, context=context)
|
}, context=context)
|
||||||
wf_service = netsvc.LocalService("workflow")
|
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)
|
self.calculate_planning(cr, uid, ids, context)
|
||||||
prev_text = obj.history or ""
|
prev_text = obj.history or ""
|
||||||
self.write(cr, uid, ids, {
|
self.write(cr, uid, ids, {
|
||||||
|
|
Loading…
Reference in New Issue