[IMP] set attr for Receive and Control Invoice button.
bzr revid: nco@tinyerp.com-20121030122654-3gyk4o6wqhvznl7l
This commit is contained in:
@@ -135,6 +135,7 @@ class stock_picking_in(osv.osv):
|
||||
_columns = {
|
||||
'purchase_id': fields.many2one('purchase.order', 'Purchase Order',
|
||||
ondelete='set null', select=True),
|
||||
'purchase_invoice_method': fields.related('purchase_id', 'invoice_method', type='selection', selection=[('manual','Based on Purchase Order lines'),('order','Based on generated draft invoice'),('picking','Based on incoming shipments')], string='Purchase Invoice Method'),
|
||||
'warehouse_id': fields.related('purchase_id', 'warehouse_id', type='many2one', relation='stock.warehouse', string='Destination Warehouse'),
|
||||
}
|
||||
def create_draft_invoice(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -42,8 +42,11 @@
|
||||
<field name="model">stock.picking.in</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_in_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='move_lines']" position="after">
|
||||
<field name="purchase_invoice_method" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_process']" position="after">
|
||||
<button name="create_draft_invoice" attrs="{'invisible':[('invoice_state', '=', 'none')]}" string="Receive & Control Invoice" type="object" class="oe_highlight"/>
|
||||
<button name="create_draft_invoice" string="Receive & Control Invoice" attrs="{'invisible':[('purchase_invoice_method', '!=', 'picking')]}" type="object" class="oe_highlight"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user