[IMP] mrp: Added company field on Routing and Workcenter. Improved search views.

bzr revid: uco@tinyerp.com-20101015122455-xaxwkf4f3d3al7tt
This commit is contained in:
uco (OpenERP)
2010-10-15 17:54:55 +05:30
parent e92e56634f
commit dd69d75e4b
3 changed files with 17 additions and 1 deletions
+4 -1
View File
@@ -81,9 +81,11 @@ class mrp_routing(osv.osv):
"Set a location if you produce at a fixed location. This can be a partner location " \
"if you subcontract the manufacturing operations."
),
'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
'active': lambda *a: 1,
'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.routing', context=context)
}
mrp_routing()
@@ -103,7 +105,8 @@ class mrp_routing_workcenter(osv.osv):
'routing_id': fields.many2one('mrp.routing', 'Parent Routing', select=True, ondelete='cascade',
help="Routing indicates all the workcenters used, for how long and/or cycles." \
"If Routing is indicated then,the third tab of a production order (workcenters) will be automatically pre-completed."),
'note': fields.text('Description')
'note': fields.text('Description'),
'company_id': fields.related('routing_id', 'company_id', type='many2one', relation='res.company', string='Company'),
}
_defaults = {
'cycle_nbr': lambda *a: 1.0,
+11
View File
@@ -224,6 +224,7 @@
<field name="workcenter_id"/>
<field name="cycle_nbr"/>
<field name="hour_nbr"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</tree>
</field>
</record>
@@ -240,6 +241,7 @@
<field name="workcenter_id" select="1" widget="selection"/>
<field name="cycle_nbr"/>
<field name="hour_nbr" widget="float_time"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<separator colspan="4" string="Description"/>
<field colspan="4" name="note" nolabel="1"/>
</form>
@@ -257,6 +259,7 @@
<field name="code"/>
<field name="active" groups="base.group_extended"/>
<field name="location_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<notebook colspan="4">
<page string="Work Center Operations">
@@ -278,6 +281,7 @@
<field name="code"/>
<field name="name"/>
<field name="location_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
@@ -287,9 +291,16 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Routing">
<filter string="Inactive" icon="terp-gdu-smart-failing" domain="[('active','=',False)]"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
<field name="location_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="8" groups="base.group_extended">
<filter string="Production Location" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'location_id'}"/>
</group>
</search>
</field>
</record>
+2
View File
@@ -11,6 +11,8 @@
<field name="arch" type="xml">
<search string="Search Resource">
<group col='15' colspan='4'>
<filter string="Inactive" icon="terp-gdu-smart-failing" domain="[('active','=',False)]"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="user_id" string="User"/>
<field name="resource_type"/>