Skip to Content
Menú
This question has been flagged
1 Respondre
5796 Vistes

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)


Avatar
Descartar
Best Answer

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
Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de juny 24
2600
1
de nov. 22
3340
2
d’ag. 22
7681
1
de gen. 25
9373
1
de set. 21
6684