odoo 上下文

order = self.env[model].browse(id)
if order:
order.with_context(write_type='voucher_generation').write({
'state': state,
})

self._context.get('write_type') == 'voucher_generation'

转载于:https://www.cnblogs.com/yanhuaqiang/p/10971374.html

你可能感兴趣的:(odoo 上下文)