Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Add char field Purchase Order by custom module error

on 2/21/14, 5:28 AM 1,543 views

I try to add a char field in Purchase Order form view after the Total field field[@name='amount_total']. I've been struggle with this, please help me. Right now, the error shows invalid XML architecture. Here's my code:


import po


    'name': 'PO money in text',
    'version': '1.0',
    'author': 'GonG',
    'category': 'Tools',
    'depends': ['purchase'],
    'data': ['po.xml'],
    'demo': [],
    'installable': True,

po.py from openerp.osv import fields, osv

class PO(osv.osv):

    _inherit = 'purchase.order'
    _columns = {
        'money_in_text': fields.char('Money in Word', size=200),



<?xml version="1.0" encoding="utf-8"?>
        <record model="ir.ui.view" id="PO">
            <field name="name">purchase.order.form</field>
            <field name="model">purchase.order</field>
            <field name="inherit_id" ref="purchase.purchase_order_form" />
            <field name="arch" type="xml">
                <xpath expr="/form/sheet/notebook/page[@string='Purchase Order']/group/field[@name='amount_total']" position="after">
                    <field name="money_in_text" />

Thank you very much

Python file end of the line PR() replace with PO(). Restart server and update the module it will works.

on 2/21/14, 5:57 AM

Arh!!!! totally stupid mistakes. Thank you very much.

on 2/21/14, 7:16 AM

No needs to recall PO() at the end of the class

Thierry Godin
on 2/21/14, 11:06 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 2/21/14, 5:28 AM
Seen: 1543 times
Last updated: 3/16/15, 8:10 AM