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
    Supply Chain
    • 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
    • Discuss
    • Kecerdasan Buatan
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • 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
    • Manajemen Properti
    • 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
    • Konsultasi
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan
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

How do you set-up products or services for Multicompany invoicing

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
accountinginvoicemulticompanyOdoo17
1010 Tampilan
Avatar
Sonny

We used a 3rd party app for Freight Management and it used the default invoice template without activating the Accounting module of Odoo for the Exports and Imports. I have modified the code to have a new model for Cartage and this is used by another (sister) company and based the new invoicing method snippet on the original. So far there is no error in the code, but more on the setting for the product/service. The company for cartage is invoicing its sisters company. The error so far we are encountering is "Invalid Operation: Any journal item on a receivable account must have a due date and vice versa." I do not know if our code is the issue or we really have config issues. Where should I enter the due date and vice-versa?


Here is the code snippet:

def action_create_invoice(self):
        current_company = self.env.company
        
        cartage_charges = self.env['cartage.service.charge'].with_company(current_company).search([
            ('commissioned_vehicle_id', '=', self.id),
            ('invoiced', '=', False)
        ])
        
        if not cartage_charges:
            raise UserError("No cartage service charges found to invoice.")
            
        bill_cartage_list = cartage_charges.mapped('bill_cartage')
        
        sale_journal = self.env['account.journal'].search([
            ('company_id', '=', current_company.id),
            ('type', '=', 'sale')
        ], limit=1)

        if not sale_journal:
            raise UserError(
                f"Configuration Error: No Sales Journal of type 'sale' found for company '{current_company.name}'."
            )
        
        for bill_cartage in set(bill_cartage_list):
            partner = self._get_partner_from_bill_cartage(bill_cartage)
            
            charges_to_invoice = cartage_charges.filtered(
                lambda c: c.bill_cartage == bill_cartage and not c.invoiced
            )
            
            if not charges_to_invoice:
                continue
            
            _logger.info(f"DEBUG: Creating invoice for bill_cartage: {bill_cartage}")
            _logger.info(f"DEBUG: Partner: {partner.name} (ID: {partner.id})")
            _logger.info(f"DEBUG: Current Company: {current_company.name} (ID: {current_company.id})")
            _logger.info(f"DEBUG: Sale Journal: {sale_journal.name} (ID: {sale_journal.id})")
            _logger.info(f"DEBUG: Number of charges to invoice: {len(charges_to_invoice)}")
    
            # Build invoice lines

            invoice_line_ids = []
            for charge in charges_to_invoice:
                if not charge.service_id:
                    raise UserError(f"Service ID is missing for charge.")
                
                product = charge.service_id
                
                # Verify income account exists
                income_account = product.property_account_income_id or \
                            product.categ_id.property_account_income_categ_id
                
                if not income_account:
                    raise UserError(
                        f"No income account configured for product '{product.display_name}'."
                    )
                
                invoice_line_ids.append((0, 0, {
                    'product_id': product.id,
                    'name': charge.name or product.name,
                    'quantity': 1.0,
                    'price_unit': charge.amount_price,
                }))
            
            # Create invoice - Odoo will auto-compute payment terms from partner
            invoice = self.env['account.move'].with_context(
                default_move_type='out_invoice'
            ).create({
                'partner_id': partner.id,
                'move_type': 'out_invoice',
                'invoice_date': fields.Date.today(),
                'invoice_date_due': fields.Date.today(),
                'commissioned_vehicle_id': self.id,
                'company_id': current_company.id,
                'journal_id': sale_journal.id,
                'invoice_line_ids': invoice_line_ids,
            })
            
            # Mark as invoiced
            charges_to_invoice.write({'invoiced': True})
        
        return self.button_customer_invoices()
0
Avatar
Buang
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
Invoice number pattern and controll per company Diselesaikan
accounting invoice multicompany invoice_number
Avatar
Avatar
Avatar
4
Mei 15
7384
How do I Invoice time? I need to switch the pay period.
accounting invoice
Avatar
Avatar
1
Des 25
2172
Invoice PDF preview Issue
accounting pdf invoice report Odoo17
Avatar
Avatar
1
Okt 25
4037
Automating Invoice Sending to Accountant Email
accounting invoice
Avatar
Avatar
1
Sep 25
2843
Unselect the Show in Invoices Footer option Diselesaikan
accounting invoice
Avatar
Avatar
Avatar
3
Nov 25
5890
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
  • Karir
  • 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo adalah software terintegrasi dengan 70+ aplikasi seperti CRM, Akuntansi, Inventaris, Sales, eCommerce, Marketing, POS; plus fitur lokal Indonesia!

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