[FIX]push/pull rules, picking type should be required except for pull rule with type manufacture

bzr revid: csn@openerp.com-20130827152528-wm5m8zynlzjjfor9
This commit is contained in:
Cedric Snauwaert 2013-08-27 17:25:28 +02:00
parent 7882c8384e
commit d1febb7b8e
4 changed files with 54 additions and 3 deletions

View File

@ -40,7 +40,7 @@ class procurement_rule(osv.osv):
'location_id': fields.many2one('stock.location', 'Destination Location'),
'location_src_id': fields.many2one('stock.location', 'Source Location',
help="Source location is action=move"),
'picking_type_id': fields.many2one('stock.picking.type', 'Picking Type', required=True,
'picking_type_id': fields.many2one('stock.picking.type', 'Picking Type',
help="Picking Type determines the way the picking should be shown in the view, reports, ...")
}

View File

@ -1451,10 +1451,41 @@
<field name="location_src_id"/>
<field name="location_id"/>
<field name="action"/>
<field name="picking_type_id"/>
<field name="picking_type_id" attrs="{'required': [('action', '!=', 'manufacture')]}"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_procurement_rule_form">
<field name="name">stock.procurement.form</field>
<field name="model">procurement.rule</field>
<field eval="10" name="priority"/>
<field name="arch" type="xml">
<form string="Procurement Rules" version="7.0">
<sheet>
<div class="oe_title">
<h1>
<label string="Name"/>
<field name="name" class="oe_inline"/>
</h1>
</div>
<group>
<group>
<field name="location_src_id"/>
<field name="location_id"/>
</group>
<group>
<field name="action"/>
<field name="picking_type_id" attrs="{'required': [('action', '!=', 'manufacture')]}"/>
<field name="group_id"/>
</group>
</group>
</sheet>
</form>
</field>
</record>

View File

@ -60,7 +60,7 @@ class stock_location_path(osv.osv):
("2binvoiced", "To Be Invoiced"),
("none", "Not Applicable")], "Invoice Status",
required=True,),
'picking_type_id': fields.many2one('stock.picking.type', 'Picking Type', help="This is the picking type associated with the different pickings"),
'picking_type_id': fields.many2one('stock.picking.type', 'Picking Type', required=True, help="This is the picking type associated with the different pickings"),
'auto': fields.selection(
[('auto','Automatic Move'), ('manual','Manual Operation'),('transparent','Automatic No Step Added')],
'Automatic Move',

View File

@ -2,6 +2,26 @@
<openerp>
<data>
<record model="ir.ui.view" id="view_procurement_rule_form_inherit">
<field name="name">stock.procurement.rule.inherit.form</field>
<field name="model">procurement.rule</field>
<field name="inherit_id" ref="stock.view_procurement_rule_form"/>
<field name="arch" type="xml">
<field name="location_id" position="after">
<field name="route_id"/>
<field name="route_sequence"/>
<field name="sequence"/>
<field name="delay"/>
<field name="propagate"/>
</field>
<field name="group_id" position="before">
<field name="procure_method"/>
<field name="invoice_state"/>
<field name="partner_address_id"/>
</field>
</field>
</record>
<record id="view_location_form_inherit" model="ir.ui.view">
<field name="name">stock.location.form</field>