[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>
|
||||
<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="%(procurement.mrp_procurement_action4)d" string="Procurements in Exception"/>
|
||||
<action colspan="4" name="%(procurement.procurement_action4)d" string="Procurements in Exception"/>
|
||||
</child1>
|
||||
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<form string="Warehouse board">
|
||||
<hpaned position="100">
|
||||
<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" />
|
||||
</child1>
|
||||
|
||||
|
|
|
@ -837,7 +837,7 @@ class mrp_production(osv.osv):
|
|||
seq_obj = self.pool.get('ir.sequence')
|
||||
pick_obj = self.pool.get('stock.picking')
|
||||
move_obj = self.pool.get('stock.move')
|
||||
proc_obj = self.pool.get('mrp.procurement')
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for production in self.browse(cr, uid, ids):
|
||||
if not production.product_lines:
|
||||
|
@ -931,7 +931,7 @@ class mrp_production(osv.osv):
|
|||
'move_id': move_id,
|
||||
'company_id': production.company_id.id,
|
||||
})
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
proc_ids.append(proc_id)
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
|
||||
self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'})
|
||||
|
|
|
@ -406,9 +406,9 @@
|
|||
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" />
|
||||
<!-- <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" />-->
|
||||
|
||||
<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">
|
||||
<field name="name">mrp.procurement.form.inherit</field>
|
||||
<field name="model">mrp.procurement</field>
|
||||
<field name="inherit_id" ref="procurement.mrp_procurement_form_view"/>
|
||||
<field name="name">procurement.order.form.inherit</field>
|
||||
<field name="model">procurement.order</field>
|
||||
<field name="inherit_id" ref="procurement.procurement_form_view"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook/page/field[@name='move_id']" position="before">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<record id="process_node_procureproducts0" model="process.node">
|
||||
<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=""""The way to procurement depends on the product type."""" name="note"/>
|
||||
<field eval=""""Procure Products"""" name="name"/>
|
||||
|
@ -26,7 +26,7 @@
|
|||
|
||||
<record id="process_node_procureproducts0" model="process.node">
|
||||
<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=""""The way to procurement depends on the product type."""" name="note"/>
|
||||
<field eval=""""Procure Products"""" name="name"/>
|
||||
|
@ -47,7 +47,7 @@
|
|||
|
||||
<record id="process_node_stockproduct0" model="process.node">
|
||||
<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=""""Product type is Stockable or Consumable."""" name="note"/>
|
||||
<field eval=""""Stockable Product"""" name="name"/>
|
||||
|
@ -59,7 +59,7 @@
|
|||
|
||||
<record id="process_node_stockproduct1" model="process.node">
|
||||
<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=""""For stockable products and consumables"""" name="note"/>
|
||||
<field eval=""""Stockable Product"""" name="name"/>
|
||||
|
@ -71,7 +71,7 @@
|
|||
|
||||
<record id="process_node_serviceproduct0" model="process.node">
|
||||
<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=""""Product type is service"""" name="note"/>
|
||||
<field eval=""""Service"""" name="name"/>
|
||||
|
@ -83,7 +83,7 @@
|
|||
|
||||
<record id="process_node_serviceproduct1" model="process.node">
|
||||
<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=""""For Services."""" name="note"/>
|
||||
<field eval=""""Service"""" name="name"/>
|
||||
|
@ -95,7 +95,7 @@
|
|||
|
||||
<record id="process_node_purchaseprocure0" model="process.node">
|
||||
<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=""""Procurement Orders"""" name="name"/>
|
||||
<field eval=""""For purchased material"""" name="note"/>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<record id="process_process_serviceproductprocess0" model="process.process">
|
||||
<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"/>
|
||||
</record>
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
|||
|
||||
<record id="process_node_serviceonorder0" model="process.node">
|
||||
<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=""""Assignment from Production or Purchase Order."""" name="note"/>
|
||||
<field eval=""""Make to Order"""" name="name"/>
|
||||
|
@ -29,7 +29,7 @@
|
|||
|
||||
<record id="process_node_servicemts0" model="process.node">
|
||||
<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=""""Assignment from stock."""" name="note"/>
|
||||
<field eval=""""Make to stock"""" name="name"/>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<record id="process_process_stockableproductprocess0" model="process.process">
|
||||
<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"/>
|
||||
</record>
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
|||
|
||||
<record id="process_node_mts0" model="process.node">
|
||||
<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=""""Assignment from stock."""" name="note"/>
|
||||
<field eval=""""Make to Stock"""" name="name"/>
|
||||
|
@ -29,7 +29,7 @@
|
|||
|
||||
<record id="process_node_stock0" model="process.node">
|
||||
<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=""""Assignment from Production or Purchase Order."""" name="note"/>
|
||||
<field eval=""""Make to Order"""" name="name"/>
|
||||
|
|
|
@ -27,8 +27,8 @@ import ir
|
|||
import netsvc
|
||||
import time
|
||||
|
||||
class mrp_procurement(osv.osv):
|
||||
_inherit = 'mrp.procurement'
|
||||
class procurement_order(osv.osv):
|
||||
_inherit = 'procurement.order'
|
||||
_columns = {
|
||||
'bom_id': fields.many2one('mrp.bom', 'BoM', ondelete='cascade', select=True),
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class mrp_procurement(osv.osv):
|
|||
properties = [x.id for x in procurement.property_ids]
|
||||
bom_id = self.pool.get('mrp.bom')._bom_find(cr, uid, procurement.product_id.id, procurement.product_uom.id, properties)
|
||||
if not bom_id:
|
||||
cr.execute('update mrp_procurement set message=%s where id=%s', (_('No BoM defined for this product !'), procurement.id))
|
||||
cr.execute('update procurement_order set message=%s where id=%s', (_('No BoM defined for this product !'), procurement.id))
|
||||
return False
|
||||
return True
|
||||
|
||||
|
@ -48,7 +48,7 @@ class mrp_procurement(osv.osv):
|
|||
""" This is action which call from workflow to assign production order to procurements
|
||||
@return: True
|
||||
"""
|
||||
procurement_obj = self.pool.get('mrp.procurement')
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
res = procurement_obj.make_mo(cr, uid, ids, context=context)
|
||||
res = res.values()
|
||||
return len(res) and res[0] or 0 #TO CHECK: why workflow is generated error if return not integer value
|
||||
|
@ -62,7 +62,7 @@ class mrp_procurement(osv.osv):
|
|||
production_obj = self.pool.get('mrp.production')
|
||||
move_obj = self.pool.get('stock.move')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
procurement_obj = self.pool.get('mrp.procurement')
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
for procurement in procurement_obj.browse(cr, uid, ids):
|
||||
res_id = procurement.move_id.id
|
||||
loc_id = procurement.location_id.id
|
||||
|
@ -91,6 +91,6 @@ class mrp_procurement(osv.osv):
|
|||
{'location_id': procurement.location_id.id})
|
||||
return res
|
||||
|
||||
mrp_procurement()
|
||||
procurement_order()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"access_mrp_production","mrp.production","model_mrp_production","mrp.group_mrp_user",1,1,1,1
|
||||
"access_mrp_production_workcenter_line","mrp.production.workcenter.line","model_mrp_production_workcenter_line","mrp.group_mrp_user",1,1,1,1
|
||||
"access_mrp_production_product_line","mrp.production.product.line","model_mrp_production_product_line","mrp.group_mrp_user",1,1,1,1
|
||||
"access_mrp_procurement","mrp.procurement","model_mrp_procurement","mrp.group_mrp_user",1,1,1,1
|
||||
"access_procurement","procurement.order","model_procurement_order","mrp.group_mrp_user",1,1,1,1
|
||||
"access_mrp_workcenter_manager","mrp.workcenter.manager","model_mrp_workcenter","mrp.group_mrp_user",1,1,1,1
|
||||
"access_mrp_routing_manager","mrp.routing.manager","model_mrp_routing","mrp.group_mrp_manager",1,1,1,1
|
||||
"access_mrp_routing_workcenter_manager","mrp.routing.workcenter.manager","model_mrp_routing_workcenter","mrp.group_mrp_manager",1,1,1,1
|
||||
|
@ -22,7 +22,7 @@
|
|||
"access_purchase_order_mrp_worker","purchase.order mrp_worker","purchase.model_purchase_order","mrp.group_mrp_user",1,0,0,0
|
||||
"access_purchase_order_line_mrp_worker","purchase.order.line mrp_worker","purchase.model_purchase_order_line","mrp.group_mrp_user",1,0,0,0
|
||||
"access_hr_timesheet_group_mrp_worker","resource.calendar mrp_worker","resource.model_resource_calendar","mrp.group_mrp_user",1,0,0,0
|
||||
"access_mrp_procurement_stock_worker","mrp.procurement stock_worker","model_mrp_procurement","stock.group_stock_user",1,1,1,1
|
||||
"access_procurement_stock_worker","procurement.order stock_worker","model_procurement_order","stock.group_stock_user",1,1,1,1
|
||||
"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0
|
||||
"access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0
|
||||
"access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0
|
||||
|
|
|
|
@ -51,7 +51,7 @@ class stock_warehouse_orderpoint(osv.osv):
|
|||
"a procurement to bring the virtual stock to the Max Quantity."),
|
||||
'qty_multiple': fields.integer('Qty Multiple', required=True,
|
||||
help="The procurement quantity will by rounded up to this multiple."),
|
||||
'procurement_id': fields.many2one('mrp.procurement', 'Latest procurement', ondelete="set null"),
|
||||
'procurement_id': fields.many2one('procurement.order', 'Latest procurement', ondelete="set null"),
|
||||
'company_id': fields.many2one('res.company','Company',required=True),
|
||||
}
|
||||
_defaults = {
|
||||
|
@ -103,7 +103,7 @@ class StockMove(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'production_id': fields.many2one('mrp.production', 'Production', select=True),
|
||||
'procurements': fields.one2many('mrp.procurement', 'move_id', 'Procurements'),
|
||||
'procurements': fields.one2many('procurement.order', 'move_id', 'Procurements'),
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
|
@ -118,7 +118,7 @@ class StockMove(osv.osv):
|
|||
"""
|
||||
bom_obj = self.pool.get('mrp.bom')
|
||||
move_obj = self.pool.get('stock.move')
|
||||
procurement_obj = self.pool.get('mrp.procurement')
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
product_obj = self.pool.get('product.product')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
if move.product_id.supply_method == 'produce' and move.product_id.procure_method == 'make_to_order':
|
||||
|
@ -166,7 +166,7 @@ class StockMove(osv.osv):
|
|||
'move_id': mid,
|
||||
'company_id': line['company_id'],
|
||||
})
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
move_obj.write(cr, uid, [move.id], {
|
||||
'location_id': move.location_dest_id.id,
|
||||
'auto_validate': True,
|
||||
|
@ -175,7 +175,7 @@ class StockMove(osv.osv):
|
|||
'state': 'waiting'
|
||||
})
|
||||
for m in procurement_obj.search(cr, uid, [('move_id','=',move.id)], context):
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', m, 'button_wait_done', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', m, 'button_wait_done', cr)
|
||||
return True
|
||||
|
||||
def action_consume(self, cr, uid, ids, product_qty, location_id=False, context=None):
|
||||
|
@ -231,7 +231,7 @@ class StockPicking(osv.osv):
|
|||
for move in picking.move_lines:
|
||||
if move.state == 'done' and move.procurements:
|
||||
for procurement in move.procurements:
|
||||
wf_service.trg_validate(user, 'mrp.procurement',
|
||||
wf_service.trg_validate(user, 'procurement.order',
|
||||
procurement.id, 'button_check', cursor)
|
||||
return res
|
||||
|
||||
|
|
|
@ -180,15 +180,15 @@
|
|||
-
|
||||
I am checking Procurement orders. There are 3 orders generated for Oranges, Sugar and Water.
|
||||
-
|
||||
!python {model: mrp.procurement}: |
|
||||
!python {model: procurement.order}: |
|
||||
from tools.translate import _
|
||||
proc_ids = self.search(cr, uid, [('state','!=','cofirmed')])
|
||||
assert proc_ids, _('No Procurements!')
|
||||
-
|
||||
The scheduler runs.
|
||||
-
|
||||
!function {model: mrp.procurement, name: run_scheduler}:
|
||||
- model: mrp.procurement
|
||||
!function {model: procurement.order, name: run_scheduler}:
|
||||
- model: procurement.order
|
||||
search: "[('state','!=','cofirmed')]"
|
||||
-
|
||||
I am checking Internal picking. I see one picking for Orange juice and its
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
-
|
||||
I create a procurement order for product Shirt.
|
||||
-
|
||||
!record {model: mrp.procurement, id: mrp_procurement_shirt0}:
|
||||
!record {model: procurement.order, id: procurement_order_shirt0}:
|
||||
name: 'PROC: Shirt'
|
||||
product_id: product_product_shirt0
|
||||
product_qty: 5.00
|
||||
|
@ -138,11 +138,11 @@
|
|||
-
|
||||
I confirm the procurement order.
|
||||
-
|
||||
!workflow {model: mrp.procurement, action: button_confirm, ref: mrp_procurement_shirt0}
|
||||
!workflow {model: procurement.order, action: button_confirm, ref: procurement_order_shirt0}
|
||||
-
|
||||
I run the procurement.
|
||||
-
|
||||
!workflow {model: mrp.procurement, action: button_check, ref: mrp_procurement_shirt0}
|
||||
!workflow {model: procurement.order, action: button_check, ref: procurement_order_shirt0}
|
||||
-
|
||||
I see that there is a manufacturing order for Shirt.
|
||||
-
|
||||
|
@ -153,15 +153,15 @@
|
|||
-
|
||||
I also check that there are two more procurement orders for sub products Cloth and Buttons.
|
||||
-
|
||||
!python {model: mrp.procurement}: |
|
||||
!python {model: procurement.order}: |
|
||||
from tools.translate import _
|
||||
proc_ids = self.search(cr, uid, [('product_id','in',[ref('product_product_cloth0'),ref('product_product_buttons0')])])
|
||||
assert proc_ids, 'No Procurements.'
|
||||
-
|
||||
The scheduler runs.
|
||||
-
|
||||
!function {model: mrp.procurement, name: run_scheduler}:
|
||||
- model: mrp.procurement
|
||||
!function {model: procurement.order, name: run_scheduler}:
|
||||
- model: procurement.order
|
||||
search: "[]"
|
||||
-
|
||||
I check that there is one purchase order for Cloth.
|
||||
|
@ -290,8 +290,8 @@
|
|||
-
|
||||
Run scheduler again.
|
||||
-
|
||||
!function {model: mrp.procurement, name: run_scheduler}:
|
||||
- model: mrp.procurement
|
||||
!function {model: procurement.order, name: run_scheduler}:
|
||||
- model: procurement.order
|
||||
search: "[]"
|
||||
-
|
||||
Check state of manufacturing order for Shirt.
|
||||
|
|
|
@ -84,15 +84,15 @@
|
|||
-
|
||||
I am checking Procurement orders.
|
||||
-
|
||||
!python {model: mrp.procurement}: |
|
||||
!python {model: procurement.order}: |
|
||||
from tools.translate import _
|
||||
proc_ids = self.search(cr, uid, [('state','!=','confirmed')])
|
||||
assert proc_ids, _('No Procurements!')
|
||||
-
|
||||
The scheduler runs.
|
||||
-
|
||||
!function {model: mrp.procurement, name: run_scheduler}:
|
||||
- model: mrp.procurement
|
||||
!function {model: procurement.order, name: run_scheduler}:
|
||||
- model: procurement.order
|
||||
search: "[('state','=','confirmed')]"
|
||||
-
|
||||
I am checking Internal picking.
|
||||
|
|
|
@ -36,15 +36,15 @@
|
|||
-
|
||||
I am checking Procurement orders.
|
||||
-
|
||||
!python {model: mrp.procurement}: |
|
||||
!python {model: procurement.order}: |
|
||||
from tools.translate import _
|
||||
proc_ids = self.search(cr, uid, [('state','=','confirmed')])
|
||||
assert proc_ids, _('No Procurements!')
|
||||
-
|
||||
The scheduler runs.
|
||||
-
|
||||
!function {model: mrp.procurement, name: run_scheduler}:
|
||||
- model: mrp.procurement
|
||||
!function {model: procurement.order, name: run_scheduler}:
|
||||
- model: procurement.order
|
||||
search: "[('state','=','confirmed')]"
|
||||
-
|
||||
I am checking Internal picking.
|
||||
|
|
|
@ -132,7 +132,7 @@
|
|||
</record>
|
||||
|
||||
<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=""""MRP - Procurement"""" name="name"/>
|
||||
<field eval="0" name="perm_unlink"/>
|
||||
|
@ -474,12 +474,12 @@
|
|||
<field name="group_id" ref="res_groups_posuser0"/>
|
||||
</record>
|
||||
<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_write" />
|
||||
<field eval="1" name="perm_create" />
|
||||
<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"/>
|
||||
</record>
|
||||
<record id="ir_model_access_tax0" model="ir.model.access">
|
||||
|
|
|
@ -214,7 +214,7 @@
|
|||
</record>
|
||||
|
||||
<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=""""MRP - Procurement"""" name="name"/>
|
||||
<field eval="0" name="perm_unlink"/>
|
||||
|
@ -557,12 +557,12 @@
|
|||
<field name="group_id" ref="res_groups_posuser0"/>
|
||||
</record>
|
||||
<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_write" />
|
||||
<field eval="1" name="perm_create" />
|
||||
<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"/>
|
||||
</record>
|
||||
<record id="ir_model_access_tax0" model="ir.model.access">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<record id="process_process_procurementprocess0" model="process.process">
|
||||
<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"/>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -62,11 +62,11 @@ mrp_property()
|
|||
# Produce, Buy or Find products and place a move
|
||||
# then wizard for picking lists & move
|
||||
#
|
||||
class mrp_procurement(osv.osv):
|
||||
class procurement_order(osv.osv):
|
||||
"""
|
||||
Procurement Orders
|
||||
"""
|
||||
_name = "mrp.procurement"
|
||||
_name = "procurement.order"
|
||||
_description = "Procurement"
|
||||
_order = 'priority,date_planned desc'
|
||||
_log_create = False
|
||||
|
@ -92,7 +92,7 @@ class mrp_procurement(osv.osv):
|
|||
|
||||
'note': fields.text('Note'),
|
||||
|
||||
'property_ids': fields.many2many('mrp.property', 'mrp_procurement_property_rel', 'procurement_id','property_id', 'Properties'),
|
||||
'property_ids': fields.many2many('mrp.property', 'procurement_property_rel', 'procurement_id','property_id', 'Properties'),
|
||||
|
||||
'message': fields.char('Latest error', size=64, help="Exception occurred while computing procurement orders."),
|
||||
'state': fields.selection([
|
||||
|
@ -115,7 +115,7 @@ class mrp_procurement(osv.osv):
|
|||
'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'close_move': lambda *a: 0,
|
||||
'procure_method': lambda *a: 'make_to_order',
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.procurement', context=c)
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'procurement.order', context=c)
|
||||
}
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
|
@ -176,7 +176,7 @@ class mrp_procurement(osv.osv):
|
|||
return res
|
||||
|
||||
#
|
||||
# This method may be overrided by objects that override mrp.procurment
|
||||
# This method may be overrided by objects that override procurement.order
|
||||
# for computing their own purpose
|
||||
#
|
||||
def _quantity_compute_get(self, cr, uid, proc, context={}):
|
||||
|
@ -286,7 +286,7 @@ class mrp_procurement(osv.osv):
|
|||
if procurement.product_id.product_tmpl_id.supply_method <> 'buy':
|
||||
return False
|
||||
if not procurement.product_id.seller_ids:
|
||||
cr.execute('update mrp_procurement set message=%s where id=%s', (_('No supplier defined for this product !'), procurement.id))
|
||||
cr.execute('update procurement_order set message=%s where id=%s', (_('No supplier defined for this product !'), procurement.id))
|
||||
return False
|
||||
partner = procurement.product_id.seller_ids[0].name
|
||||
if user.company_id and user.company_id.partner_id:
|
||||
|
@ -294,7 +294,7 @@ class mrp_procurement(osv.osv):
|
|||
return False
|
||||
address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery']
|
||||
if not address_id:
|
||||
cr.execute('update mrp_procurement set message=%s where id=%s', (_('No address defined for the supplier'), procurement.id))
|
||||
cr.execute('update procurement_order set message=%s where id=%s', (_('No address defined for the supplier'), procurement.id))
|
||||
return False
|
||||
return True
|
||||
|
||||
|
@ -358,7 +358,7 @@ class mrp_procurement(osv.osv):
|
|||
ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id])
|
||||
cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,))
|
||||
if not cr.fetchone()[0]:
|
||||
cr.execute('update mrp_procurement set message=%s where id=%s', (_('Stock is not enough and No minimum orderpoint rule defined'), procurement.id))
|
||||
cr.execute('update procurement_order set message=%s where id=%s', (_('Stock is not enough and No minimum orderpoint rule defined'), procurement.id))
|
||||
return ok
|
||||
|
||||
def action_produce_assign_service(self, cr, uid, ids, context={}):
|
||||
|
@ -403,7 +403,7 @@ class mrp_procurement(osv.osv):
|
|||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
wf_service.trg_trigger(uid, 'mrp.procurement', id, cr)
|
||||
wf_service.trg_trigger(uid, 'procurement.order', id, cr)
|
||||
return True
|
||||
|
||||
def action_check_finnished(self, cr, uid, ids):
|
||||
|
@ -439,7 +439,7 @@ class mrp_procurement(osv.osv):
|
|||
res = self.write(cr, uid, ids, {'state': 'done', 'date_close': time.strftime('%Y-%m-%d')})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
wf_service.trg_trigger(uid, 'mrp.procurement', id, cr)
|
||||
wf_service.trg_trigger(uid, 'procurement.order', id, cr)
|
||||
return res
|
||||
|
||||
def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
|
||||
|
@ -452,7 +452,7 @@ class mrp_procurement(osv.osv):
|
|||
self._procure_orderpoint_confirm(cr, uid, automatic=automatic,\
|
||||
use_new_cursor=use_new_cursor, context=context)
|
||||
|
||||
mrp_procurement()
|
||||
procurement_order()
|
||||
|
||||
|
||||
class stock_warehouse_orderpoint(osv.osv):
|
||||
|
@ -460,16 +460,16 @@ class stock_warehouse_orderpoint(osv.osv):
|
|||
Defines Minimum stock rules.
|
||||
"""
|
||||
_name = "stock.warehouse.orderpoint"
|
||||
_description = "Orderpoint minimum rule"
|
||||
|
||||
_description = "Minimum Inventory Rule"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=32, required=True),
|
||||
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the orderpoint without removing it."),
|
||||
'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
|
||||
'location_id': fields.many2one('stock.location', 'Location', required=True),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True, ondelete="cascade"),
|
||||
'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete="cascade"),
|
||||
'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]),
|
||||
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True ),
|
||||
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
|
||||
'product_min_qty': fields.float('Min Quantity', required=True,
|
||||
help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
|
||||
"a procurement to bring the virtual stock to the Max Quantity."),
|
||||
|
@ -478,7 +478,7 @@ class stock_warehouse_orderpoint(osv.osv):
|
|||
"a procurement to bring the virtual stock to the Max Quantity."),
|
||||
'qty_multiple': fields.integer('Qty Multiple', required=True,
|
||||
help="The procurement quantity will by rounded up to this multiple."),
|
||||
'procurement_id': fields.many2one('mrp.procurement', 'Latest procurement'),
|
||||
'procurement_id': fields.many2one('procurement.order', 'Latest procurement', ondelete="set null"),
|
||||
'company_id': fields.many2one('res.company','Company',required=True),
|
||||
}
|
||||
_defaults = {
|
||||
|
@ -489,7 +489,10 @@ class stock_warehouse_orderpoint(osv.osv):
|
|||
'product_uom': lambda sel, cr, uid, context: context.get('product_uom', False),
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=c)
|
||||
}
|
||||
|
||||
_sql_constraints = [
|
||||
('qty_multiple_check', 'CHECK( qty_multiple > 0 )', _('Qty Multiple must be greater than zero.')),
|
||||
]
|
||||
|
||||
def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context={}):
|
||||
""" Finds location id for changed warehouse.
|
||||
@param warehouse_id: Changed id of warehouse.
|
||||
|
@ -500,7 +503,7 @@ class stock_warehouse_orderpoint(osv.osv):
|
|||
v = {'location_id': w.lot_stock_id.id}
|
||||
return {'value': v}
|
||||
return {}
|
||||
|
||||
|
||||
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
|
||||
""" Finds UoM for changed product.
|
||||
@param product_id: Changed id of product.
|
||||
|
@ -511,7 +514,7 @@ class stock_warehouse_orderpoint(osv.osv):
|
|||
v = {'product_uom': prod.uom_id.id}
|
||||
return {'value': v}
|
||||
return {}
|
||||
|
||||
|
||||
def copy(self, cr, uid, id, default=None,context={}):
|
||||
if not default:
|
||||
default = {}
|
||||
|
@ -519,6 +522,6 @@ class stock_warehouse_orderpoint(osv.osv):
|
|||
'name': self.pool.get('ir.sequence').get(cr, uid, 'mrp.warehouse.orderpoint') or '',
|
||||
})
|
||||
return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context)
|
||||
|
||||
|
||||
stock_warehouse_orderpoint()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<field name="interval_type">days</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<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="'(False,)'" name="args"/>
|
||||
</record>
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
Procurement
|
||||
-->
|
||||
|
||||
<record id="mrp_procurement_tree_view" model="ir.ui.view">
|
||||
<field name="name">mrp.procurement.tree</field>
|
||||
<field name="model">mrp.procurement</field>
|
||||
<record id="procurement_tree_view" model="ir.ui.view">
|
||||
<field name="name">procurement.order.tree</field>
|
||||
<field name="model">procurement.order</field>
|
||||
<field name="type">tree</field>
|
||||
<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')">
|
||||
|
@ -22,9 +22,9 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="mrp_procurement_form_view" model="ir.ui.view">
|
||||
<field name="name">mrp.procurement.form</field>
|
||||
<field name="model">mrp.procurement</field>
|
||||
<record id="procurement_form_view" model="ir.ui.view">
|
||||
<field name="name">procurement.order.form</field>
|
||||
<field name="model">procurement.order</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Procurement">
|
||||
|
@ -79,9 +79,9 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_mrp_procurement_filter" model="ir.ui.view">
|
||||
<field name="name">mrp.procurement.select</field>
|
||||
<field name="model">mrp.procurement</field>
|
||||
<record id="view_procurement_filter" model="ir.ui.view">
|
||||
<field name="name">procurement.order.select</field>
|
||||
<field name="model">procurement.order</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Procurement">
|
||||
|
@ -109,51 +109,51 @@
|
|||
</search>
|
||||
</field>
|
||||
</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="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_id" eval="False"/>
|
||||
<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>
|
||||
</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="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_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="context">{}</field>
|
||||
</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="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_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','exception')]</field>
|
||||
</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="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_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','exception'), ('message', '<>', '')]</field>
|
||||
<field name="filter" eval="True"/>
|
||||
</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="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_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','exception'), ('message', '=', '')]</field>
|
||||
|
@ -255,17 +255,17 @@
|
|||
<act_window
|
||||
context="{'product_uom': locals().has_key('uom_id') and uom_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"
|
||||
res_model="stock.warehouse.orderpoint"
|
||||
src_model="mrp.procurement"/>
|
||||
src_model="procurement.order"/>
|
||||
|
||||
<act_window
|
||||
domain="[('id', '=', product_id)]"
|
||||
id="act_product_product_2_stock_warehouse_orderpoint"
|
||||
name="Product"
|
||||
res_model="product.product"
|
||||
src_model="mrp.procurement"/>
|
||||
src_model="procurement.order"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<data>
|
||||
|
||||
<record id="wkf_procurement" model="workflow">
|
||||
<field name="name">mrp.procurement.basic</field>
|
||||
<field name="osv">mrp.procurement</field>
|
||||
<field name="name">procurement.order.basic</field>
|
||||
<field name="osv">procurement.order</field>
|
||||
<field name="on_create">True</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ from mx import DateTime
|
|||
import time
|
||||
|
||||
|
||||
class mrp_procurement(osv.osv):
|
||||
_inherit = 'mrp.procurement'
|
||||
class procurement_order(osv.osv):
|
||||
_inherit = 'procurement.order'
|
||||
|
||||
def _procure_confirm(self, cr, uid, ids=None, use_new_cursor=False, context=None):
|
||||
'''
|
||||
|
@ -40,11 +40,11 @@ class mrp_procurement(osv.osv):
|
|||
cr = pooler.get_db(use_new_cursor).cursor()
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
procurement_obj = self.pool.get('mrp.procurement')
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
if not ids:
|
||||
ids = procurement_obj.search(cr, uid, [], order="date_planned")
|
||||
for id in ids:
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', id, 'button_restart', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', id, 'button_restart', cr)
|
||||
if use_new_cursor:
|
||||
cr.commit()
|
||||
|
||||
|
@ -57,11 +57,11 @@ class mrp_procurement(osv.osv):
|
|||
report_except = 0
|
||||
report_later = 0
|
||||
while True:
|
||||
cr.execute('select id from mrp_procurement where state=%s and procure_method=%s order by priority,date_planned limit 500 offset %s', ('confirmed', 'make_to_order', offset))
|
||||
cr.execute('select id from procurement_order where state=%s and procure_method=%s order by priority,date_planned limit 500 offset %s', ('confirmed', 'make_to_order', offset))
|
||||
ids = map(lambda x: x[0], cr.fetchall())
|
||||
for proc in procurement_obj.browse(cr, uid, ids):
|
||||
if (maxdate.strftime('%Y-%m-%d') >= proc.date_planned):
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc.id, 'button_check', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc.id, 'button_check', cr)
|
||||
else:
|
||||
offset += 1
|
||||
report_later += 1
|
||||
|
@ -84,7 +84,7 @@ class mrp_procurement(osv.osv):
|
|||
ids = procurement_obj.search(cr, uid, [('state', '=', 'confirmed'), ('procure_method', '=', 'make_to_stock')], offset=offset)
|
||||
for proc in procurement_obj.browse(cr, uid, ids):
|
||||
if ((maxdate).strftime('%Y-%m-%d') >= proc.date_planned) :
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc.id, 'button_check', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc.id, 'button_check', cr)
|
||||
report_ids.append(proc.id)
|
||||
else:
|
||||
report_later += 1
|
||||
|
@ -129,7 +129,7 @@ class mrp_procurement(osv.osv):
|
|||
if not context:
|
||||
context = {}
|
||||
product_obj = self.pool.get('product.product')
|
||||
proc_obj = self.pool.get('mrp.procurement')
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
warehouse_obj = self.pool.get('stock.warehouse')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
|
@ -161,8 +161,8 @@ class mrp_procurement(osv.osv):
|
|||
'location_id': location_id,
|
||||
'procure_method': 'make_to_order',
|
||||
})
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_check', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr)
|
||||
|
||||
def _procure_orderpoint_confirm(self, cr, uid, automatic=False,\
|
||||
use_new_cursor=False, context=None, user_id=False):
|
||||
|
@ -175,7 +175,7 @@ class mrp_procurement(osv.osv):
|
|||
cr = pooler.get_db(use_new_cursor).cursor()
|
||||
orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
|
||||
location_obj = self.pool.get('stock.location')
|
||||
procurement_obj = self.pool.get('mrp.procurement')
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
request_obj = self.pool.get('res.request')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
report = []
|
||||
|
@ -217,9 +217,9 @@ class mrp_procurement(osv.osv):
|
|||
'procure_method': 'make_to_order',
|
||||
'origin': op.name
|
||||
})
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id,
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id,
|
||||
'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id,
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id,
|
||||
'button_check', cr)
|
||||
orderpoint_obj.write(cr, uid, [op.id],
|
||||
{'procurement_id': proc_id})
|
||||
|
@ -237,6 +237,6 @@ class mrp_procurement(osv.osv):
|
|||
cr.commit()
|
||||
cr.close()
|
||||
return {}
|
||||
mrp_procurement()
|
||||
procurement_order()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
import xmlrpclib
|
||||
|
||||
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/wizard')
|
||||
wiz_id = sock.create('trunk', 1, 'admin', 'mrp.procurement.compute.all')
|
||||
wiz_id = sock.create('trunk', 1, 'admin', 'procurement.order.compute.all')
|
||||
sock.execute('trunk', 1, 'admin', wiz_id, {'form': {'po_cycle': 1.0, 'po_lead': 1.0, 'user_id': 3, 'schedule_cycle': 1.0, 'picking_lead': 1.0, 'security_lead': 50.0, 'automatic': False}, 'ids': [], 'report_type': 'pdf', 'model': 'ir.ui.menu', 'id': False}, 'compute', {})
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_mrp_property_group","mrp.property.group","model_mrp_property_group",,1,0,0,0
|
||||
"access_mrp_property","mrp.property","model_mrp_property",,1,0,0,0
|
||||
"access_mrp_procurement","mrp.procurement","model_mrp_procurement",,1,0,0,0
|
||||
"access_procurement","procurement.order","model_procurement_order",,1,0,0,0
|
||||
"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint",,1,0,0,0
|
||||
"access_mrp_procurement_compute_all","mrp.procurement.compute.all","model_mrp_procurement_compute_all",,1,0,0,0
|
||||
"access_mrp_procurement_orderpoint_compute","mrp.procurement.orderpoint.compute","model_mrp_procurement_orderpoint_compute",,1,0,0,0
|
||||
"access_procurement_compute_all","procurement.order.compute.all","model_procurement_order_compute_all",,1,0,0,0
|
||||
"access_procurement_orderpoint_compute","procurement.orderpoint.compute","model_procurement_orderpoint_compute",,1,0,0,0
|
||||
"access_mrp_make_procurement","make.procurement","model_make_procurement",,1,0,0,0
|
||||
"access_mrp_make_procurement","mrp.procurement.compute","model_mrp_procurement_compute",,1,0,0,0
|
||||
"access_mrp_make_procurement","procurement.order.compute","model_procurement_order_compute",,1,0,0,0
|
||||
|
|
|
|
@ -2,9 +2,9 @@
|
|||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record model="ir.rule" id="mrp_procurement_rule">
|
||||
<field name="name">mrp_procurement multi-company</field>
|
||||
<field name="model_id" search="[('model','=','mrp.procurement')]" model="ir.model"/>
|
||||
<record model="ir.rule" id="procurement_rule">
|
||||
<field name="name">procurement multi-company</field>
|
||||
<field name="model_id" search="[('model','=','procurement.order')]" model="ir.model"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
|
||||
</record>
|
||||
|
|
|
@ -64,7 +64,7 @@ class make_procurement(osv.osv_memory):
|
|||
"""
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context).login
|
||||
wh_obj = self.pool.get('stock.warehouse')
|
||||
procurement_obj = self.pool.get('mrp.procurement')
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
|
||||
|
@ -80,11 +80,11 @@ class make_procurement(osv.osv_memory):
|
|||
'procure_method':'make_to_order',
|
||||
})
|
||||
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', procure_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', procure_id, 'button_confirm', cr)
|
||||
|
||||
|
||||
id2 = data_obj._get_id(cr, uid, 'procurement', 'mrp_procurement_tree_view')
|
||||
id3 = data_obj._get_id(cr, uid, 'procurement', 'mrp_procurement_form_view')
|
||||
id2 = data_obj._get_id(cr, uid, 'procurement', 'procurement_tree_view')
|
||||
id3 = data_obj._get_id(cr, uid, 'procurement', 'procurement_form_view')
|
||||
|
||||
if id2:
|
||||
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||
|
@ -94,7 +94,7 @@ class make_procurement(osv.osv_memory):
|
|||
return {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'mrp.procurement',
|
||||
'res_model': 'procurement.order',
|
||||
'res_id' : procure_id,
|
||||
'views': [(id3,'form'),(id2,'tree')],
|
||||
'type': 'ir.actions.act_window',
|
||||
|
|
|
@ -23,12 +23,12 @@ import threading
|
|||
from osv import osv, fields
|
||||
|
||||
class procurement_compute(osv.osv_memory):
|
||||
_name = 'mrp.procurement.compute'
|
||||
_name = 'procurement.order.compute'
|
||||
_description = 'Compute Procurement'
|
||||
|
||||
def _procure_calculation_procure(self, cr, uid, ids, context):
|
||||
try:
|
||||
proc_obj = self.pool.get('mrp.procurement')
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
proc_obj._procure_confirm(cr, uid, use_new_cursor=cr.dbname, context=context)
|
||||
finally:
|
||||
cr.close()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<record id="view_compute_procurment_wizard" model="ir.ui.view">
|
||||
<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="arch" type="xml">
|
||||
<form string="Parameters">
|
||||
|
@ -23,8 +23,8 @@
|
|||
</record>
|
||||
|
||||
<!-- <act_window name="Compute Procurements" -->
|
||||
<!-- res_model="mrp.procurement.compute"-->
|
||||
<!-- src_model="mrp.procurement"-->
|
||||
<!-- res_model="procurement.order.compute"-->
|
||||
<!-- src_model="procurement.order"-->
|
||||
<!-- view_mode="form"-->
|
||||
<!-- target="new" -->
|
||||
<!-- key2="client_action_multi" -->
|
||||
|
|
|
@ -28,7 +28,7 @@ import threading
|
|||
from osv import fields,osv
|
||||
|
||||
class procurement_compute(osv.osv_memory):
|
||||
_name = 'mrp.procurement.orderpoint.compute'
|
||||
_name = 'procurement.orderpoint.compute'
|
||||
_description = 'Automatic Order Point'
|
||||
|
||||
_columns = {
|
||||
|
@ -47,7 +47,7 @@ class procurement_compute(osv.osv_memory):
|
|||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
"""
|
||||
proc_obj = self.pool.get('mrp.procurement')
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
for proc in self.browse(cr, uid, ids):
|
||||
proc_obj._procure_orderpoint_confirm(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname, context=context)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<record id="view_procurement_compute_wizard" model="ir.ui.view">
|
||||
<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="arch" type="xml">
|
||||
<form string="Parameters">
|
||||
|
@ -23,8 +23,8 @@
|
|||
</record>
|
||||
|
||||
<act_window name="Compute Stock Minimum Rules Only"
|
||||
res_model="mrp.procurement.orderpoint.compute"
|
||||
src_model="mrp.procurement"
|
||||
res_model="procurement.orderpoint.compute"
|
||||
src_model="procurement.order"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
|
|
|
@ -24,7 +24,7 @@ import threading
|
|||
from osv import osv, fields
|
||||
|
||||
class procurement_compute_all(osv.osv_memory):
|
||||
_name = 'mrp.procurement.compute.all'
|
||||
_name = 'procurement.order.compute.all'
|
||||
_description = 'Compute all schedulers'
|
||||
|
||||
_columns = {
|
||||
|
@ -43,7 +43,7 @@ class procurement_compute_all(osv.osv_memory):
|
|||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
"""
|
||||
proc_obj = self.pool.get('mrp.procurement')
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
for proc in self.browse(cr, uid, ids):
|
||||
proc_obj.run_scheduler(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname,\
|
||||
context=context)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<record id="view_compute_schedulers_wizard" model="ir.ui.view">
|
||||
<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="arch" type="xml">
|
||||
<form string="Scheduler Parameters">
|
||||
|
@ -23,8 +23,8 @@
|
|||
</record>
|
||||
|
||||
<act_window name="Compute Schedulers"
|
||||
res_model="mrp.procurement.compute.all"
|
||||
src_model="mrp.procurement"
|
||||
res_model="procurement.order.compute.all"
|
||||
src_model="procurement.order"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
from osv import fields, osv, orm
|
||||
import tools
|
||||
|
||||
class mrp_procurement(osv.osv):
|
||||
_name = "mrp.procurement"
|
||||
_inherit = "mrp.procurement"
|
||||
class procurement_order(osv.osv):
|
||||
_name = "procurement.order"
|
||||
_inherit = "procurement.order"
|
||||
|
||||
def action_produce_assign_service(self, cr, uid, ids, context={}):
|
||||
for procurement in self.browse(cr, uid, ids):
|
||||
|
@ -90,7 +90,7 @@ class mrp_procurement(osv.osv):
|
|||
'project_id': project_id,
|
||||
},context=context)
|
||||
return task_id
|
||||
mrp_procurement()
|
||||
procurement_order()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class project_task(osv.osv):
|
|||
_name = "project.task"
|
||||
_inherit = "project.task"
|
||||
_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):
|
||||
|
@ -35,7 +35,7 @@ class project_task(osv.osv):
|
|||
for task in tasks:
|
||||
if task.procurement_id:
|
||||
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
|
||||
|
||||
def do_cancel(self, cr, uid, ids, *args):
|
||||
|
@ -44,7 +44,7 @@ class project_task(osv.osv):
|
|||
for task in tasks:
|
||||
if task.procurement_id:
|
||||
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
|
||||
|
||||
project_task()
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
"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_mrp_procurement_project_manager","mrp.procurement project_manager","model_mrp_procurement","project.group_project_manager",1,1,1,1
|
||||
"access_procurement_project_user","procurement.order project_user","model_procurement_order","project.group_project_user",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.
|
||||
-
|
||||
!python {model: mrp.procurement}: |
|
||||
!python {model: procurement.order}: |
|
||||
from tools.translate import _
|
||||
orderline_obj = self.pool.get('sale.order.line')
|
||||
line_ids = orderline_obj.search(cr, uid, [('order_id','=', ref('sale_order_so0'))])
|
||||
|
@ -58,8 +58,8 @@
|
|||
-
|
||||
The scheduler runs.
|
||||
-
|
||||
!function {model: mrp.procurement, name: run_scheduler}:
|
||||
- model: mrp.procurement
|
||||
!function {model: procurement.order, name: run_scheduler}:
|
||||
- model: procurement.order
|
||||
search: "[('state','=','confirmed')]"
|
||||
-
|
||||
Now I check the tasks.
|
||||
|
|
|
@ -697,8 +697,8 @@ class purchase_order_line(osv.osv):
|
|||
return True
|
||||
purchase_order_line()
|
||||
|
||||
class mrp_procurement(osv.osv):
|
||||
_inherit = 'mrp.procurement'
|
||||
class procurement_order(osv.osv):
|
||||
_inherit = 'procurement.order'
|
||||
_columns = {
|
||||
'purchase_id': fields.many2one('purchase.order', 'Latest Requisition'),
|
||||
}
|
||||
|
@ -776,7 +776,7 @@ class mrp_procurement(osv.osv):
|
|||
res[procurement.id] = purchase_id
|
||||
self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': purchase_id})
|
||||
return res
|
||||
mrp_procurement()
|
||||
procurement_order()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -329,9 +329,9 @@
|
|||
-->
|
||||
|
||||
<record id="view_procurement_form_inherit" model="ir.ui.view">
|
||||
<field name="name">mrp.procurement.form.inherit</field>
|
||||
<field name="model">mrp.procurement</field>
|
||||
<field name="inherit_id" ref="procurement.mrp_procurement_form_view"/>
|
||||
<field name="name">procurement.order.form.inherit</field>
|
||||
<field name="model">procurement.order</field>
|
||||
<field name="inherit_id" ref="procurement.procurement_form_view"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook/page/field[@name='close_move']" position="before">
|
||||
|
|
|
@ -136,11 +136,11 @@ class product_product(osv.osv):
|
|||
product_product()
|
||||
|
||||
|
||||
class mrp_procurement(osv.osv):
|
||||
_inherit = 'mrp.procurement'
|
||||
class procurement_order(osv.osv):
|
||||
_inherit = 'procurement.order'
|
||||
def make_po(self, cr, uid, ids, context={}):
|
||||
sequence_obj=self.pool.get('ir.sequence')
|
||||
res = super(mrp_procurement, self).make_po(cr, uid, ids, context)
|
||||
res = super(procurement_order, self).make_po(cr, uid, ids, context)
|
||||
for proc_id,po_id in res.items():
|
||||
procurement = self.browse(cr, uid, proc_id)
|
||||
if procurement.product_id.purchase_requisition:
|
||||
|
@ -157,4 +157,4 @@ class mrp_procurement(osv.osv):
|
|||
'purchase_ids': [(6,0,[po_id])]
|
||||
})
|
||||
return res
|
||||
mrp_procurement()
|
||||
procurement_order()
|
||||
|
|
|
@ -59,8 +59,8 @@
|
|||
-
|
||||
I launch he scheduler to compute all procurements, and specify all requisitions orders.
|
||||
-
|
||||
!python {model: mrp.procurement.compute.all}: |
|
||||
proc_obj = self.pool.get('mrp.procurement')
|
||||
!python {model: procurement.order.compute.all}: |
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
proc_obj._procure_confirm(cr,uid)
|
||||
-
|
||||
On the purchase tender, I create a new purchase order for the supplier 'DistriPC' by clicking on
|
||||
|
|
|
@ -52,8 +52,8 @@
|
|||
-
|
||||
I launch he scheduler to compute all procurements, and planify all requisitions orders.
|
||||
-
|
||||
!python {model: mrp.procurement.compute.all}: |
|
||||
proc_obj = self.pool.get('mrp.procurement')
|
||||
!python {model: procurement.order.compute.all}: |
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
proc_obj._procure_confirm(cr,uid)
|
||||
-
|
||||
I should find a purchase requisition with the origin 'TEST/TENDER/0002', that includes a request for
|
||||
|
|
|
@ -64,11 +64,11 @@
|
|||
|
||||
<record id="process_node_saleprocurement0" model="process.node">
|
||||
<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=""""Procurement Order"""" name="name"/>
|
||||
<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 eval=""""object.state=='confirmed'"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
|
|
|
@ -113,7 +113,7 @@ class sale_order(osv.osv):
|
|||
LEFT JOIN
|
||||
stock_picking p on (p.id=m.picking_id)
|
||||
LEFT JOIN
|
||||
mrp_procurement mp on (mp.move_id=m.id)
|
||||
procurement_order mp on (mp.move_id=m.id)
|
||||
WHERE
|
||||
p.sale_id = ANY(%s) GROUP BY mp.state, p.sale_id''',(ids,))
|
||||
for oid, nbr, mp_state in cr.fetchall():
|
||||
|
@ -659,7 +659,7 @@ class sale_order(osv.osv):
|
|||
'note': line.notes,
|
||||
'company_id': order.company_id.id,
|
||||
})
|
||||
proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
|
||||
proc_id = self.pool.get('procurement.order').create(cr, uid, {
|
||||
'name': order.name,
|
||||
'origin': order.name,
|
||||
'date_planned': date_planned,
|
||||
|
@ -677,10 +677,10 @@ class sale_order(osv.osv):
|
|||
'company_id': order.company_id.id,
|
||||
})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
|
||||
elif line.product_id and line.product_id.product_tmpl_id.type == 'service':
|
||||
proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
|
||||
proc_id = self.pool.get('procurement.order').create(cr, uid, {
|
||||
'name': line.name,
|
||||
'origin': order.name,
|
||||
'date_planned': date_planned,
|
||||
|
@ -694,7 +694,7 @@ class sale_order(osv.osv):
|
|||
})
|
||||
self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
else:
|
||||
#
|
||||
# No procurement because no product in the sale.order.line.
|
||||
|
@ -815,7 +815,7 @@ class sale_order_line(osv.osv):
|
|||
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True),
|
||||
'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True),
|
||||
'invoiced': fields.boolean('Invoiced', readonly=True),
|
||||
'procurement_id': fields.many2one('mrp.procurement', 'Procurement'),
|
||||
'procurement_id': fields.many2one('procurement.order', 'Procurement'),
|
||||
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price'), readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'price_net': fields.function(_amount_line_net, method=True, string='Net Price', digits_compute= dp.get_precision('Sale Price')),
|
||||
'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute= dp.get_precision('Sale Price')),
|
||||
|
@ -865,7 +865,7 @@ class sale_order_line(osv.osv):
|
|||
return line.product_uos_qty or 0.0
|
||||
return line.product_uom_qty
|
||||
else:
|
||||
return self.pool.get('mrp.procurement').quantity_get(cr, uid,
|
||||
return self.pool.get('procurement.order').quantity_get(cr, uid,
|
||||
line.procurement_id.id, context=context)
|
||||
|
||||
def _get_line_uom(line):
|
||||
|
@ -874,7 +874,7 @@ class sale_order_line(osv.osv):
|
|||
return line.product_uos.id
|
||||
return line.product_uom.id
|
||||
else:
|
||||
return self.pool.get('mrp.procurement').uom_get(cr, uid,
|
||||
return self.pool.get('procurement.order').uom_get(cr, uid,
|
||||
line.procurement_id.id, context=context)
|
||||
|
||||
create_ids = []
|
||||
|
|
|
@ -206,7 +206,7 @@
|
|||
<workflow action="order_confirm" model="sale.order" ref="order5"/>
|
||||
|
||||
<!-- Run all schedulers -->
|
||||
<function model="mrp.procurement" name="run_scheduler"/>
|
||||
<function model="procurement.order" name="run_scheduler"/>
|
||||
|
||||
|
||||
<!-- sale advance demo.. -->
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
</assert>
|
||||
|
||||
<!-- 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">
|
||||
<test expr="state">done</test>
|
||||
|
|
|
@ -218,7 +218,7 @@
|
|||
<record id="trans_ship_ship_end" model="workflow.transition">
|
||||
<field name="act_from" ref="act_ship"/>
|
||||
<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="condition">test_state('finished')</field>
|
||||
</record>
|
||||
|
@ -226,7 +226,7 @@
|
|||
<field name="act_from" ref="act_ship"/>
|
||||
<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="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_stock_picking_salesman","stock_picking salesman","stock.model_stock_picking","group_sale_user",1,1,1,1
|
||||
"access_stock_move_salesman","stock_move salesman","stock.model_stock_move","group_sale_user",1,1,1,0
|
||||
"access_mrp_procurement_salesman","mrp.procurement salesman","procurement.model_mrp_procurement","group_sale_user",1,1,1,1
|
||||
"access_procurement_salesman","procurement.order salesman","procurement.model_procurement_order","group_sale_user",1,1,1,1
|
||||
"access_sale_order_stock_worker","sale.order stock worker","model_sale_order","stock.group_stock_user",1,1,0,0
|
||||
"access_sale_order_line_stock_worker","sale.order.line stock worker","model_sale_order_line","stock.group_stock_user",1,1,0,0
|
||||
"access_sale_order_manager","sale.order.manager","model_sale_order","group_sale_manager",1,1,1,1
|
||||
|
|
|
|
@ -72,21 +72,21 @@
|
|||
-
|
||||
I check that one procurement is generated.
|
||||
-
|
||||
!python {model: mrp.procurement}: |
|
||||
!python {model: procurement.order}: |
|
||||
from tools.translate import _
|
||||
proc_ids = self.search(cr, uid, [('state','=','confirmed')])
|
||||
assert proc_ids, _('No Procurements!')
|
||||
-
|
||||
The scheduler runs.
|
||||
-
|
||||
!function {model: mrp.procurement, name: run_scheduler}:
|
||||
- model: mrp.procurement
|
||||
!function {model: procurement.order, name: run_scheduler}:
|
||||
- model: procurement.order
|
||||
search: "[('state','=','confirmed')]"
|
||||
-
|
||||
I check that the procurement for the product table is in exception state.
|
||||
As my product's supply method is produce and mrp module is yet not installed.
|
||||
-
|
||||
!python {model: mrp.procurement}: |
|
||||
!python {model: procurement.order}: |
|
||||
from tools.translate import _
|
||||
proc_ids = self.search(cr, uid, [('state','=','exception')])
|
||||
assert proc_ids, _('No Procurements are in exception state!')
|
||||
|
|
|
@ -899,7 +899,7 @@ class stock_planning(osv.osv):
|
|||
raise osv.except_osv(_('Error !'), _('Incoming Left must be greater than 0 !'))
|
||||
uom_qty, uom, uos_qty, uos = self._qty_to_standard(cr, uid, obj, context)
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context)
|
||||
proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
|
||||
proc_id = self.pool.get('procurement.order').create(cr, uid, {
|
||||
'company_id' : obj.company_id.id,
|
||||
'name': _('Manual planning for ') + obj.period_id.name,
|
||||
'origin': _('MPS(') + str(user.login) +') '+ obj.period_id.name,
|
||||
|
@ -926,7 +926,7 @@ class stock_planning(osv.osv):
|
|||
|
||||
}, context=context)
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
self.calculate_planning(cr, uid, ids, context)
|
||||
prev_text = obj.history or ""
|
||||
self.write(cr, uid, ids, {
|
||||
|
|
Loading…
Reference in New Issue