Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Problem with custom_field VAT price per account.invoice.line and recompute taxe account.invoice

Subscriure's

Get notified when there's activity on this post

This question has been flagged
vatodooV8account.invoice.line
2 Respostes
4721 Vistes
Avatar
Youri Lebarch

I try to add a field in treeview account_invoice_line in invoice which compute and display VAT price per account_invoice_line (1). It's done but when try to recompute total tax (2), the VAT price per line is recompute to 0 (Except for line create in sale.order)



Have you an idea for VAT prices are good for all account.invoice.line 


My code : 

class cap_account_invoice_line(osv.osv):

_inherit = 'account.invoice.line'

_columns = {

'price_with_tax':fields.float(string='Prix TTC', store=True, readonly=True,),

}

@api.multi

def product_id_change(self, product, account_id, uom_id, qty=0, name='', type_x='out_invoice',

partner_id=False, fposition_id=False, price_unit=False, currency_id=False, company_id=None,context = None):

if context is None:

context = {}

if partner_id:

res = super(cap_account_invoice_line, self).product_id_change(product, uom_id, qty=qty, name=name, type=type_x,

partner_id=partner_id, fposition_id=fposition_id, price_unit=price_unit, currency_id=currency_id,

company_id=company_id)

if res == 0:

return res

context = self._context

company_id = company_id if company_id is not None else context.get('company_id', False)

self = self.with_context(company_id=company_id, force_company=company_id)

part = self.env['res.partner'].browse(partner_id)

product = self.env['product.product'].browse(product)

fpos = self.env['account.fiscal.position'].browse(fposition_id)

if type in ('out_invoice', 'out_refund'):

account = product.property_account_income or product.categ_id.property_account_income_categ

else:

account = product.property_account_expense or product.categ_id.property_account_expense_categ

account = fpos.map_account(account)

if type in ('out_invoice', 'out_refund'):

taxes = product.taxes_id or account.tax_ids

else:

taxes = product.supplier_taxes_id or account.tax_ids

taxes = fpos.map_tax(taxes)

taxes.ids

values = res['value']

price = values.get('price_unit', 0) * (1 - values.get('discount', 0) / 100.0)

taxes = values.get('invoice_line_tax_id')

taxes = self.env['account.tax'].browse(taxes)

tax_res = taxes.compute_all(price, qty,product=product, partner=part)

values['price_with_tax'] = tax_res['total_included']

res['value'] = values

return res

@api.multi

def uos_id_change(self, product, uom, qty=0, name='', type_x='out_invoice', partner_id=False,

fposition_id=False, price_unit=False, currency_id=False, company_id=None):

if uom:

super(cap_account_invoice_line, self).uos_id_change(product, uom, qty, name, type_x, partner_id, fposition_id, price_unit, currency_id, company_id)





1
Avatar
Descartar
Avatar
Serpent Consulting Services Pvt. Ltd.
Best Answer

Hi,

While you recompute the invoice, did you make sure your vat price is already affecting the price_subtotal of the invoice line?

Logically, your new field should affect the calculations of the field subtotal. And that subtotal will affect the other float fields of the invoice.

Hope this helps.

Thanks.

0
Avatar
Descartar
Avatar
Cyril Gaspard (GEM)
Best Answer

Hi,

for price VAT in invoice line see :


https://www.odoo.com/fr_FR/forum/help-1/question/is-it-possible-to-show-both-tax-included-and-tax-excluded-total-price-in-invoice-lines-83343

bye

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
Import VAT number for a supplier Solved
import vat odooV8
Avatar
1
de des. 15
5766
Ho to insert TIN (VAT code) without Country Code?
vat vat_base odooV8
Avatar
0
de set. 15
6363
CONFIGURACION DE CORREO PROPIO POR PRUMERA VEZ
odooV8
Avatar
0
de març 25
2078
How to remove model if not in the py files anymore
odooV8
Avatar
0
de gen. 25
4406
Start odoo server automatically in Ubuntu 14.04 on reboot Solved
odooV8
Avatar
Avatar
1
d’ag. 23
16030
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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