Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5371 มุมมอง

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:

__init__.py

import po

__openerp__.py

{
    '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),
    }

PR()

po.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <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" />
                </xpath>
            </field>
        </record>
    </data>
</openerp>

Thank you very much

อวตาร
ละทิ้ง

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

ผู้เขียน

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

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 18
10564
importing Purchase Order shown as a RFQ แก้ไขแล้ว
2
พ.ค. 25
2227
0
ก.พ. 25
1438
0
ม.ค. 25
1207
Field service upgrade แก้ไขแล้ว
1
ธ.ค. 24
1584