Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Why is my tax not filled in when using an automated action?

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
many2onemany2manyautomationodoo8.0
1 Răspunde
5221 Vizualizări
Imagine profil
Yenthe Van Ginneken (Mainframe Monkey)

Hi guys,

I've extended the ability to automatically generate invoices from contracts. In the contracts page I've added the ability to add cars to contracts and on this car you can set a tax. See an example image here.

The cars field is a many2one to fleet.vehicle and inside this many2one I have a many2many relation to account.tax.
Python code:

_columns = {
   'car_id': fields.many2one('fleet.vehicle', 'Cars'), 
   'car_line_tax_id': fields.many2many('account.tax', 'account_car_line_tax', 'car_line_id', 'tax_id', string='BTW')

I now add a car to the car_id many2one and fill in a tax (for example: VAT-OUT-21-SERVICES). I then run the automatic planner which triggers a Python method that generates concept invoices from the contracts:

def _prepare_invoice_lines(self, cr, uid, contract, fiscal_position_id, context=None):
    //Lots of irrelevant code.
    //Loop over all cars that are added to the car_id list.
    for line in contract.recurring_invoice_car_line_ids: 
        //Add every car to the invoices_lines
        invoice_lines.append((0, 0, { 
            //Fill up the fields
            'quantity': line.car_number_of_units or 0.0,
            'price_unit': line.car_rent_price or 0.0, 
            //This line isn't working well. I know the filled in tax is in car_line_tax_id but it doesn't get filled in on the invoice.
'invoice_line_tax_id': line.car_line_tax_id,

So everything works fine except 'invoice_line_tax_id': line.car_line_tax_id. For some reason the tax doesn't get filled in in account.invoice.form on the field invoice_lines_tax_id. You can see an example here from both screens.

Why is this? Did I do something wrong or?

Thanks,
Yenthe



0
Imagine profil
Abandonează
Imagine profil
Zbik
Cel mai bun răspuns

Try adding in such a way:

'invoice_line_tax_id': [(6, 0, [x.id for x in line.car_line_tax_id)], 
1
Imagine profil
Abandonează
Yenthe Van Ginneken (Mainframe Monkey)
Autor

Works perfect! So why do you have to loop over them? Why can't I simply call the id? Because it can contain multiple values? Accepted & upvoted, thanks Zbik!

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

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Many2one field: 'id' instead of 'name' Rezolvat
many2one odoo8.0
Imagine profil
Imagine profil
1
feb. 21
5628
fill drop down on basis of many2many field
many2one many2many
Imagine profil
0
aug. 17
4441
Access many2one field values in kanban view ? Rezolvat
many2one odoo8.0
Imagine profil
1
aug. 16
4963
Many2one field issue Rezolvat
many2one odoo8.0
Imagine profil
Imagine profil
1
mar. 16
6591
How to fill up Many2Many after user took an option from a selection? Rezolvat
domain many2one selection many2many odoo8.0
Imagine profil
Imagine profil
1
mar. 15
18894
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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