Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3835 Widoki

I have this situation in Odoo 8:

Model x:

customer_name: fields.char(),

customer_email: fields.char(),

odoo_partner_id: fields.many2one('res.partner', 'Contact from outside')


I need put  a button on my "x.form.view" to call a res.partners list on wizard.

That wizard must be filtered by possible options  of my res.partners with

['name, 'like', same customer_name] or ['email' , 'like', 'customer_email' ],

and give me the option so select what i want and complete  x.odoo_partner_id field,

If don't exist any partners with that condition create a new one.




Awatar
Odrzuć
Autor Najlepsza odpowiedź

I really don't know odoo enough. Was really simple, I just have to return an 'ir.actions.act_window' with a domain: 

  return {

            'type': 'ir.actions.act_window',

            'res_model': 'res.partner',

            'view_mode': 'tree',

            'view_type': 'form',

            'domain': "[('phone','=', '"+self.browse(cr, uid, ids).telephone +"'),('is_company','=', False)]",

            'view_id': some_view_id,

            'target': 'new',

             }

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
cze 15
4254
3
cze 19
5369
0
sie 17
3398
6
sie 15
8678
0
mar 15
4441