Community mailing list archives

Re: how i get a customer extracted detail??

Solanki Shamji
- 05/17/2016 05:30:48

Here if you are using @api.multi than self is not a single instance so I think you have to use for loop for access self or you can use as per requirement.


for data in self:
     data..extrait.get_facture_payment ()

On Tue, May 17, 2016 at 2:07 PM, omar frikha <> wrote:

I developed a new class in Odoo: 'extrait.livre' which contains a method 'get_facture_payment' create an extract detail  , and a method 'get_val'  for recovered active_id for a partner:

def get_val (self):
        return (self.env.context.get ( 'active_id', False))

in the form of res.partner I added a bouttons

               <button  name="Gen_detail"  type="object" string="DETAIL"  class="oe_button_box oe_stat_button" context="{'id' : active_id}"/>

and class res_partner I added this code:

extrait = fields.One2many ( 'extrait.livre', 'client_id')
    @ api.multi
    def Gen_detail (self):
        extrait_obj self.env = [ 'extrait.livre']
        extrait_obj.get_val self.extrait.client_id = ()
get_facture_payment ()

                'Nom': 'DETAIL'
                'View_mode': 'tree'
                'View_type': 'form',
                'Res_model' 'extrait'
                'Type': 'ir.actions.act_window'

but this code generate this errors:

 extrait_obj.get_val self.extrait.client_id = ()
  Fichier "/home/odoo/odoo-dev/odoo/openerp/", ligne 820, en __set__
    record.ensure_one ()
  Fichier "/home/odoo/odoo-dev/odoo/openerp/", ligne 5378, en ensure_one
    générer ValueError ( «Expected singleton:% s"% soi-même)
singleton prévue: ValueError extrait.livre ()

how I do to solve this problem?

Post to: