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

How to create an Invoice In Restaurant Management Module

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
invoice
3556 Widoki
Awatar
Kapil More


Hi,

I am creating the module for Restaurant Management. I added the tabs like Table Booking, Orders, Kitchen Order Ticket(KOT)

where, Orders are taken and KOT is generated.

Now, I want to generate Invoice after generating KOT. I just want the value of TOTAL (amount_total) field on Orders tab should get invoiced and the TOTAL gets added. After that, It should creates Invoice on clicking the Generate Invoice Button.

Here is my code,

hotel_restaurant.py -------------------------------------------------------------------

class hotel_restaurant_order(osv.Model):

        def _sub_total(self, cr, uid, ids, field_name, arg, context=None):

        res = {}

        for sale in self.browse(cr, uid, ids, context=context):

            res[sale.id] = sum(line.price_subtotal for line in sale.order_list)

        return res

        def _total(self, cr, uid, ids, field_name, arg, context=None):

        res = {}

        for line in self.browse(cr, uid, ids, context=context):

        res[line.id] = line.amount_subtotal + (line.amount_subtotal * line.tax) / 100

        return res

        def generate_kot(self, cr, uid, ids, part):

        order_tickets_obj = self.pool.get('hotel.restaurant.kitchen.order.tickets')

        restaurant_order_list_obj = self.pool.get('hotel.restaurant.order.list')

        for order in self.browse(cr, uid, ids):

        table_ids = [x.id for x in order.table_no]

        kot_data = order_tickets_obj.create(cr, uid, {

        'orderno':order.order_no,

        'kot_date':order.o_date,

        'room_no':order.room_no.name,

        'w_name':order.waiter_name.name,

        'tableno':[(6, 0, table_ids)],

        })

        for order_line in order.order_list:

        o_line = {

        'kot_order_list':kot_data,

        'name':order_line.name.id,

        'item_qty':order_line.item_qty,

}

        restaurant_order_list_obj.create(cr, uid, o_line)

        return True


hotel_restaurant_view.xml------------------------------------------------------------------------

<!--

==============================

Table Order

==============================

-->

    <record model="ir.ui.view" id="view_hotel_restaurant_order_form">

        <field name="name">hotel_restaurant_order.form</field>

        <field name="model">hotel.restaurant.order</field>

        <field name="arch" type="xml">

            <form string="Order" version="7.0">

            <header>

                <button string="Generate KOT" name="generate_kot" type="object" icon="gtk-go-forward"/>

            </header>

            <sheet>

                <h1>

                    <label string="Table Order" colspan="4" />

                    <field name="order_no" colspan="4"/>

                </h1>

                <group>

                <group>

                    <field name="o_date" />

                </group>

                    <group colspan="2" col="4">

                    <field name="room_no"/>

                    <field name="waiter_name"/>

                    </group>

                    <newline/>

                   <separator colspan='4' string='Table List'/>

                    <field name="table_no" colspan="4" nolabel='1'/>

                    <newline/>

                   <separator colspan='4' string='Order List'/>

                    <field name="order_list" colspan="4" nolabel='1'>

                    <form string="Order List">

                   <group>

                   <field name="name" on_change="on_change_item_name(name)"/>

                   <field name="item_qty"/>

                <field name="item_rate"/>

                </group>

            </form>

            <tree string="Order List">

                <field name="name" />

                <field name="item_qty"/>

                <field name="item_rate"/>

                <field name="price_subtotal"/>

            </tree>

        </field>

    </group>    

<newline/>

         <group col="2" class="oe_subtotal_footer oe_right">

            <field name="amount_subtotal" widget="monetary"/>

            <field name="tax" widget='monetary'/>    

            <div class="oe_subtotal_footer_separator oe_inline">

            <label for="amount_total" />

            </div>

            <field name="amount_total" nolabel="1" widget='monetary'/>

        </group>

    <div class="oe_clear"/>

        </sheet>

     </form>

    </field>

</record>

    <record model="ir.ui.view" id="view_hotel_restaurant_order_tree">

    <field name="name">hotel_restaurant_order.tree</field>

    <field name="model">hotel.restaurant.order</field>

    <field name="arch" type="xml">

    <tree string="Order">

    <field name="order_no"/>

    <field name="o_date"/>

    <field name="table_no"/>

    <field name="room_no"/>

    <field name="waiter_name"/>

    <field name="order_list"/>

    </tree>

    </field>

</record>

    <record model="ir.actions.act_window" id="open_view_hotel_restaurant_order_form_tree">

        <field name="name">Order Generate</field>

        <field name="res_model">hotel.restaurant.order</field>

        <field name="view_type">form</field>

        <field name="view_mode">tree,form</field>

    </record>

        <menuitem name="Table Order"

        id="menu_open_view_hotel_restaurant_order_form_tree"

        action="open_view_hotel_restaurant_order_form_tree"

        sequence="11"

        parent="hotel_restaurant_menu"/>

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ść
change between 2 Invoice formats Rozwiązane
invoice
Awatar
Awatar
1
lip 25
1890
Hello, how can I change the size of the logo and the invoice? Rozwiązane
invoice
Awatar
Awatar
Awatar
2
lip 25
2385
Validation Error. You will need to clear the Journal Entry's Number to proceed
invoice
Awatar
Awatar
1
lip 25
3315
Restricting Salesperson Access to Customer Invoice Details
invoice
Awatar
Awatar
Awatar
3
kwi 25
3065
Odoo 16 - Download invoice preview doesn't work
invoice
Awatar
Awatar
Awatar
3
kwi 25
4119
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