How to remove the domain in existing model. Odoo 14

Viewed 560

I want to remove domain="[('id', 'in', suitable_journal_ids)]" of journal_id in account.move model , I try with this code , but I got error . Any help please? Thanks.

class AccountInvoice(models.Model):
    _inherit = 'account.move'


journal_id = fields.Many2one('account.journal', string='Journal Test', required=True, readonly=True,
                             states={'draft': [('readonly', False)]},
                             check_company=True,
                             default=_get_default_journal)



 <record id="view_extend" model="ir.ui.view">
            <field name="name">account.form.extend</field>
            <field name="model">account.move</field>
            <field name="inherit_id" ref="account.view_move_form" />
            <field name="arch" type="xml">
                <xpath expr="//group/group[2]/field[@name='journal_id']" position="attributes">
                     <attribute name="journal_id">journal_id</attribute>
                </xpath>
            </field>
        </record>
0 Answers
Related