I want to add this, but it's not working:
account_invoice.py
# -*- coding: utf-8 -*-
from openerp import api
from openerp.osv import fields, osv
class account_invoice(osv.osv):
_inherit = 'account.invoice'
_columns = {
'notes_header': fields.text(''),
'notes_footer': fields.text('')
}
class account_invoice_line(osv.osv):
_inherit = 'account.invoice.line'
_columns = {
'product_position': fields.char(''),
'product_note': fields.text('')
}
account_invoice.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="account_invoice_form_ext_view" model="ir.ui.view">
<field name="name">account.invoice.form.ext</field>
<field name="model">account.invoice</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.view_invoice_form" />
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook/page/field[@name='comment']" position="after">
<field name="notes_header" placeholder="Kopfzeile" />
<field name="notes_footer" placeholder="Fusszeile" />
</xpath>
</field>
</record>
<record model="ir.ui.view" id="invoice_margin_percent_1">
<field name="name">account.margin.percent.view.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.view_invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_line']/form//field[@name='product_id']" position="before">
<field name="product_position"/>
</xpath>
<xpath expr="//field[@name='invoice_line']/form//field[@name='name']" position="before">
<field name="product_note"/>
</xpath>
</field>
</record>
</data>
</openerp>
Can someone help me ? I wanna add 2 fields in account_invoice under comment or above, and then a column "position" in the invoice_order_line.