[IMP] procurment: Task ID-819: mrp_procurement should be renamed in procurement ...
authoruco (OpenERP) <uco@tinyerp.com>
Thu, 27 May 2010 12:47:06 +0000 (18:17 +0530)
committeruco (OpenERP) <uco@tinyerp.com>
Thu, 27 May 2010 12:47:06 +0000 (18:17 +0530)
bzr revid: uco@tinyerp.com-20100527124706-uptnmyrdopc9yht9

49 files changed:
addons/board_manufacturing/board_manufacturing_view.xml
addons/board_warehouse/board_warehouse_view.xml
addons/mrp/mrp.py
addons/mrp/mrp_view.xml
addons/mrp/process/procurement_process.xml
addons/mrp/process/service_product_process.xml
addons/mrp/process/stockable_product_process.xml
addons/mrp/procurement.py
addons/mrp/security/ir.model.access.csv
addons/mrp/stock.py
addons/mrp/test/mrp_phantom_bom.yml
addons/mrp/test/mrp_procurement.yml
addons/mrp/test/mrp_production_order.yml
addons/mrp_operations/test/mrp_operations.yml
addons/point_of_sale/posrule_data.xml
addons/point_of_sale/posrule_data2.xml
addons/procurement/process/procurement_process.xml
addons/procurement/procurement.py
addons/procurement/procurement_data.xml
addons/procurement/procurement_view.xml
addons/procurement/procurement_workflow.xml
addons/procurement/schedulers.py
addons/procurement/scripts/scheduler.py
addons/procurement/security/ir.model.access.csv
addons/procurement/security/procurement_security.xml
addons/procurement/wizard/make_procurement_product.py
addons/procurement/wizard/mrp_procurement.py
addons/procurement/wizard/mrp_procurement_view.xml
addons/procurement/wizard/orderpoint_procurement.py
addons/procurement/wizard/orderpoint_procurement_view.xml
addons/procurement/wizard/schedulers_all.py
addons/procurement/wizard/schedulers_all_view.xml
addons/project_mrp/mrp.py
addons/project_mrp/project_mrp.py
addons/project_mrp/security/ir.model.access.csv
addons/project_mrp/test/project_task_procurement.yml
addons/purchase/purchase.py
addons/purchase/purchase_view.xml
addons/purchase_requisition/purchase_requisition.py
addons/purchase_requisition/test/purchase_requisition.yml
addons/purchase_requisition/test/purchase_requisition_exclusive.yml
addons/sale/process/sale_process.xml
addons/sale/sale.py
addons/sale/sale_demo.xml
addons/sale/sale_unit_test.xml
addons/sale/sale_workflow.xml
addons/sale/security/ir.model.access.csv
addons/sale/test/sale_procurement.yml
addons/stock_planning/stock_planning.py

index b223f12..37624d6 100644 (file)
@@ -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>
 
 
index 4ce02a7..08ece3f 100644 (file)
@@ -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>
 
index e720de2..b5a0be6 100644 (file)
@@ -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'})
index 6ee6342..74affb2 100644 (file)
         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"/>
         -->
 
         <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">
index 25c204a..16369ee 100644 (file)
@@ -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="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
             <field eval="&quot;&quot;&quot;The way to procurement depends on the product type.&quot;&quot;&quot;" name="note"/>
             <field eval="&quot;&quot;&quot;Procure Products&quot;&quot;&quot;" 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="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
             <field eval="&quot;&quot;&quot;The way to procurement depends on the product type.&quot;&quot;&quot;" name="note"/>
             <field eval="&quot;&quot;&quot;Procure Products&quot;&quot;&quot;" 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="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
             <field eval="&quot;&quot;&quot;Product type is Stockable or Consumable.&quot;&quot;&quot;" name="note"/>
             <field eval="&quot;&quot;&quot;Stockable Product&quot;&quot;&quot;" 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="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
             <field eval="&quot;&quot;&quot;For stockable products and consumables&quot;&quot;&quot;" name="note"/>
             <field eval="&quot;&quot;&quot;Stockable Product&quot;&quot;&quot;" 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="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
             <field eval="&quot;&quot;&quot;Product type is service&quot;&quot;&quot;" name="note"/>
             <field eval="&quot;&quot;&quot;Service&quot;&quot;&quot;" 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="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
             <field eval="&quot;&quot;&quot;For Services.&quot;&quot;&quot;" name="note"/>
             <field eval="&quot;&quot;&quot;Service&quot;&quot;&quot;" 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="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
             <field eval="&quot;&quot;&quot;Procurement Orders&quot;&quot;&quot;" name="name"/>
             <field eval="&quot;&quot;&quot;For purchased material&quot;&quot;&quot;" name="note"/>
index 60bf3b5..a96a7a7 100644 (file)
@@ -8,7 +8,7 @@
 
                <record id="process_process_serviceproductprocess0" model="process.process">
                        <field eval="&quot;&quot;&quot;Service&quot;&quot;&quot;" 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="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
                        <field eval="&quot;&quot;&quot;Assignment from Production or Purchase Order.&quot;&quot;&quot;" name="note"/>
                        <field eval="&quot;&quot;&quot;Make to Order&quot;&quot;&quot;" 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="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
                        <field eval="&quot;&quot;&quot;Assignment from stock.&quot;&quot;&quot;" name="note"/>
                        <field eval="&quot;&quot;&quot;Make to stock&quot;&quot;&quot;" name="name"/>
index c053103..bb5c36a 100644 (file)
@@ -8,7 +8,7 @@
 
                <record id="process_process_stockableproductprocess0" model="process.process">
                        <field eval="&quot;&quot;&quot;Stockable Product&quot;&quot;&quot;" 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="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
                        <field eval="&quot;&quot;&quot;Assignment from stock.&quot;&quot;&quot;" name="note"/>
                        <field eval="&quot;&quot;&quot;Make to Stock&quot;&quot;&quot;" 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="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
                        <field eval="&quot;&quot;&quot;Assignment from Production or Purchase Order.&quot;&quot;&quot;" name="note"/>
                        <field eval="&quot;&quot;&quot;Make to Order&quot;&quot;&quot;" name="name"/>
index 4ebd11f..d704afa 100644 (file)
@@ -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:
index d5e00b9..8f58f71 100644 (file)
@@ -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
index 9bcc92e..f319c22 100644 (file)
@@ -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
 
index c95ab26..4a3e2e3 100644 (file)
 -
   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 
index c52fa4a..1fe0f74 100644 (file)
 -
   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
 -
   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.
 -
 -
   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.
 -
   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.
index 861f52e..0ceebfa 100644 (file)
 -
   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.
index 32b5963..f5777d4 100644 (file)
 -
   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.
index 4945711..905e78e 100644 (file)
                </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="&quot;&quot;&quot;MRP - Procurement&quot;&quot;&quot;" name="name"/>
                        <field eval="0" name="perm_unlink"/>
                        <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="&quot;&quot;&quot;mrp.procurement&quot;&quot;&quot;" />
+            <field name="name" eval="&quot;&quot;&quot;procurement.order&quot;&quot;&quot;" />
                        <field name="group_id" ref="res_groups_posuser0"/>
         </record>
         <record id="ir_model_access_tax0" model="ir.model.access">
index da80266..7ac787d 100644 (file)
                </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="&quot;&quot;&quot;MRP - Procurement&quot;&quot;&quot;" name="name"/>
                        <field eval="0" name="perm_unlink"/>
                        <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="&quot;&quot;&quot;mrp.procurement&quot;&quot;&quot;" />
+            <field name="name" eval="&quot;&quot;&quot;procurement.order&quot;&quot;&quot;" />
                        <field name="group_id" ref="res_groups_posuser0"/>
         </record>
         <record id="ir_model_access_tax0" model="ir.model.access">
index b537eee..e5b94bb 100644 (file)
@@ -8,7 +8,7 @@
 
         <record id="process_process_procurementprocess0" model="process.process">
             <field eval="&quot;&quot;&quot;Procurement&quot;&quot;&quot;" 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>
 
index ceaefb4..e315670 100644 (file)
@@ -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:
index 256472b..9422e92 100644 (file)
@@ -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>
index 1defa21..b97caf6 100644 (file)
@@ -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&lt;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">
                 </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', '&lt;&gt;', '')]</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>
         <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>
index 599d11c..1797986 100644 (file)
@@ -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>
 
index 6ebc0f6..4251acf 100644 (file)
@@ -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:
index d95e824..648da5c 100644 (file)
@@ -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', {})
 
 
index ce022a7..f13decf 100644 (file)
@@ -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
index a0f2ef4..cf32286 100644 (file)
@@ -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>
index fa447e5..a7bea3b 100644 (file)
@@ -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',
index 1c3f3dd..466a462 100644 (file)
@@ -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()
index 817f701..c1cf71b 100644 (file)
@@ -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"    -->
index 5630266..ee32078 100644 (file)
@@ -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)
         
index c17beda..a56c46b 100644 (file)
@@ -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"    
index 80694d1..6a02048 100644 (file)
@@ -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)
index 3386128..4af54b7 100644 (file)
@@ -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"    
index 350d6b0..1930788 100644 (file)
@@ -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:
 
index 8029327..b606bbf 100644 (file)
@@ -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()
index 407ab37..7c6e2a7 100644 (file)
@@ -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
index dda382a..50bc74f 100644 (file)
@@ -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.
index 849e586..3fa1d3e 100644 (file)
@@ -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:
 
index 8495ef4..7d7ae53 100644 (file)
         -->
 
         <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">
index 85c35b2..5aaf3a9 100644 (file)
@@ -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()
index 8983d23..0ace231 100644 (file)
@@ -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
index e2cba67..641fd74 100644 (file)
@@ -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
index 5b71c05..1ebbc26 100644 (file)
 
         <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="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
             <field eval="&quot;&quot;&quot;Procurement Order&quot;&quot;&quot;" name="name"/>
             <field eval="&quot;&quot;&quot;One Procurement order for each sale order line and for each of the components.&quot;&quot;&quot;" 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="&quot;&quot;&quot;object.state=='confirmed'&quot;&quot;&quot;" name="model_states"/>
             <field eval="1" name="flow_start"/>
index 43d8d67..779e13c 100644 (file)
@@ -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 = []
index d6ab6a7..0920cde 100644 (file)
         <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.. -->
index dc507ed..95a2302 100644 (file)
         </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>
index 2136059..effe7cb 100644 (file)
         <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>
             <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>
index 726cd67..de0f55b 100644 (file)
@@ -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
index a5e7811..33ba226 100644 (file)
 -
   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!')
index 3bdc14b..d4d7337 100644 (file)
@@ -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, {