Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Account.move avec Odoo V14.0 does not work

Naroči se

Get notified when there's activity on this post

This question has been flagged
apiv14PHP
4323 Prikazi
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
Opusti
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
Avtor

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!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Odoo 14: API : Getting product quantity by location
api v14
Avatar
Avatar
1
jan. 23
2388
array values not updated using API
api v14
Avatar
0
sep. 21
2724
Api Get model data with particular user only
api v14
Avatar
0
jul. 21
5641
API call to create a customer and assign account_fiscal_position
api v14
Avatar
Avatar
1
mar. 21
5253
How to create a Lead using API from MAKE.com? Solved
api crm.lead v14
Avatar
Avatar
Avatar
3
jan. 25
5099
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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