[IMP]: Improvements in views, access rules in mrp, product and stock modules.

bzr revid: uco@tinyerp.co.in-20100310132040-3suqwihxmfdmu5sz
This commit is contained in:
uco (OpenERP)
2010-03-10 18:50:40 +05:30
parent 25332c9287
commit bc22b5f593
6 changed files with 32 additions and 11 deletions
+3 -1
View File
@@ -189,6 +189,7 @@ class mrp_bom(osv.osv):
'child_ids': fields.function(_child_compute,relation='mrp.bom', method=True, string="BoM Hierarchy", type='many2many'),
'child_complete_ids': fields.function(_child_compute,relation='mrp.bom', method=True, string="BoM Hierarchy", type='many2many'),
'company_id': fields.many2one('res.company','Company',required=True),
'multi_level_bom': fields.boolean('Multi-level BoM'),
}
_defaults = {
'active': lambda *a: 1,
@@ -196,7 +197,8 @@ class mrp_bom(osv.osv):
'product_qty': lambda *a: 1.0,
'product_rounding': lambda *a: 1.0,
'type': lambda *a: 'normal',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.bom', context=c)
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.bom', context=c),
'multi_level_bom': lambda *a: 0,
}
_order = "sequence"
_sql_constraints = [
+13 -7
View File
@@ -242,19 +242,21 @@
<field name="arch" type="xml">
<form string="Bill of Material">
<group colspan="4" col="6">
<field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
<field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
</group>
<newline/>
<field name="product_uom"/>
<field name="product_qty"/>
<newline/>
<field name="product_uos" groups="product.group_uos"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<field name="routing_id" select="2" groups="base.group_extended"/>
<field name="type" groups="base.group_extended"/>
<group colspan="4" col="6">
<field name="product_uom"/>
<field name="product_qty"/>
<field name="multi_level_bom"/>
</group>
<notebook colspan="4">
<page string="General Information">
<field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list"/>
@@ -274,6 +276,9 @@
<field name="product_efficiency"/>
<field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
</page>
<page string="Multi-Level BoM" attrs="{'invisible':[('multi_level_bom','=',False)]}">
<field colspan="4" name="child_ids" nolabel="1" string="BoM Hierarchy"/>
</page>
</notebook>
</form>
</field>
@@ -287,6 +292,7 @@
<field name="arch" type="xml">
<tree string="BoM Structure" colors="blue:method">
<field name="name"/>
<field name="sequence" invisible="1"/>
<field name="code"/>
<field name="product_id"/>
<field name="product_qty"/>
+4
View File
@@ -32,3 +32,7 @@
"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
"access_mrp_make_procurement","make.procurement","model_make_procurement","mrp.group_mrp_user",1,0,0,0
"access_mrp_change_production_qty","change.production.qty","model_change_production_qty","mrp.group_mrp_user",1,0,0,0
"access_mrp_procurement_compute_all","mrp.procurement.compute.all","model_mrp_procurement_compute_all","mrp.group_mrp_user",1,0,0,0
"access_mrp_procurement_orderpoint_compute","mrp.procurement.orderpoint.compute","model_mrp_procurement_orderpoint_compute","mrp.group_mrp_user",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
32 access_mrp_production_stock_worker mrp.production stock_worker model_mrp_production stock.group_stock_user 1 0 0 0
33 access_mrp_installer mrp.installer model_mrp_installer mrp.group_mrp_user 1 0 0 0
34 access_mrp_product_produce mrp.product.produce model_mrp_product_produce mrp.group_mrp_user 1 0 0 0
35 access_mrp_make_procurement make.procurement model_make_procurement mrp.group_mrp_user 1 0 0 0
36 access_mrp_change_production_qty change.production.qty model_change_production_qty mrp.group_mrp_user 1 0 0 0
37 access_mrp_procurement_compute_all mrp.procurement.compute.all model_mrp_procurement_compute_all mrp.group_mrp_user 1 0 0 0
38 access_mrp_procurement_orderpoint_compute mrp.procurement.orderpoint.compute model_mrp_procurement_orderpoint_compute mrp.group_mrp_user 1 0 0 0
+1 -1
View File
@@ -82,7 +82,7 @@ class product_uom(osv.osv):
'name': fields.char('Name', size=64, required=True, translate=True),
'category_id': fields.many2one('product.uom.categ', 'UoM Category', required=True, ondelete='cascade',
help="Unit of Measure of a category can be converted between each others in the same category."),
'factor': fields.float('Rate', digits=(12, 6), required=True,
'factor': fields.float('Ratio', digits=(12, 6), required=True,
help='The coefficient for the formula:\n' \
'1 (base unit) = coeff (this unit). Rate = 1 / Factor.'),
'factor_inv': fields.function(_factor, digits=(12, 6),
+1
View File
@@ -16,6 +16,7 @@
<field name="location_id" select="1" />
<field name="product_id" select="1" />
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="10">
<filter string="Location" icon="terp-stock" domain="[]" context="{'group_by':'location_id'}"/>
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
+10 -2
View File
@@ -271,6 +271,7 @@
<field name="product_id" select="1"/>
<field name="date" select="1"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
</group>
@@ -699,6 +700,7 @@
<field name="name" select="1"/>
<field name="address_id" select="1"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
@@ -851,6 +853,7 @@
<field name="address_id" select="1"/>
<field name="origin" select="1"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="10">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
@@ -1033,6 +1036,7 @@
<field name="address_id" select="1"/>
<field name="company_id" select="1" widget="selection"/>
</group>
<newline/>
<group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
@@ -1204,6 +1208,7 @@
<field name="address_id" select="1"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company" />
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
@@ -1257,6 +1262,7 @@
<field name="origin" select="1"/>
<field name="company_id" select="1" widget="selection"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
@@ -1376,6 +1382,7 @@
<field name="location_dest_id" select="1"/>
<field name="product_id" select="1"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
@@ -1426,7 +1433,7 @@
<field name="arch" type="xml">
<tree colors="grey:state in ('cancel','done');black:state not in ('cancel','done')" string="Moves">
<field name="picking_id" string="Reference"/>
<field name="origin" string="Purchase Order"/>
<field name="origin" string="Latest Requisition"/>
<field name="partner_id" string="Supplier"/>
<field name="product_id"/>
<field name="product_qty" />
@@ -1504,10 +1511,11 @@
<filter icon="terp-stock" string="Back Orders" domain="[('backorder_id','!=',False)]" help="Back Orders"/>
<filter icon="terp-stock" string="Planned Today" domain="[('date_planned::date','=',time.strftime('%%Y-%%m-%%d'))]" help="Orders planned for today"/>
<separator orientation="vertical"/>
<field name="origin" string="Purchase Order" select="1"/>
<field name="origin" string="Latest Requisition" select="1"/>
<field name="partner_id" string="Supplier" select="1"/>
<field name="product_id"/>
</group>
<newline/>
<group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>