我想准确地修改上下文帐户发票,我不希望图片中的字段被填充,我想删除上下文分析帐户和分析标签

谢谢
发布于 2017-10-25 16:50:34
您可以将此表继承到xml中的模块中
<record id="accountinginvisible name " model="ir.ui.view">
<field name="name">account.inginvisible</field>
<field name="model">account.invoice.line</field>
<field name="inherit_id" ref="accounting(module name).reference from tree or form view id"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='field name']" position="replace" invisible="1"> </xpath>
</field>
</record> 在你的.py中
classname(models.Model):
_inherit = 'account.invoice.line'你可以试试这个,我希望它对你有帮助。
发布于 2017-10-25 14:33:19
我认为你需要避免自动填充Account字段。它是通过在字段定义中调用像_default_account这样的default函数来实现的。
原码:
account_id = fields.Many2one('account.account', string='Account',
required=True, domain=[('deprecated', '=', False)],
default=_default_account,
help="The income or expense account related to the selected product.")要避免这种情况,请继承account.invoice.line模型,并在不使用默认函数的情况下重新定义该字段。
试试这个:
_inherit = 'account.invoice.line'
account_id = fields.Many2one('account.account', string='Account',
required=True, domain=[('deprecated', '=', False)],
help="The income or expense account related to the selected product.")希望能对你有所帮助。
https://stackoverflow.com/questions/46920914
复制相似问题