تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
7099 أدوات العرض

Hello, 

I'm trying to migrate a module from V13 to V15 and I keep getting the error from the title


I get it from the default_get from a wizard:


@api.model
def default_get
(self, fields):
res = super(ProductCategoryAssign, self).default_get(fields)
if self.env.context.get('active_model') == 'product.template' and self.env.context.get('active_ids'):
product_ids = [int(id) for id in self.env.context['active_ids']]
res['product_ids'] = [(6, 0, [product_ids])]
return res


I have even tired passing an hardcoded appropriate id and I still get the same error

        res['product_ids'] = [(6, 0, [1])]
I've looked it up online and usually the solution is to convert the ids to int but that's not the case here


Any suggestion would be greatly appreciated

الصورة الرمزية
إهمال
أفضل إجابة

I have the exact same problem on my odoo 15 instance,final found solution is that use update instead of write within “@onchange” methods to avoid this error.

الصورة الرمزية
إهمال
أفضل إجابة

Hey ! Sorry but did you find anything regarding this issue ? I have the exact same problem but Google won't help... Thanks

الصورة الرمزية
إهمال
الكاتب

Hi, I didn't find a solution, but a workaround. I created a server action to open the wizard