Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5556 Vizualizări

i create a model for product  and create a button (which change the quantity of product) on header for open wizard.

i can't set product name on wizard default but i get all product name.

@api.multi
    def _default_product_name(self):
        context = dict(self._context) or {}
        product_id = self.env['create.product.ept'].browse(context.get('active_id', False))
        context.update({'product_ept_id':product_id.name})

    product_ept_id = fields.Many2one('create.product.ept', string="Name", default=_default_product_name)


Imagine profil
Abandonează
Cel mai bun răspuns

Hello

make below change into your method.

def _default_product_name(self):
        context = dict(self._context) or {}
        product_id = self.env['create.product.ept'].browse(context.get('active_id', False))
return product_id and product_id.id or False
Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
iun. 24
2303
1
nov. 22
2998
2
aug. 22
7305
1
ian. 25
8969
1
sept. 21
6317