Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

I can't inherit a wizard (Odoo v16)

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
wizardmodelsinherittransientmodelodoo16features
3 Odpowiedzi
4244 Widoki
Awatar
Vasilis Zartilas

Dear All,


Odoo V16


I try to inherit a wizard but I have the below error: 

TypeError: transforms the transient model 'sale.advance.payment.inv' into a non-transient model. That class should either inherit from TransientModel, or set a different '_name'. 




I don't inherit XML file, I want only to override the function.


I try to inherit this code:

class SaleAdvancePaymentInv(models.TransientModel):
​​ _name = 'sale.advance.payment.inv'
​_description = "Sales Advance Payment Invoice"

​def create_invoices(self):
​​​​​self._create_invoices(self.sale_order_ids)
​​​​...​
return {'type': 'ir.actions.act_window_close'}
​


My code:

class SaleAdvancePaymentInvInherited(models.TransientModel):
​# Also, I try without using _name
​_name = 'sale.advance.payment.inv.inherited'
​_inherit = "sale.advance.payment.inv"

​def create_invoices(self)
:
​​self._create_invoices(self.sale_order_ids)

​ ​logging.info('Hello function')
​ ​...
​ ​return {'type': 'ir.actions.act_window_close'}


0
Awatar
Odrzuć
Awatar
Niyas Raphy (Walnut Software Solutions)
Najlepsza odpowiedź

Hi,

You can remove the _name attribute from the code and try as follows:

class SaleAdvancePaymentInv(models.TransientModel):
_inherit = "sale.advance.payment.inv"

def _prepare_invoice_values(self, order, so_line):
res = super()._prepare_invoice_values(order, so_line)
if order.l10n_in_journal_id:
res['journal_id'] = order.l10n_in_journal_id.id
if order.country_code == 'IN':
res['l10n_in_gst_treatment'] = order.l10n_in_gst_treatment
if order.l10n_in_reseller_partner_id:
res['l10n_in_reseller_partner_id'] = order.l10n_in_reseller_partner_id
return res

Sample from: https://github.com/odoo/odoo/blob/16.0/addons/l10n_in_sale/wizard/sale_make_invoice_advance.py

Thanks

1
Awatar
Odrzuć
Vasilis Zartilas
Autor

I have the same error.

Niyas Raphy (Walnut Software Solutions)

please make sure to restart or ensure that the service is getting restarted and proper dependency is added

Vasilis Zartilas
Autor

I just restarted my computer. The IDE was stuck. Sad

Awatar
Adil Akbar
Najlepsza odpowiedź

Hi, you can follow following link for this:

https://youtu.be/oMnHpHH54QU

Thanks

0
Awatar
Odrzuć
Awatar
Cybrosys Techno Solutions Pvt.Ltd
Najlepsza odpowiedź

Hi

Try the code,

from odoo import models

class SaleAdvancePaymentInv(models.TransientModel):
    _inherit = 'sale.advance.payment.inv'

    def create_invoices(self):
        result = super(SaleAdvancePaymentInv, self).create_invoices()
       
        # Add your custom logic here
       
        return result

0
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Dynamic Fields in Wizard(TransientModel)
wizard odoo16features
Awatar
0
sty 24
2417
v16: custom model not created, what is error in py file Rozwiązane
models odoo16features
Awatar
Awatar
1
kwi 24
2448
How to add new statuses in the sales order view?
inherit odoo16features
Awatar
Awatar
1
lis 24
4907
odoo 16: Model creation problem - not creating model Rozwiązane
models odoo16features
Awatar
Awatar
1
maj 23
4311
Get id of the record I'm modifying with wizard
wizard models
Awatar
0
lut 25
3820
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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