3

Here is the error message i am getting.

ValueError: Invalid field 'view_type' on model 'ir.actions.act_window'
odoo.tools.convert.ParseError: while parsing file:/c:/users/shaileshbhai/pycharmprojects/odoodev/extra_addons/demo_hospital/view/patient.xml:15, near
<record id="patient_action_new" model="ir.actions.act_window">
            <field name="name">patient name</field>
            <field name="res_model">hospital.patient</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
        </record> 
CZoellner
  • 13,553
  • 3
  • 25
  • 38
  • That should be more in the error message. And please tell us the Odoo version. I can add the tag, if needed. – CZoellner Feb 01 '21 at 13:17
  • My Odoo version is 14 and it's showing one more message "ValueError: Invalid field 'view_type' on model 'ir.actions.act_window'" – Yatrik Amrutiya Feb 01 '21 at 13:23
  • that's what i was suspecting :D the field isn't there anymore so just remove the line with that field. – CZoellner Feb 01 '21 at 13:45

1 Answers1

5

The field view_type was removed in one of the latest Odoo versions. Just remove it from your action definitions and you're fine.

CZoellner
  • 13,553
  • 3
  • 25
  • 38
  • Now all view types are `form` by default. But, what about the views called *list views*, which used `tree`? They allowed users to deploy child records from parents. How can we make a view like that now? – forvas Sep 21 '21 at 17:16
  • I think Odoo removed that in newer versions. I didn't find modules adding it again :-( – CZoellner Sep 27 '21 at 07:19