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
    • Estate 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

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
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

I am creating a custom field, but whenever I try to add it to my form, I get an error.

Subscribe

Get notified when there's activity on this post

This question has been flagged
error
7290 Views
Avatar
Amer Homaissi

I created a custom field named "Test Field" and while creating it I gave it a model of purchase.order

I am trying to create a custom field next to Subtotal in the Quotations and Purchase Order forms.

However, after creating the custom field in: Settings - Database Structures - Fields, while setting its Model to purchase.order, whenever I try adding it next to the Subtotal field on the Quotations form, I get an error that says the following:

"Error occurred while validating the field(s) arch: Invalid XML for View Architecture!"

I don't understand what the problem is and how to fix it.

Thank you for your help, in advance.

OQO

0
Avatar
Discard
Eric

did you make sure the name of the field is spelled right? Custom fields require an "x_" before the name of the field. So the name should be x_test_field

Amer Homaissi
Author

Field name: x_testfield Field Label: Test Field Type: Float

Eric

Is that the way the name is spelled in the xml view? <field name="x_testField" />

Amer Homaissi
Author

I couldn't find it in the xml view (purchase_view.xml), and I think it's because I haven't been able to create it into the form yet. Or is it supposed to be there?

Eric

Yes, when you create a field in OpenERP, then you will need to add the field to the correct view. You can do that by adding the field tag like I have above, or you can also add it through the Developer Mode.

Eric

Here is a link that shows you how to add a field in Developer Mode http://openerpservice.in/how-to-add-new-field-in-open-erp-7-0/

Amer Homaissi
Author

Yes, my problem is occurring when I am in developer mode and I go into Manage Views and attempt to add the field.

Eric

Ok. Make sure you are on the right form. Each form will belong to a model which will have its own fields you can use for it. So if you are modifying the Leads form, then you will need to make sure that the field you added belongs to the crm.leads model

Amer Homaissi
Author

Thank you for your help. I followed your steps and tried again and it gave me the same error. However, when I tried to do this elsewhere, it did not give me an error. I suspect that the problem might be because I am trying to add it to a tree. How can I add a custom field to a tree?

Eric

If you are adding a field to a tree with the Developer Mode, it works the same as a form. When you click on Manage Views then see the list of forms to edit, select the one with the tree in it. Then you can add the field like you did in the form.

Eric

I would advise to create a custom module rather than adding fields through the Developer Mode though. If there ever is an upgrade, then all the fields that you added using the Developer Mode will get erased. When creating a new module that inherits an existing module, then the fields wont get erased if an upgrade is made. This is the preferred method

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
?"Your country might be blocked by our hosting provider" error when I create new website
error
Avatar
0
Nov 25
592
Payment Page Return Error with Razorpay on Mobile Devices
error
Avatar
0
Sep 25
1203
Error after installing "purchase" app in Odoo version 18
error
Avatar
Avatar
1
Dec 24
6764
error schema for TourStep Error
error
Avatar
0
Nov 24
2600
Can't modify manifest version of custom module [Odoo.sh]
error
Avatar
Avatar
Avatar
2
Jul 24
5258
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 ภาษาไทย 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