Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

TypeError: 'int' object is not subscriptable Odoo V11

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
invoiceodoo11
1 Beantwoorden
15579 Weergaven
Avatar
Muhammed Nishad

Hi ,

    I was trying to create an invoice via code for a purpose.My code is like this

   

custom_invoice.update({
'state': 'draft',
'number': False,
'invoice_line': [],
'tax_line': [],
    'user_id':custom_invoice['user_id'][0],
    'reference_type':custom_invoice['reference_type'],
    'account_id':custom_invoice['account_id'][0],
    'date_due':custom_invoice['date_due'],
    'comment':custom_invoice['comment'],
    'name':custom_invoice['name'],
    'amount_untaxed':custom_invoice['amount_untaxed'],
    'date_invoice':custom_invoice['date_invoice'],
    'state':'draft',
    'journal_id':custom_invoice['journal_id'][0],
    'invoice_line':custom_invoice['invoice_line'],
    'incoterms_id':custom_invoice['incoterms_id'],
    'currency_id':custom_invoice['currency_id'][0],
    'type':custom_invoice['type'],
    'reference':custom_invoice['reference'],
    'team_id':custom_invoice['team_id'][0],
    'invoice_line_ids':custom_invoice['invoice_line_ids'],
    'number':custom_invoice['name'],
    'payment_term_id':custom_invoice['payment_term_id'][0],
    'tax_line_ids':custom_invoice['tax_line_ids'],
    'tax_line':custom_invoice['tax_line'],
    'partner_id':custom_invoice['partner_id'][0],
    'amount_total':custom_invoice['amount_total'],
    'amount_tax':custom_invoice['amount_tax'],
    'amount_untaxed_signed':custom_invoice['amount_untaxed_signed'],
    'origin':custom_invoice['origin'],
    'display_name':custom_invoice['display_name'],
    'partner_shipping_id':custom_invoice['partner_id'][0],
    'commercial_partner_id':custom_invoice['partner_id'][0],
    'company_id':custom_invoice['company_id'][0],
    'sequence_number_next_prefix':custom_invoice['sequence_number_next_prefix'],
    'company_currency_id':custom_invoice['company_currency_id']
    })


invoice_id = self.env['account.invoice'].create(custom_invoice)

Then It shows this error :

        TypeError: 'int' object is not subscriptable



Please help me to find out what is wrong with the dict I have given?


1
Avatar
Annuleer
Avatar
Nikhil Krishnan
Beste antwoord

Hi Muhammed Nisha,

invoice_id = self.env['account.invoice'].create({
'state': 'draft',
'number': False,
'invoice_line': [],
'tax_line': [],
'user_id':custom_invoice['user_id'][0],
'reference_type':custom_invoice['reference_type'],
'account_id':custom_invoice['account_id'][0],
'date_due':custom_invoice['date_due'],
'comment':custom_invoice['comment'],
'name':custom_invoice['name'],
'amount_untaxed':custom_invoice['amount_untaxed'],
'date_invoice':custom_invoice['date_invoice'],
'state':'draft',
'journal_id':custom_invoice['journal_id'][0],
'invoice_line':custom_invoice['invoice_line'],
'incoterms_id':custom_invoice['incoterms_id'],
'currency_id':custom_invoice['currency_id'][0],
'type':custom_invoice['type'],
'reference':custom_invoice['reference'],
'team_id':custom_invoice['team_id'][0],
'invoice_line_ids':custom_invoice['invoice_line_ids'],
'number':custom_invoice['name'],
'payment_term_id':custom_invoice['payment_term_id'][0],
'tax_line_ids':custom_invoice['tax_line_ids'],
'tax_line':custom_invoice['tax_line'],
'partner_id':custom_invoice['partner_id'][0],
'amount_total':custom_invoice['amount_total'],
'amount_tax':custom_invoice['amount_tax'],
'amount_untaxed_signed':custom_invoice['amount_untaxed_signed'],
'origin':custom_invoice['origin'],
'display_name':custom_invoice['display_name'],
'partner_shipping_id':custom_invoice['partner_id'][0],
'commercial_partner_id':custom_invoice['partner_id'][0],
'company_id':custom_invoice['company_id'][0],
'sequence_number_next_prefix':custom_invoice['sequence_number_next_prefix'],
'company_currency_id':custom_invoice['company_currency_id']
})

You just try this, it will help you to solve the issue.

Thanks

2
Avatar
Annuleer
Muhammed Nishad
Auteur

Thank you for the suggetion

But I have already found the solution.

Once again I appreciate your answer since it's the better one.

Nikhil Krishnan

Thanks.!

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Odoo:11 - Changes in report_invoice_document are not reflecting in Invoice PDF report
invoice customization odoo11
Avatar
Avatar
2
okt. 20
8580
What does the Validate button do when creating new customer invoices on Odoo 11? Opgelost
invoice validation odoo11
Avatar
Avatar
Avatar
2
aug. 19
8531
Layout of invoice for printing in Odoo 11 ?
invoice layout odoo11
Avatar
Avatar
Avatar
4
aug. 18
20567
Modify autofill description in when create invoice Opgelost
invoice odoo11 autofill
Avatar
Avatar
1
jun. 18
5794
When looking at QWEB views for Reports, what is o ? For example: <p t-raw="o.name"/> Opgelost
invoice report odoo11
Avatar
Avatar
Avatar
Avatar
Avatar
4
jun. 18
6265
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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