【发布时间】:2017-01-23 13:50:28
【问题描述】:
我有这个代码:
在 .py 文件中:
class newsaleorderline(models.Model):
_inherit='sale.order.line'
supply_tax_id = fields.Many2many('account.tax',string='Supply Taxes',domain=['|', ('active', '=', False), ('active', '=', True)])
labour_tax_id = fields.Many2many('account.tax',string='Labour Taxes',domain=['|', ('active', '=', False), ('active', '=', True)])
在 .xml 文件中:
<field name="supply_tax_id" widget="many2many_tags" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]" attrs="{'readonly': [('qty_invoiced', '>', 0)]}"/>
<field name="labour_tax_id" widget="many2many_tags" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]" attrs="{'readonly': [('qty_invoiced', '>', 0)]}"/>
虽然我尝试更改 supply_tax_id 它会更改,但保存后 supply_tax_id,labour_tax_id 两者都是相同的。我不知道它是如何相互连接的。我希望supply_tax_id 和labour_tax_id 应该是不同的值,并且字段应该来自account.tax。
请帮助我找到解决问题的方法。谢谢大家的建议。
【问题讨论】:
标签: python postgresql openerp