Community mailing list archives

community@mail.odoo.com

how i get a customer extracted detail??

by
omar
- 05/17/2016 04:28:47
hi community,

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:

client_id=fields.Many2one("res.partner",string='partner')
def get_val (self):
        return (self.env.context.get ( 'active_id', False))


in the form of res.partner I added a bouttons

<Nom du bouton = type = "objet" string = class "Gen_detail" "RETAIL" = "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 = ()
        self.extrait.
get_facture_payment ()

        retour
{              
                '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/fields.py", ligne 820, en __set__
    record.ensure_one ()
  Fichier "/home/odoo/odoo-dev/odoo/openerp/models.py", ligne 5378, en ensure_one
    générer ValueError ( «Expected singleton:% s"% soi-même)
singleton prévue: ValueError extrait.livre ()

comment je fais pour résoudre ce problème?

how I do to solve this problem?