summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsbh (Open ERP) <sbh@tinyerp.com>2010-07-07 14:48:51 +0530
committersbh (Open ERP) <sbh@tinyerp.com>2010-07-07 14:48:51 +0530
commit88f8ef366adc090c2d03d2ab073735dadcc18fd1 (patch)
tree18440122df0e147d464868870a75723619fabe85
parentbfc4a3a02145b3c07ce56be448f64d8ad04b1e83 (diff)
[IMP] procurement: Move the mrp.property into mrp
bzr revid: sbh@tinyerp.com-20100707091851-cf0zbq0rr8ce4qgu
-rw-r--r--addons/mrp/mrp.py29
-rw-r--r--addons/mrp/mrp_view.xml32
-rw-r--r--addons/mrp/procurement.py1
-rw-r--r--addons/mrp/security/ir.model.access.csv4
-rw-r--r--addons/procurement/procurement.py36
-rw-r--r--addons/procurement/procurement_view.xml4
-rw-r--r--addons/procurement/security/ir.model.access.csv8
7 files changed, 68 insertions, 46 deletions
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 0cc564c7091..dfc1dc1ebd7 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -27,6 +27,35 @@ import ir
import netsvc
import time
+class mrp_property_group(osv.osv):
+ """
+ Group of mrp properties.
+ """
+ _name = 'mrp.property.group'
+ _description = 'Property Group'
+ _columns = {
+ 'name': fields.char('Property Group', size=64, required=True),
+ 'description': fields.text('Description'),
+ }
+mrp_property_group()
+
+class mrp_property(osv.osv):
+ """
+ Properties of mrp.
+ """
+ _name = 'mrp.property'
+ _description = 'Property'
+ _columns = {
+ 'name': fields.char('Name', size=64, required=True),
+ 'composition': fields.selection([('min','min'),('max','max'),('plus','plus')], 'Properties composition', required=True, help="Not used in computations, for information purpose only."),
+ 'group_id': fields.many2one('mrp.property.group', 'Property Group', required=True),
+ 'description': fields.text('Description'),
+ }
+ _defaults = {
+ 'composition': lambda *a: 'min',
+ }
+mrp_property()
+
#----------------------------------------------------------
# Work Centers
#----------------------------------------------------------
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index ae5572b1d76..f326f3c721f 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -882,10 +882,40 @@
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='move_id']" position="before">
<field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
+ <group colspan="4" groups="base.group_extended">
+ <separator colspan="4" string="Properties" />
+ <field colspan="4" name="property_ids" nolabel="1"/>
+ </group>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_procurement_form_inherit" model="ir.ui.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">
+ <field name="bom_id" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_procurement_form_inherit_property" model="ir.ui.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="after">
+ <group colspan="4" groups="base.group_extended">
+ <separator colspan="4" string="Properties" />
+ <field colspan="4" name="property_ids" nolabel="1"/>
+ </group>
</xpath>
</field>
</record>
-
<act_window
id="action_product_bom_structure"
name="Product BoM Structure"
diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py
index d704afa46d6..8bfefc9ceef 100644
--- a/addons/mrp/procurement.py
+++ b/addons/mrp/procurement.py
@@ -31,6 +31,7 @@ class procurement_order(osv.osv):
_inherit = 'procurement.order'
_columns = {
'bom_id': fields.many2one('mrp.bom', 'BoM', ondelete='cascade', select=True),
+ 'property_ids': fields.many2many('mrp.property', 'procurement_property_rel', 'procurement_id','property_id', 'Properties'),
}
def check_produce_product(self, cr, uid, procurement, context=[]):
diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv
index e823bd036d8..b618f930abb 100644
--- a/addons/mrp/security/ir.model.access.csv
+++ b/addons/mrp/security/ir.model.access.csv
@@ -28,3 +28,7 @@
"access_report_workcenter_load","report.workcenter.load","model_report_workcenter_load","mrp.group_mrp_manager",1,0,0,0
"access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,0,0,0
"access_product_product_manager","product.product manager","model_product_product","mrp.group_mrp_manager",1,1,1,1
+"access_mrp_property_group","mrp.property.group","model_mrp_property_group","stock.group_stock_manager",1,1,1,1
+"access_mrp_property","mrp.property","model_mrp_property","stock.group_stock_manager",1,1,1,1
+"access_mrp_property_group","mrp.property.group","model_mrp_property_group","base.group_user",1,0,0,0
+"access_mrp_property","mrp.property","model_mrp_property","base.group_user",1,0,0,0
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index d10cc89234c..e88fab424bb 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -25,37 +25,6 @@ from tools.translate import _
import netsvc
import time
-
-class mrp_property_group(osv.osv):
- """
- Group of mrp properties.
- """
- _name = 'mrp.property.group'
- _description = 'Property Group'
- _columns = {
- 'name': fields.char('Property Group', size=64, required=True),
- 'description': fields.text('Description'),
- }
-mrp_property_group()
-
-class mrp_property(osv.osv):
- """
- Properties of mrp.
- """
- _name = 'mrp.property'
- _description = 'Property'
- _columns = {
- 'name': fields.char('Name', size=64, required=True),
- 'composition': fields.selection([('min','min'),('max','max'),('plus','plus')], 'Properties composition', required=True, help="Not used in computations, for information purpose only."),
- 'group_id': fields.many2one('mrp.property.group', 'Property Group', required=True),
- 'description': fields.text('Description'),
- }
- _defaults = {
- 'composition': lambda *a: 'min',
- }
-mrp_property()
-
-# ------------------------------------------------------------------
# Procurement
# ------------------------------------------------------------------
#
@@ -91,9 +60,6 @@ class procurement_order(osv.osv):
" a make to order method."),
'note': fields.text('Note'),
-
- '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([
('draft','Draft'),
@@ -477,7 +443,7 @@ class stock_warehouse_orderpoint(osv.osv):
help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
"a procurement to bring the virtual stock to the Max Quantity."),
'product_max_qty': fields.float('Max Quantity', required=True,
- help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
+ help="When the virtual stock goes belong the Mix Quantity, Open ERP generates "\
"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."),
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index 1ca3a0bedc7..f250209cda9 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -67,10 +67,6 @@
<field name="move_id" groups="base.group_extended"/>
<field name="date_close"/>
<field name="close_move" groups="base.group_extended"/>
- <group colspan="4" groups="base.group_extended">
- <separator colspan="4" string="Properties" />
- <field colspan="4" name="property_ids" nolabel="1"/>
- </group>
</page>
<page string="Notes">
<separator colspan="4" string="Note" />
diff --git a/addons/procurement/security/ir.model.access.csv b/addons/procurement/security/ir.model.access.csv
index 8eeaefb3bd6..18991cf9c90 100644
--- a/addons/procurement/security/ir.model.access.csv
+++ b/addons/procurement/security/ir.model.access.csv
@@ -1,7 +1,3 @@
"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",stock.group_stock_manager,1,1,1,1
-"access_mrp_property","mrp.property","model_mrp_property",stock.group_stock_manager,1,1,1,1
-"access_mrp_property_group","mrp.property.group","model_mrp_property_group",,1,0,0,0
-"access_mrp_property","mrp.property","model_mrp_property",base.group_user,1,0,0,0
-"access_procurement","procurement.order","model_procurement_order",base.group_user,1,0,0,0
-"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint",stock.group_stock_manager,1,1,1,1
+"access_procurement","procurement.order","model_procurement_order","base.group_user",1,0,0,0
+"access_stock_warehouse_orderpoint","stock.warehouse.orderpoint","model_stock_warehouse_orderpoint","stock.group_stock_manager",1,1,1,1