我尝试用many2many覆盖many2one字段
property_product_pricelist = fields.Many2many('product.pricelist',
string="Sale Pricelist",
help="This pricelist will be used, instead of the default one, for sales to the current partner")
当我尝试保存值时出现此错误
File "/home//workspace/odoo-9.0/openerp/models.py", line 5384, in _browse
env.prefetch[cls._name].update(ids)
TypeError: unhashable type: 'list'
我也是这样的Tryid
property_product_pricelist = fields.Many2many('product.pricelist', column1='partner_id', column2='pricelist_id')
但是得到
ProgrammingError: column product_pricelist_res_partner_rel.pricelist_id does not exist
第1行:选择product_pricelist_res_partner_rel.pricelist_id,产品...
答案 0 :(得分:0)
我想出的最佳解决方案。
multiply_pricelists_ids = fields.Many2many(
'product.pricelist', string='Multiply Pricelists')
@api.onchange('property_product_pricelist')
@api.multi
def pricelist_change(self):
self.multiply_pricelists_ids = self.property_product_pricelist