Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
5158 Widoki

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

Awatar
Odrzuć

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.

Autor Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
gru 15
3376
0
cze 17
2471
1
mar 15
5259
0
mar 15
3296
1
mar 15
6094