Typeerror(repr(o) + " Is Not Json Serializable") - Odoo V8
I have this method, which calls for a document associated with an invoice on Odoo v8. @api.multi def button_generate_wh_doc(self): context = self._context partner = self.env['res.p
Solution 1:
The domain you passing in res
has to be list
of tuple
and not list
of tuple
of string
, check below code :
@api.multi
def button_generate_wh_doc(self):
context = self._context
partner = self.env['res.partner']
res = {}
for inv in self:
view_id = self.env['ir.ui.view'].search([
('name', '=', 'account.invoice.wh.iva.customer')])
context = self.env.context.copy()
context.update({
'domain':[
('invoice_id','=',inv.id),
('type','=',inv.type),
('default_partner_id','=', partner._find_accounting_partner(inv.partner_id).id),
('default_name' ,'=', inv.name or inv.number),
('view_id' ,'=', view_id[0].id)
]
})
return {
'name': _('Withholding vat customer'),
'type': 'ir.actions.act_window',
'res_model': 'account.wh.iva',
'view_type': 'form',
'view_id': False,
'view_mode': 'form',
'target': 'current',
'domain': [('type', '=', inv.type )],
'context': context,
}
Post a Comment for "Typeerror(repr(o) + " Is Not Json Serializable") - Odoo V8"