Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5654 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jun. 24
2461
1
nov. 22
3159
2
aug. 22
7507
1
jan. 25
9164
1
sep. 21
6516