Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

How to change the Invoice Line?

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
taxinvoice.line
3 Respuestas
17532 Vistas
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
Descartar
Avatar
NSC
Mejor respuesta

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
Descartar
Avatar
my
Autor Mejor respuesta

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
Descartar
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
Mejor respuesta

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
Descartar
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

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Advance customer payment and its VAT reflection
tax
Avatar
Avatar
1
jul 25
3018
POS Tax
tax
Avatar
Avatar
1
jul 25
8257
Federal Unemployment Tax (FUTA) calculates at 10X in Payroll App
tax
Avatar
1
mar 25
2279
Tax rate on shipping cost Germany/ Austria
tax
Avatar
Avatar
2
ago 24
2920
How to hide tax column in sale order/ quotation form ?
tax
Avatar
Avatar
1
dic 23
12014
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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