Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

How to change the Invoice Line?

Odebírat

Get notified when there's activity on this post

This question has been flagged
taxinvoice.line
3 Odpovědi
17541 Zobrazení
Avatar
my

Hi i want to change the code in this field in the line of Invoice: [[ formatLang(l.price_subtotal, digits get_digits(dp 'Account')) ]] [[ o.currency_id.symbol ]]. I want it incl. tax. How had to be this code? Who can help me?

1
Avatar
Zrušit
Avatar
NSC
Nejlepší odpověď

I have a similar issue. Maybe somebody can help. I need to add only product.name_template to account.invoice.line. This is the very left part of the invoice lines shown inside form view. Booking text joins Internal ID, product name and product description. This is too much and these three fields can not be accessed separately. Internal Id and description are only for internal use and should not appear on my invoices. I would be grateful for help.

0
Avatar
Zrušit
Avatar
my
Autor Nejlepší odpověď

Hi klacus, hi i get an Error

OpenERP Server Error

Client Traceback (most recent call last): File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\web\http.py", line 204, in dispatch File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\web\controllers\main.py", line 1133, in call_button File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\web\controllers\main.py", line 1121, in _call_kw File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\web\session.py", line 43, in proxy File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\web\session.py", line 31, in proxy_method File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\web\session.py", line 104, in send

Server Traceback (most recent call last): File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\web\session.py", line 90, in send File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\netsvc.py", line 293, in dispatch_rpc File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\service\web_services.py", line 626, in dispatch File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\osv\osv.py", line 188, in execute_kw File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\osv\osv.py", line 131, in wrapper File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\osv\osv.py", line 197, in execute File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\osv\osv.py", line 185, in execute_cr File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\sale\sale.py", line 579, in action_button_confirm File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\wkf_service.py", line 119, in trg_validate File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\instance.py", line 43, in validate File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 60, in process File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 175, in _split_test File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 183, in _join_test File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 40, in create File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 60, in process File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 175, in _split_test File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 183, in _join_test File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 40, in create File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 60, in process File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 175, in _split_test File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 183, in _join_test File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 40, in create File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 52, in process File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\workitem.py", line 127, in _execute File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\wkf_expr.py", line 67, in execute File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\workflow\wkf_expr.py", line 57, in _eval_expr File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\tools\safe_eval.py", line 241, in safe_eval File "", line 1, in <module> File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\osv\orm.py", line 374, in function_proxy File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\sale_stock\sale_stock.py", line 190, in action_invoice_create File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\sale\sale.py", line 519, in action_invoice_create File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\sale\sale.py", line 809, in invoice_line_create File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\osv\orm.py", line 4478, in create File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\osv\orm.py", line 4627, in _store_set_values File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server.\openerp\osv\fields.py", line 1131, in get File "C:\Program Files (x86)\OpenERP 7.0-20130327-002325\Server\server\openerp\addons\csysc_inh_account_inv_tax\account_invoice.py", line 10, in _amount_line TypeError: _amount_line() takes exactly 7 arguments (8 given)

Whats wrong?

0
Avatar
Zrušit
klacus

Morgen.. :-) Yeah, just a wait a few hours. I will help you, as I can... Please try the upside code.

klacus

Hi. Just do it. If I can I will help you. Regards.

klacus

Your problem is raised here: def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict):

but the problem is there: _columns = { 'tax_percent' : fields.float('tax_percent'), # percentage of the tax 'tax_amount' : fields.float('tax_amount'), # amount of the tax 'line_total' : fields.float('line_total'), # calculate line tax + line amount 'price_subtotal': fields.function(_amount_line, string='Subtotal', type="float",digits_compute= dp.get_precision('Account'), store=True),
} Please check again. the price_subtotal..

my
Autor

hi, thanks for your help. Now I can indeed confirm an offer again in an order, but unfortunately at the 'price_subtota'l nothing changed. Here, the net amount is still displayed.

klacus

What is the situation now? 1. The program is running? 2. You should restart your server, after change something in python. 3. Price subtotal is change by auto, if you create a new invoice line. May you forget the restart. :-)

klacus

What is the situation now? 1. The program is running? 2. You should restart your server, after change something in python. 3. Price subtotal is change by auto, if you create a new invoice line. May you forget the restart. :-)

Avatar
klacus
Nejlepší odpověď

Hi.

The account.invoice.line table is not include the tax. So if you want to see the tax by row, first your need to inherit the account.invoice.line table to add tax. After that you need some code in python what is filling it. If you have all of this things you can add a report. Just put somewhere [[o.your_tax_column_name]].

If you use Open/libre for editing, sometimes the system not found your custom record, but do not hesitate write it by hand, and try to see the filed values.

You need to understand the followings: - inherit a model. - some basics in python.

Hi.

In python you can add like this your own inherit module: My module name is: csysc_inh_account_inv_tax You just create a folder under addons. . create the following files with a same name - install a module. (first refresh the modules list, after looking the csysc_... module)

account_invoice.py

from osv import fields, osv
import decimal_precision as dp
import time

# inherit account_invoice line by standard way

class account_invoice_line(osv.osv):
    # override this methode to get the tax info's by invoice line   
    def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict):
        values = super(account_invoice_line, self)._amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict)
        res = {}
        tax_obj = self.pool.get('account.tax')
        cur_obj = self.pool.get('res.currency')
        for line in self.browse(cr, uid, ids):
            price = line.price_unit * (1-(line.discount or 0.0)/100.0)
            taxes = tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, price, line.quantity, product=line.product_id, address_id=line.invoice_id.address_invoice_id, partner=line.invoice_id.partner_id)
            res[line.id] = taxes['total']
                        #-----------------------------------------------------------------------------------
        for r in taxes['taxes']: # listing the result list
            id = r.get('id')    # get id of the taxes       
        tax_percent = self.pool.get('account.tax').browse(cr, uid, id).amount               
        tax_amount  = taxes['total_included'] -  taxes['total']
        tax_total   = taxes['total_included'] 
        for r in ids:
            id = r
            cr.execute('UPDATE account_invoice_line SET tax_percent = %s  WHERE id=%s', (tax_percent,id,))
            cr.execute('UPDATE account_invoice_line SET Tax_amount = %s  WHERE id=%s', (tax_amount,id,))
            cr.execute('UPDATE account_invoice_line SET Line_total = %s  WHERE id=%s', (tax_total,id,)) 
        #-----------------------------------------------------------------------------------            
            if line.invoice_id:
                cur = line.invoice_id.currency_id
                res[line.id] = cur_obj.round(cr, uid, cur, res[line.id])
        return res  

    _inherit= "account.invoice.line"
    _description = "account.invoice.line"  

    _columns = {
        'tax_percent' : fields.float('tax_percent'),    # percentage of the tax 
        'tax_amount' : fields.float('tax_amount'),      # amount of the tax
        'line_total' : fields.float('line_total'),      # calculate line tax + line amount
        'price_subtotal': fields.function(_amount_line, string='Subtotal', type="float",digits_compute= dp.get_precision('Account'), store=True),       
            }


account_invoice_line()

__openerp__.py:

{
    "name" : "csysc_inh_account_inv_tax",
    "version" : "1.0",
    "author" : "Company System Controll LTD",
    "website" : "",
    "category" : "Generic Modules/Others",
    "depends" : ["base","account"],
    "description" : "Overvrite account invoice line. Put and calculate tax by line.",
    "init_xml" : [],
    "demo_xml" : [],
    "update_xml" : [],
    "active": False,
    "installable": True
}

__init__.py:

import account_invoice

Comment: I use update sql,. because the orm write methode is always call _amount_line methode, so I want to avoid the never ending story.. :-)

If you want to modify the report of the invoices, now you can find the new, and hopefully filled records, when you browse that in Libreoffice report designer.

In the report designer. 1. Join to the server 2. Modify report >> account.invoice 3. Go to the second section. 4. Insert the field. >> [[ l.tax_amount ]] 5. Save report. 7. Send to the server.

or direct in rml open the addons/account/report/acount_print_invoice.rml modify Table 7 and Table8
- modify the table description:

<blockTable colWidths="185.0,70.0,80.0,60.0,**50.0**,50.0,85.0" style="Table7">
  <tr>
    <td>
      <para style="terp_tblheader_General">Description</para>
    </td>
    <td>
      <para style="terp_tblheader_General_Centre">Taxes</para>
    </td>
    <td>
      <para style="terp_tblheader_General_Right">Quantity</para>
    </td>
    <td>
      <para style="terp_tblheader_General_Right">Unit Price</para>
    </td>
    <td>
      <para style="terp_tblheader_General_Right">Disc.(%)</para>
    </td>
    <td>
      <para style="terp_tblheader_General_Right">Tax amount</para>
    </td>
    <td>
      <para style="terp_tblheader_General_Right">Price</para>
    </td>
  </tr>
</blockTable>

and Table 8 modify also: (put the data record)

<para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
  <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table8">
    <tr>
      <td>
        <para style="terp_default_9">[[ l.name ]]</para>
      </td>
      <td>
        <para style="terp_default_Centre_9">[[ ', '.join([ lt.name or '' for lt in l.invoice_line_tax_id ]) ]]</para>
      </td>
      <td>
        <para style="terp_default_Right_9">[[ formatLang(l.quantity)]] [[ (l.uos_id and l.uos_id.name) or '' ]]</para>
      </td>
      <td>
        <para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
      </td>
      <td>
        <para style="terp_default_Centre_9">[[ formatLang(l.discount, dp='Account') ]] </para>
      </td>
      **<td>
        <para style="terp_default_9">[[ l.tax_amount ]]</para>
      </td>**
      <td>
        <para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, dp='Account', currency_obj=o.currency_id) ]]</para>
      </td>
    </tr>
    <tr>
      <td>
        <para style="terp_default_Note">[[ format(l.note or '') or removeParentNode('tr') ]]</para>
      </td>
      <td>
        <para style="terp_default_9">
          <font color="white"> </font>
        </para>
      </td>
      <td>
        <para style="terp_default_Right_9">
          <font color="white"> </font>
        </para>
      </td>
      <td>
        <para style="terp_default_Right_9">
          <font color="white"> </font>
        </para>
      </td>
      <td>
        <para style="terp_default_Right_9">
          <font color="white"> </font>
        </para>
      </td>
      <td>
        <para style="terp_default_Right_9">
          <font color="white"> </font>
        </para>
      </td>
      <td>
        <para style="terp_default_Right_9">
          <font color="white"> </font>
        </para>
      </td>
    </tr>
  </blockTable>
0
Avatar
Zrušit
klacus

What is the situation now? 1. The program is running? 2. You should restart your server, after change something in python. 3. Price subtotal is change by auto, if you create a new invoice line. May you forget the restart. :-)

klacus

In libre office, you can copy a field from existing field, and rename it to [[o.tax_amount]] >> this should be your new record from your account.invoice.line object. The SQL update is must be done from system side, when you install the module. You can check it by PGAdmin. (Must be find out the new records in account_invoice_line table)

klacus

Ok I checked. Please be note the report has two object: o.recordname >> come from account.invoice l.recordname >> come from account.invoice.line object. So your case you need to add by l.tax_amount. Sorry about, because I did not check the account_print_invoice.rml, I wrote down all of my head. :-( But try this way, and never give up! :-)

klacus

I refreshed the answer, please check, how to modify the report. Like a small how to :-)

klacus

Hi. Please check the table. Do you have a data in the table of account_invoice_line? (I mean the new records.)

klacus

You check by PgAdmin? What kind of tool use for the coding? Eclipse? Can you debug the code by breakpoint?

my
Autor

Hi, Yes i checked by PgAdmin. I copy and pasted your code with notepad. How can i debug the cde?

klacus

You need to refer the following: http://stackoverflow.com/questions/10087899/how-to-debug-python-code-in-openerp-6-1

Sajt Mano

HI! I applied this modification in OERP 7.0, account/account_invoice.py. But when I try to create an Invoice from a Sales order I got this error: File "/home/openerp/server/openerp/addons/account/account_invoice.py", line 1395, in _amount_line for r in taxes['taxes']: # listing the result list UnboundLocalError: local variable 'id' referenced before assignment

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Advance customer payment and its VAT reflection
tax
Avatar
Avatar
1
čvc 25
3024
POS Tax
tax
Avatar
Avatar
1
čvc 25
8268
Federal Unemployment Tax (FUTA) calculates at 10X in Payroll App
tax
Avatar
1
bře 25
2284
Tax rate on shipping cost Germany/ Austria
tax
Avatar
Avatar
2
srp 24
2930
How to hide tax column in sale order/ quotation form ?
tax
Avatar
Avatar
1
pro 23
12027
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now