Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

account.move.line with API

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
apiaccount.moveaccount.move.line
3 Replies
21506 Tampilan
Avatar
f.welter@netinteract.com

Hi all,

there are major differences between V12 and V13. In V13 i can add an invoice  via API and then i try to add account.move.line to that invoice. I always get the error

Cannot create unbalanced journal entry
Differences debit - credit

i set the following fields:

'account_id' => $account_id,
'move_id' => $odoo_move_id,
'product_id' => 174,
'tax_ids' => [[6, 0, [$odoo_tax_id]]],
'quantity' => 2.0,
'price_unit' => 1.99,
'name' => 'TEST'

Do i really have to add serveral lines in order to make it work? whatelse do i have to do in order to have odoo add the lines automatically just as it does when it do it via the UI?

Fritz


0
Avatar
Buang
Avatar
selvi
Jawaban Terbai

Hi, I have faced the same problem in v13.

Done some code changes, now its working for me.

I here share some of my changes, you may check if its useful for your's.

# Journal

journal_id = self.env['account.journal'].search([('type','=','sale')])[0]

# Move Line creation:

invoice_lines = []

for line in lines:

    invoice_lines.append((0,0,{

                                                            'name': line.name,

                                                            'display_name': line.name,

                                                            'price_unit': price,

                                                            'quantity': qty,

                                                            'product_uom_id': uoms.id,

                                                            'product_id': line.product_id.id,

                                                            'tax_ids': [(6, 0, tax.ids)],

                                                        }))


# Move creation:

    account_move = self.env['account.move'].sudo().create({

                                                            'name':  doc_name,

                                                            'invoice_origin': doc_name,

                                                            'invoice_date': date.today(),

                                                            'type': 'out_invoice',

                                                            'partner_id': partner.id,

                                                            'invoice_line_ids': invoice_lines,

                                                            'journal_id': journal_id.id,

                                                            'company_id': self.env.user.company_id.id,

                                        })


Thanks.

1
Avatar
Buang
Avatar
UAB Inovacijos
Jawaban Terbai

Hi,

Python code example for Odoo 13:

...

from odoo.tests.common import Form

class AccountMove(models.Model):
_inherit = 'account.move'

    def add_invoice_line(self):

         with Form(self) as move_form:
            with move_form.invoice_line_ids.new() as line:
                line.name ='Product Name'
                line.product_uom_id =
                line.price_unit = 1.0
                line.quantity = 1.0
                line.account_id =
            move_form.save()


0
Avatar
Buang
Avatar
Zbik
Jawaban Terbai

Read my answer in this question:
Create invoices/credit notes in odoo13 by code.

-2
Avatar
Buang
f.welter@netinteract.com
Penulis

Thanks, i had a lock on it.

I do a account.move create in the first place. Then i use the move_id to add account.move.line .

And there is the problem. as in former verions i expected that all nessesary lines are being created. at the moment with v13 it looks like i have to submit 3 lines in order to get the balance right.

Is there any way odoo api can add all lines by itself and automatically refere to the customer profile with all tax settings?

I would appreciate an example on how to add an invoice with all lines in V13. Is there any documentation available? I really could not find it.

Best regards and many thanks,

Fritz

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Write permission problem in account.move via API
api account.move
Avatar
0
Nov 24
2255
account.invoice.line
account.move account.move.line
Avatar
Avatar
2
Mar 22
7860
Track Deletions via API and Efficiently Sync account.move.line Records (V17.2)
api account.move.line deleted
Avatar
0
Sep 24
1871
[SOLVED] get data from mrp.production into account.move.line, but it won't show
account.move account.move.line mrp.production
Avatar
0
Jun 24
4127
add my custum field in account.move.line view in odoo 16 enterprise
account.move tree_view account.move.line
Avatar
Avatar
Avatar
2
Nov 23
4743
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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