HI guys I Have a problem.
How can I do this:
add check box and when I tick in on of them shows the button "more" which allow to delete the selected rows
class wizard_pets(osv.osv):
_name="wizard.pets"
_columns={
'owner_id':fields.many2one('gs.owner','ID Owner'),
'pets':fields.one2many('gs.pet','owner_id','teste'),
'epf_eligible': fields.boolean("eligible for EPF"),
}
#preenche o campo many2many usa default para preencher logo no inicio
def _get_default_pet_ids(self, cr, uid, context=None):
return self.pool.get('gs.pet').search(cr, uid, [])
#Filtra campo many2many com a opção que se escolha neste caso o owner
def onchange_owner_id(self, cr, uid, ids, val):
ids = self.pool.get('gs.pet').search(cr, uid, [('owner_id','=',val)])
return {'value' : {'pets' : ids}}
_defaults = {
'pets' : _get_default_pet_ids,
'epf_eligible':False
}
wizard_pets()
<record id="lista_pets_form" model="ir.ui.view">
<field name="name">lista.pets.form</field>
<field name="model">wizard.pets</field>
<field name="arch" type="xml">
<form string="Lista de Pets" version="7.0">
<group string="Lista de Pet" col="1">
<field name="owner_id" on_change="onchange_owner_id(owner_id)" widget="selection"/>
<field name="pets"/>
<field name="epf_eligible"/>
<button name="Apagar" string="Apagar" type="object" class="oe_highlight"/>
</group>
</form>
</field>
</record>
any advice?