Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4573 Lượt xem

Hello everyone. 

I have this app working in Odoo version 12, but when I'm trying to run it in version 14, it gives me the following error (only the last part of the error is posted):

 

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 639, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 315, in _handle_exception
    raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /odoo/odoo-server/custom_addons/EHR/views/vital.xml:43, near
<record id="action_vitals_weight" model="ir.actions.act_window">
        <field name="name">Weight</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">ehr.vitals.weight</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form,graph</field>
        <field name="context">{}</field>
        <field name="domain">[('resident_id', '=', active_id)]</field>
        <field name="target">current</field>
        <field name="help" type="html">
          <p class="o_view_nocontent_smiling_face">
            Record your First Weight Entry !
          </p>
        </field>
    </record>

 

Any idea why it gives me this error? (The line 43 is the line the record tag is open). 

Thanks. 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Mohammed

Attribute view_type is not supported in in V14 so remove <field name="view_type">form</field>  from your action and then try.

Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Yep, it did the trick! Thanks a bunch Husain :)

An informative link for the changes from odoo12 to odoo13:

"8. Remove the view_type from XML definition. Now by default, it’s form view.

Remove ‘multi’ from ‘ir.actions.act_window’ instead use ‘binding_view_types’ to indicate the view type(list,form).
    Example: <field name="binding_view_types">list</field>

    If using <act_window> tag use ‘binding_views’. Example binding_views="form"."

 https://www.cybrosys.com/blog/odoo-13-migration


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
4608
1
thg 10 24
2350
0
thg 12 23
1986
0
thg 4 21
2756
1
thg 6 20
4498