Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
5161 Zobrazení

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
Zrušit

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 Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
pro 15
3376
0
čvn 17
2471
1
bře 15
5285
0
bře 15
3299
1
bře 15
6096