Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

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

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

receivable amount not updated (move not balanced) after adding new tax line

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
invoicebalanceaccount.move
2886 Ansichten
Avatar
Yahia

I have a module that create new tax to invoice for cash payment mode; 

the tax is added to move.lines but it's value not added to receivable account to get a balanced move.


ERROR:

The move (Draft Invoice INV/2024/00002) is not balanced. The total of debits equals 416.50 DA and the total of credits equals 421.50 DA. You might want to specify a default account on journal "Customer Invoices" to automatically balance each move. 


following is a code:

   def ks_update_timbre_fiscal_dz_15(self):
for rec in self:
already_exists = self.line_ids.filtered(
lambda line: line.name and line.name.find('Timbre Fiscal') == 0)
terms_lines = self.line_ids.filtered(
lambda line: line.account_id.account_type in ('asset_receivable', 'liability_payable'))

other_lines = self.line_ids.filtered(
lambda line: line.account_id.account_type not in ('asset_receivable', 'liability_payable'))
if already_exists:
amount = rec.ks_amount_global_tax
if rec.ks_sales_tax_account_id \
and (rec.move_type == "out_invoice"
or rec.move_type == "out_refund")\
and rec.ks_global_tax_rate > 0:
if rec.move_type == "out_invoice":
already_exists.update({
'debit': amount 'credit': amount > 0.0 and amount or 0.0,
})
else:
already_exists.update({
'debit': amount > 0.0 and amount or 0.0,
'credit': amount })
else:
already_exists.update({
'debit': amount 'credit': amount > 0.0 and amount or 0.0,
})
total_balance = sum(other_lines.mapped('balance'))
total_amount_currency = sum(other_lines.mapped('amount_currency'))
terms_lines.update({
'amount_currency': -total_amount_currency,
'debit': total_balance 'credit': total_balance > 0.0 and total_balance or 0.0,
})
if not already_exists and rec.ks_global_tax_rate > 0:
in_draft_mode = self != self._origin
if not in_draft_mode:
rec._recompute_timbre_fiscal_dz_15_lines()

@api.onchange('ks_global_tax_rate', 'line_ids')
def _recompute_timbre_fiscal_dz_15_lines(self):
for rec in self:
type_list = ['out_invoice', 'out_refund', 'in_invoice', 'in_refund']
if rec.ks_global_tax_rate > 0 and rec.move_type in type_list:
if rec.is_invoice(include_receipts=True):
in_draft_mode = self != self._origin
ks_name = "Timbre Fiscal"
ks_name = ks_name + \
" @" + str(self.ks_global_tax_rate) + "%"
terms_lines = self.line_ids.filtered(
lambda line: line.account_id.account_type in ('asset_receivable', 'liability_payable'))


already_exists = self.line_ids.filtered(
lambda line: line.name and line.name.find('Timbre Fiscal') == 0)
if already_exists:
amount = self.ks_amount_global_tax
if self.ks_sales_tax_account_id \
and (self.move_type == "out_invoice"
or self.move_type == "out_refund"):
already_exists.update({
'name': ks_name,
'debit': amount 'credit': amount > 0.0 and amount or 0.0,
})

else:
new_tax_line = self.env['account.move.line']
create_method = in_draft_mode and \
self.env['account.move.line'].new or\
self.env['account.move.line'].create

if self.ks_sales_tax_account_id \
and (self.move_type == "out_invoice"
or self.move_type == "out_refund"):
amount = self.ks_amount_global_tax
dict = {
'move_name': self.name,
'name': ks_name,
'price_unit': self.ks_amount_global_tax,
'quantity': 1,
'debit': amount 'credit': amount > 0.0 and amount or 0.0,
'account_id': self.ks_sales_tax_account_id,
'move_id': self._origin,
'date': self.date,
'partner_id': terms_lines.partner_id.id,
'company_id': terms_lines.company_id.id,
'company_currency_id': terms_lines.company_currency_id.id,
}
if self.move_type == "out_invoice":
dict.update({

'debit': amount 'credit': amount > 0.0 and amount or 0.0,
})
else:
dict.update({
'debit': amount > 0.0 and amount or 0.0,
'credit': amount })
if in_draft_mode:
self.line_ids += create_method(dict)
# Updation of Invoice Line Id
duplicate_id = self.invoice_line_ids.filtered(
lambda line: line.name and line.name.find('Timbre Fiscal') == 0)
self.invoice_line_ids = self.invoice_line_ids - duplicate_id
else:
dict.update({
'price_unit': 0.0,
'debit': 0.0,
'credit': 0.0,
})
self.line_ids = [(0, 0, dict)]


if self.move_type == "in_invoice":
dict.update({
'debit': amount > 0.0 and amount or 0.0,
'credit': amount })
else:
dict.update({
'debit': amount 'credit': amount > 0.0 and amount or 0.0,
})
self.line_ids += create_method(dict)
# updation of invoice line id
duplicate_id = self.invoice_line_ids.filtered(
lambda line: line.name and line.name.find('Timbre Fiscal') == 0)
self.invoice_line_ids = self.invoice_line_ids - duplicate_id

if in_draft_mode:
# Update the payement account amount
terms_lines = self.line_ids.filtered(
lambda line: line.account_id.account_type in ('asset_receivable', 'liability_payable'))
other_lines = self.line_ids.filtered(
lambda line: line.account_id.account_type not in ('asset_receivable', 'liability_payable'))

total_balance = sum(other_lines.mapped('balance'))
total_amount_currency = sum(other_lines.mapped('amount_currency'))
terms_lines.update({
'amount_currency': -total_amount_currency,
'debit': total_balance 'credit': total_balance > 0.0 and total_balance or 0.0,
})
else:
terms_lines = self.line_ids.filtered(
lambda line: line.account_id.account_type in ('asset_receivable', 'liability_payable'))
other_lines = self.line_ids.filtered(
lambda line: line.account_id.account_type not in ('asset_receivable', 'liability_payable'))
already_exists = self.line_ids.filtered(
lambda line: line.name and line.name.find('Timbre Fiscal') == 0)
total_balance = sum(other_lines.mapped('balance')) - amount
total_amount_currency = sum(other_lines.mapped('amount_currency'))
dict1 = {
'debit': amount 'credit': amount > 0.0 and amount or 0.0,
}
dict2 = {
'debit': total_balance 'credit': total_balance > 0.0 and total_balance or 0.0,
}
if terms_lines:
self.line_ids = [(1, already_exists.id, dict1), (1, terms_lines[0].id, dict2)]
print()

elif self.ks_global_tax_rate already_exists = self.line_ids.filtered(
lambda line: line.name and line.name.find('Timbre Fiscal') == 0)
if already_exists:
self.line_ids -= already_exists
terms_lines = self.line_ids.filtered(
lambda line: line.account_id.account_type in ('asset_receivable', 'liability_payable'))
other_lines = self.line_ids.filtered(
lambda line: line.account_id.account_type not in ('asset_receivable', 'liability_payable'))
total_balance = sum(other_lines.mapped('balance'))
total_amount_currency = sum(other_lines.mapped('amount_currency'))
terms_lines.update({
'amount_currency': -total_amount_currency,
'debit': total_balance 'credit': total_balance > 0.0 and total_balance or 0.0,
})


0
Avatar
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
Add a new tax to invoice (worked on odoo15 and not on odoo16)
invoice tax balance account.move lineitem
Avatar
0
Feb. 24
1924
Error in studio domain
invoice account.move studio
Avatar
Avatar
1
Feb. 23
2446
Creating invoice in accounting module
invoice account.move sale.order
Avatar
Avatar
1
Aug. 21
4310
set account.move reference to the invoice number
invoice reference account.move
Avatar
0
März 15
5033
Issue: Newly Created account.move Records Not Showing in Odoo Interface
invoice xmlrpc account.move interface
Avatar
Avatar
Avatar
Avatar
4
Feb. 24
4437
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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