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

Account.move avec Odoo V14.0 does not work

Subscriure's

Get notified when there's activity on this post

This question has been flagged
apiv14PHP
4318 Vistes
Avatar
Chris Lefevre

I am a beginner with Odoo ( V14.0 ) and its API. 

I managed to perform some actions with trial and error and here, I try to create an invoice based on what I saw passing as data in the Chrome console. 
 
I have advanced step by step and now I don't get any error but I still don't see any invoice appearing. 

Can you help me or give me a procedure? Thanks in advance. 



function new_invoice()  {

$doc = [
"date" => "2021-08-18",
"asset_id" => false,
"show_name_warning" => false,
"posted_before" => false,
"payment_state" => "not_paid",
"name" => "/NEW/PLUS/".date("ymdhis"),
"partner_id" => 20346,
"partner_shipping_id" => 20346,
"ref" => false,
"payment_reference" => "UUDYYD" . date("ymdhis"),
"partner_bank_id" => false,
"invoice_vendor_bill_id" => false,
"purchase_id" => false,
"purchase_vendor_bill_id" => false,
"invoice_date" => "2021-08-18",
"invoice_date_due" => "2021-09-17",
"invoice_payment_term_id" => 4,
"journal_id" => 1,
"currency_id" => 1,
"edi_document_ids" => [],
"invoice_line_ids" => [
[
0,
"virtual_2375",
[
"sequence" => 10,
"product_id" => 2962,
"name" => "[106 -CP] Wit 5 ml doseerpipet",
"account_id" => 374,
"analytic_account_id" => false,
"analytic_tag_ids" => [
[
6,
false,
[]
]
],
"quantity" => 1,
"product_uom_id" => 1,
"price_unit" => 5,
"discount" => 0,
"tax_ids" => [
[
6,
false,
[
1
]
]
],
"partner_id" => 20346,
"amount_currency" => -5,
"currency_id" => 1,
"debit" => 0,
"credit" => 5,
"date_maturity" => false,
"tax_tag_ids" => [
[
6,
false,
[
11
]
]
],
"purchase_line_id" => false,
"recompute_tax_line" => false,
"predict_from_name" => false,
"display_type" => false,
"is_rounding_line" => false,
"exclude_from_invoice_tab" => false,
"parent_state" => "draft"
]
]
],

"line_ids" => [
[
0,
"virtual_2379",
[
"account_id" => 178,
"sequence" => 10,
"name" => "UUDYYD",
"quantity" => 1,
"price_unit" => -6.05,
"discount" => 0,
"debit" => 6.05,
"credit" => 0,
"amount_currency" => 6.05,
"date_maturity" => "2021-09-17",
"currency_id" => 1,
"partner_id" => 20346,
"product_uom_id" => false,
"product_id" => false,
"tax_ids" => [
[
6,
false,
[]
]
],
"tax_base_amount" => 0,
"tax_exigible" => true,
"tax_repartition_line_id" => false,
"tax_tag_ids" => [
[
6,
false,
[]
]
],
"analytic_account_id" => false,
"analytic_tag_ids" => [
[
6,
false,
[]
]
],
"recompute_tax_line" => false,
"display_type" => false,
"is_rounding_line" => false,
"exclude_from_invoice_tab" => true,
"purchase_line_id" => false,
"predict_from_name" => false
]
],
[
0,
"virtual_2375",
[
"account_id" => 374,
"sequence" => 10,
"name" => "[106 -CP] Wit 5 ml doseerpipet",
"quantity" => 1,
"price_unit" => 5,
"discount" => 0,
"debit" => 0,
"credit" => 5,
"amount_currency" => -5,
"date_maturity" => false,
"currency_id" => 1,
"partner_id" => 20346,
"product_uom_id" => 1,
"product_id" => 2962,
"tax_ids" => [
[
6,
false,
[
1
]
]
],
"tax_base_amount" => 0,
"tax_exigible" => true,
"tax_repartition_line_id" => false,
"tax_tag_ids" => [
[
6,
false,
[
11
]
]
],
"analytic_account_id" => false,
"analytic_tag_ids" => [
[
6,
false,
[]
]
],
"recompute_tax_line" => false,
"display_type" => false,
"is_rounding_line" => false,
"exclude_from_invoice_tab" => false,
"purchase_line_id" => false,
"predict_from_name" => false
]
],
[
0,
"virtual_2385",
[
"account_id" => 221,
"sequence" => 10,
"name" => "21%",
"quantity" => 1,
"price_unit" => 1.05,
"discount" => 0,
"debit" => 0,
"credit" => 1.05,
"amount_currency" => -1.05,
"date_maturity" => false,
"currency_id" => 1,
"partner_id" => 20346,
"product_uom_id" => false,
"product_id" => false,
"tax_ids" => [
[
6,
false,
[]
]
],
"tax_base_amount" => 5,
"tax_exigible" => true,
"tax_repartition_line_id" => 2,
"tax_tag_ids" => [
[
6,
false,
[
47
]
]
],
"analytic_account_id" => false,
"analytic_tag_ids" => [
[
6,
false,
[]
]
],
"recompute_tax_line" => false,
"display_type" => false,
"is_rounding_line" => false,
"exclude_from_invoice_tab" => true,
"purchase_line_id" => false,
"predict_from_name" => false
]
]
],
"invoice_user_id" => 2,
"team_id" => 5,
"invoice_origin" => false,
"qr_code_method" => false,
"invoice_incoterm_id" => false,
"fiscal_position_id" => 2,
"invoice_cash_rounding_id" => false,
"invoice_source_email" => false,
"auto_post" => false,
"to_check" => false,
"campaign_id" => false,
"medium_id" => false,
"source_id" => false,
"message_follower_ids" => [],
"activity_ids" => [],
"message_main_attachment_id" => false,
"message_ids" => []
];



$invoice = $this->models->execute_kw( $this->db, $this->uid, $this->password, 'account.move', 'create', [$doc], );
echo $invoice; /* ---> It returns a number */
$action = $this->models->execute_kw( $this->db, $this->uid, $this->password, 'account.move', 'action_post', [$invoice] );
print_r($action); /* It does not return anything */
}

0
Avatar
Descartar
Niyas Raphy (Walnut Software Solutions)

what you receive when you print/echo the invoice variable ? if you get an id, you can check that id in the db for the created record

Chris Lefevre
Autor

With the "Create" method, I get an ID, like "46", but the following command returns nothing

I don't know how to access the contents of the DB.  I am Odoo.sh

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
Odoo 14: API : Getting product quantity by location
api v14
Avatar
Avatar
1
de gen. 23
2387
array values not updated using API
api v14
Avatar
0
de set. 21
2723
Api Get model data with particular user only
api v14
Avatar
0
de jul. 21
5640
API call to create a customer and assign account_fiscal_position
api v14
Avatar
Avatar
1
de març 21
5251
How to create a Lead using API from MAKE.com? Solved
api crm.lead v14
Avatar
Avatar
Avatar
3
de gen. 25
5099
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