İçereği Atla
Menü
Bu soru işaretlendi
3 Cevaplar
5159 Görünümler

How can I add 2 fields there?

I try this:

account_invoice.py

class account_invoice_line(osv.osv):

_inherit = 'account.invoice.line'

_columns = {
'product_position': fields.char('Position'),
'product_note': fields.text('Produkt Notiz'),
}

But how must look the -xml file ????


The best is to make 2 new columns there.. , I need really help please

Avatar
Vazgeç

You're about "Customer Invoice" or "Supplier Invoice"? each has it's own form! you'll need to inherit the right one in XML and add your columns in inherited record.

Üretici En İyi Yanıt

I have the 2 fields in sale_order. How can I import that to the invoice fields, when I'm making a invoice from the sale_order?

I need to import the inside values from the fields from sale_order to account_invoice

Avatar
Vazgeç
En İyi Yanıt

wizardz,

it's possible.

follow the below code.

account_invoice.py file

from openerp.osv import fields, osv

from openerp import models,fields,api

class account_line(models.Model):

_inherit = ['account.invoice.line']

product_position = fields.Char('Position')

product_note = fields.Char('Produkt Notiz')

account_line()

Now goto the xml file.

<?xml version="1.0" encoding="UTF-8"?>

<openerp>

<data>

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

<field name="name">account.line.inherit.view</field>

<field name="model">account.invoice</field>

<field name="inherit_id" ref="account.invoice_form"/>

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

<field name="discount" position="after">

<field name="product_position" />

<field name="product_note" />

</field>

</field>

</record>

</data>

</openerp>

you can see in print screen.



if you want that small module inform me.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Ara 15
3376
0
Haz 17
2471
1
Mar 15
5259
0
Mar 15
3296
1
Mar 15
6096