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

Odoo12: TypeError: post() got an unexpected keyword argument 'invoice'

Abonnieren

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

Diese Frage wurde gekennzeichnet
invoicetypeerrorodoo12
3 Antworten
17335 Ansichten
Avatar
Syed Hamza

I get this error when i try to create invoice. 


Odoo Server Error
Traceback (most recent call last):
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/addons/web/controllers/main.py", line 966, in call_button
    action = self._call_kw(model, method, args, {})
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/addons/web/controllers/main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/api.py", line 759, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/odoo/api.py", line 746, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/env/env_zameen/addons/rsms/real_estate/models/file.py", line 353, in create_invoice
    invoice.action_invoice_open()
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/addons/sale/models/account_invoice.py", line 59, in action_invoice_open
    res = super(AccountInvoice, self).action_invoice_open()
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/thirdparty/financials/fiscal/models/fiscal_year.py", line 256, in action_invoice_open
    return super(AccountInvoice, self).action_invoice_open()
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/addons/account/models/account_invoice.py", line 988, in action_invoice_open
    to_open_invoices.action_move_create()
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/thirdparty/financials/account_asset/models/account_invoice.py", line 33, in action_move_create
    result = super(AccountInvoice, self).action_move_create()
  File "/home/syedhamza/custom/programming/enviornments/odoo/odoo12/src/odoo/addons/account/models/account_invoice.py", line 1341, in action_move_create
    move.post(invoice = inv)
TypeError: post() got an unexpected keyword argument 'invoice'

my code:


@api.multi
def create_invoice(self):
# check duplicity
list_of_product_id = [x.product_id.id for x in self.file_payment_ids]
for i in list_of_product_id:
if list_of_product_id.count(i) > 1:
raise ValidationError(_("Duplicity of products are not allowed"))
if self.file_payment_ids:
prod = [(0, 0, {
'product_id': rec.product_id.id,
'name': rec.product_id.name,
'account_id': rec.product_id.property_account_income_id.id,
# 'price_unit': rec.value if rec.payment_type == 'fix' else [self.sale_amount * rec.value / 100][0]
'price_unit': rec.initial_payment,
# 'is_fully_paid': rec.is_fully_paid
}) for rec in self.file_payment_ids]

invoice = self.env['account.invoice'].create({
'file_id': self, # this id is just for invoice create method i will extract this field from there and push remaining values
'name': self.name,
'type' : 'out_invoice',
'user_id':self.user_id.id,
'partner_id': self.membership_id.id,
'account_id': self.membership_id.property_account_receivable_id.id,
'property_invoice_type': 'initial_payment',
'date_invoice': self.booking_date,
'date_due': self.booking_date,
'invoice_line_ids': prod
})

invoice.action_invoice_open()

self.payment_states = 'open'

self.history_log('First Owner', invoice.create_date, self.membership_id.id,self.env.user.company_id.partner_id.id)
self.initial_invoice = False
self.env['confirmation'].confirmation_popup('Invoice')
Updated my Question:
here's the post method
_inherit = "account.move"
@api.multi
def post(self):
date_jv = self.date
fiscal_year_obj = self.env['fiscal.year'].search([('start_date', '<=', date_jv), ('end_date', '>=', date_jv)])
fiscal_month_obj = self.env['fiscal.month'].search(
[('open_close', '=', False), ('start_date', '<=', date_jv), ('end_date', '>=', date_jv)])

if date_jv:
inv_date = datetime.strptime(date_jv, "%Y-%m-%d")
else:
raise ValidationError(
"Please enter journal entry date!")
invdate_year = inv_date.year
if fiscal_year_obj:
if fiscal_year_obj[0].state != 'closed':
if fiscal_month_obj:
if fiscal_month_obj[0].state != 'closed':
return super(AccountMove, self).post()
else:
raise ValidationError(
"You are trying to access %r fiscal month that is already closed" % fiscal_month_obj[
0].name)
else:
raise ValidationError("month not found")

else:
raise ValidationError(
"You are trying to access %r fiscal year that is already closed" % fiscal_year_obj[0].name)
else:
raise ValidationError("year not found")

I don't know what is wrong. Any help ?

0
Avatar
Verwerfen
Sudhir Arya (ERP Harbor Consulting Services)

Search for the post method in your custom module and upload the method code in your question.

Avatar
Ravi Gadhia
Beste Antwort

you missed the invoice parameter which parent model has

@api.multi
def post(self, invoice=False):
date_jv = self.date
    iscal_year_obj = self.env['fiscal.year
 ​   ​    ​   ​     ​   ​    ​   ​

​

1
Avatar
Verwerfen
Avatar
Syed Hamza
Autor Beste Antwort

updated my question with post method

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
Open an invoice using XMLRPC
invoice odoo12
Avatar
Avatar
2
Mai 20
5810
ODOO 12: TypeError: Mixing apples and oranges: product.product(3280,).concat( No product price at date!)
typeerror odoo12
Avatar
Avatar
2
Feb. 20
4440
How to modify validated invoice?
invoice odoo12
Avatar
Avatar
Avatar
2
Nov. 18
4970
How to control auto post for journal entry comes from invoices in Odoo12?
invoice journal_entry odoo12
Avatar
0
Jan. 22
4208
[v12] propagate custom field from invoice to invoice report
invoice invoicereport odoo12
Avatar
Avatar
3
Dez. 19
5460
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