Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

error while parsing inherit view

Subscribe

Get notified when there's activity on this post

This question has been flagged
modulexmlcustom
1 Reply
4881 Views
Avatar
BCB Dev, Bruno Corredato Botti

xml version="1.0" encoding="utf-8" ?>




id="view_sale_order_inherit_two" model="ir.ui.view">
name="name">sale.order.inherit.two
name="model">sale.order
name="inherit_id" ref="sale.view_order_form"/>
name="arch" type="xml">
name="partner_id" position="after">
name="oc_number"/>






log error:


Erro:
Odoo Server Error

Traceback (most recent call last):
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/tools/convert.py", line 677, in _tag_root
f(rec)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/tools/convert.py", line 580, in _tag_record
record = model._load_records([data], self.mode == 'update')
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/models.py", line 4230, in _load_records
data['record']._load_records_write(data['values'])
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 1858, in _load_records_write
super(View, self)._load_records_write(values)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/models.py", line 4154, in _load_records_write
self.write(values)
File "/home/corredato/PycharmProjects/rowena14/odoo/addons/website/models/theme_models.py", line 295, in write
res = super(IrUiView, other_views).write(vals)
File "/home/corredato/PycharmProjects/rowena14/odoo/addons/website/models/ir_ui_view.py", line 68, in write
return super(View, self).write(vals)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 507, in write
res = super(View, self).write(self._compute_defaults(vals))
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/models.py", line 3713, in write
fields[0].determine_inverse(real_recs)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/fields.py", line 1207, in determine_inverse
determine(self.inverse, records)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/fields.py", line 82, in determine
return needle(*args)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 307, in _inverse_arch
view.write(data)
File "/home/corredato/PycharmProjects/rowena14/odoo/addons/website/models/theme_models.py", line 295, in write
res = super(IrUiView, other_views).write(vals)
File "/home/corredato/PycharmProjects/rowena14/odoo/addons/website/models/ir_ui_view.py", line 68, in write
return super(View, self).write(vals)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 507, in write
res = super(View, self).write(self._compute_defaults(vals))
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/models.py", line 3703, in write
real_recs._validate_fields(vals, inverse_fields)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/models.py", line 1266, in _validate_fields
check(self)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 415, in _check_xml
raise ValidationError(_(
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 398, in _check_xml
view.postprocess_and_fields(view_doc, validate=True)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 857, in postprocess_and_fields
arch, name_manager = self._postprocess_view(node, model, validate=validate)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 869, in _postprocess_view
self.postprocess(node, [], editable, name_manager)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 969, in postprocess
self.postprocess(child, current_node_path, node_info['editable'], name_manager)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 969, in postprocess
self.postprocess(child, current_node_path, node_info['editable'], name_manager)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 969, in postprocess
self.postprocess(child, current_node_path, node_info['editable'], name_manager)
[Previous line repeated 1 more time]
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 948, in postprocess
postprocessor(node, name_manager, node_info)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 1005, in _postprocess_tag_field
xarch, sub_name_manager = self.with_context(
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 869, in _postprocess_view
self.postprocess(node, [], editable, name_manager)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 969, in postprocess
self.postprocess(child, current_node_path, node_info['editable'], name_manager)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 960, in postprocess
validator(node, name_manager, node_info)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 1096, in _validate_tag_field
self.handle_view_error(msg)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_ui_view.py", line 680, in handle_view_error
raise ValueError(formatted_message).with_traceback(from_traceback) from from_exception
odoo.exceptions.ValidationError: Erro ao validar a visualização:

O campo "sequencia" não existe no modelo "sale.order.line"

View name: sale.order.inherit.two
Error context:
view: ir.ui.view(2681,)
xmlid: view_sale_order_inherit_two
view.model: sale.order
view.parent: ir.ui.view(1469,)
file: /home/corredato/PycharmProjects/rowena14/odoo/trustcode-rowena/res_partner_purchase_order/views/sale_po.xml


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

Traceback (most recent call last):
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 696, in dispatch
result = self._call_function(**self.params)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 370, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 358, in checked_call
result = self.endpoint(*a, **kw)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 919, in __call__
return self.method(*args, **kw)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 544, in response_wrap
response = f(*args, **kw)
File "/home/corredato/PycharmProjects/rowena14/odoo/addons/web/controllers/main.py", line 1374, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/home/corredato/PycharmProjects/rowena14/odoo/addons/web/controllers/main.py", line 1362, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/api.py", line 399, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/api.py", line 386, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "", line 2, in button_immediate_upgrade
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_module.py", line 658, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/addons/base/models/ir_module.py", line 596, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/modules/loading.py", line 455, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/modules/loading.py", line 347, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/modules/loading.py", line 222, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/tools/convert.py", line 733, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/tools/convert.py", line 799, in convert_xml_import
obj.parse(doc.getroot())
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/tools/convert.py", line 719, in parse
self._tag_root(de)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/tools/convert.py", line 677, in _tag_root
f(rec)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/tools/convert.py", line 681, in _tag_root
raise ParseError('while parsing %s:%s, near\n%s' % (
Exception

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

Traceback (most recent call last):
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 652, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 317, in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /home/corredato/PycharmProjects/rowena14/odoo/trustcode-rowena/res_partner_purchase_order/views/sale_po.xml:6, near

sale.order.inherit.two
sale.order


Traceback (most recent call last):
  File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 652, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 317, in _handle_exception
    raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /home/corredato/PycharmProjects/rowena14/odoo/trustcode-rowena/res_partner_purchase_order/views/sale_po.xml:6, near

            sale.order.inherit.two
            sale.order
            
            
                
                    
                
            
        









0
Avatar
Discard
BCB Dev, Bruno Corredato Botti
Author

Hi Cybrosys, thanks for your answer, but still does'nt work, can you see the final of the log?


Traceback (most recent call last):
  File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 652, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/corredato/PycharmProjects/rowena14/odoo/odoo/http.py", line 317, in _handle_exception
    raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /home/corredato/PycharmProjects/rowena14/odoo/trustcode-rowena/res_partner_purchase_order/views/sale_po.xml:6, near

            sale.order.inherit.two
            sale.order
            
            
                
                    
                
            
        


Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi, 

Try this code.

<record id="view_sale_order_inherit_two" model="ir.ui.view">


    <field name="name">sale.order.inherit.two</field>


    <field name="model">sale.order</field>


    <field name="inherit_id" ref="sale.view_order_form"/>


    <field name="arch" type="xml">


        <xpath expr="//field[@name='partner_id']" position="after">


            <field name="oc_number"/>


        </xpath>


    </field>


</record>


The code introduces changes to the initial code block by adding an `<xpath>` tag within the `<field name="arch" type="xml">` block. This allows for more precise targeting of elements in the XML structure. The XPath expression `//field[@name='partner_id']` is used to locate the "partner_id" field, and the `position="after"` attribute ensures that the new "oc_number" field is inserted after it. This modification enhances the code's flexibility, enabling the addition of the "oc_number" field in the desired position relative to the "partner_id" field within the inherited view.


Regards

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Can't get report to appear on print menu after moving from <report> to <record>
module xml custom report
Avatar
Avatar
1
May 23
3838
Custom Module Not Populating in Apps List Solved
module custom
Avatar
Avatar
4
Oct 20
10627
how to manage this 2 modules
module xml
Avatar
0
Mar 15
4673
For Odoo hosted version, how would I upload a custom module? Solved
module upload custom
Avatar
Avatar
Avatar
Avatar
3
Feb 24
12239
importing custom module
module custom importing
Avatar
Avatar
1
Nov 23
4479
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now