Search code examples
python-2.7odooodoo-10

journal_id field in account.payment is not getting override in odoo 10


I want to change the domain filter of journal_id field which is currently [('type', 'in', ('bank', 'cash'))] this. I wanna apply only [('type', '=', 'cash')]. But its not changing while I am trying to override it.

  1. I applied xpath and replace it with my custom domain
  2. I created the field again and applied the domain but thats too not giving me the proper result

    <xpath expr="//field[@name='journal_id']" position="after"> <field name="journal_id" widget="selection" domain=" [('employee_id.user_id','=',uid)]"/> <xpath/>

or

`<field name="journal_id" position="attributes">
       <attribute name="domain">[('type','=',cash)]</attribute>
   </field>

I want to show only those journal in drop down whose type is 'cash'

Please help out in this.


Solution

  • There is function which is setting domain in payment and you have to find that function and override it according to your requirement.