Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Real Estate
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Consulting
    • Accounting Firm
    • Партнер Odoo
    • Marketing Agency
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Отримати демо
  • Ціни
  • Допомога

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

  • CRM
  • e-Commerce
  • Бухоблік
  • Склад
  • PoS
  • Проект
  • MRP
All apps
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

Create a button save for record on wizard - Odoov8

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
wizardsaveodooV8
2 Відповіді
10592 Переглядів
Аватар
Alberto

I've created a wizard with steps, of a model, in a custom module


Now, my problem is that in the 4th step, the workflow is finished, so I need to save all the fields filled, but I have no save button on my wizard


Is there a way I can do this by mantaining all the other fields of my wizard?

My wizard view:


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

            <field name="name">bsi.production.order.wizard</field>

            <field name="model">bsi.production.order</field>

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

                <form string="Production Order">

                  <field name="state" widget="statusbar" statusbar_visible="step1,step2,step3,step4" statusbar_colors='{"step3":"blue","step4":"blue"}' clickable="True" />

                      <group>

                        <group>

                          <field name="date_production" attrs="{'invisible': [('state', '!=', 'step1')]}" />

                          <field name="product_id" attrs="{'invisible': [('state', '!=', 'step1')]}" />

                          <field name="qty_available" attrs="{'invisible': [('state', '!=', 'step1')]}" />

                          <field name="isbn1" attrs="{'invisible': [('type_prod', '!=', 'direct')]}" />

                          <field name="isbn2" attrs="{'invisible': [('type_prod', '!=', 'direct')]}"/>

                          <field name="isbn3" attrs="{'invisible': [('type_prod', '!=', 'direct')]}"/>

                          <field name="isbn4" attrs="{'invisible': [('type_prod', '!=', 'direct')]}"/>

                          <field name="isbn5" attrs="{'invisible': [('type_prod', '!=', 'direct')]}"/>

                          <field name="isbn6" attrs="{'invisible': [('type_prod', '!=', 'direct')]}"/>

                        </group>

                        <group>

                          <field name="type_prod" attrs="{'invisible': [('state', '!=', 'step1')]}"/>

                          <field name="print_order2" attrs="{'invisible': [('type_prod', '!=', 'direct')]}" />

                          <field name="print_order2" attrs="{'invisible': [('type_prod', '!=', 'direct')]}"/>

                          <field name="print_order2" attrs="{'invisible': [('type_prod', '!=', 'direct')]}"/>

                          <field name="print_order2" attrs="{'invisible': [('type_prod', '!=', 'direct')]}"/>

                          <field name="print_order2" attrs="{'invisible': [('type_prod', '!=', 'direct')]}"/>

                          <field name="print_order2" attrs="{'invisible': [('type_prod', '!=', 'direct')]}"/>

                        </group>

                    </group>

                    <group>

                        <group string="Book Block" attrs="{'invisible': [('state', '!=', 'step2')]}">

                                <field name="name_block" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="category" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="language" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="edition" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="size" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="book_block_textp" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="n_pages_one_color" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="two_color" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="four_color" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="total" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="text_print_code" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="book_block_adpaper" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="adnl_n_pages_one_color" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="adnl_two_color" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="adnl_third_color" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="adnl_four_color" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="adnl_total" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="adnl_text_print_code" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="book_block_txtep" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="n_of_end_pages" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                        </group>

                        <group string="Book Size" attrs="{'invisible': [('state', '!=', 'step2')]}">

                                <field name="name_size" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="description_size" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="forme_size" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                                <field name="plate_size" attrs="{'invisible': [('state', '!=', 'step2')]}"/>

                        </group>

                    </group>

                    <group>

                        <group string="Book Edition" attrs="{'invisible': [('state', '!=', 'step3')]}">

                                <field name="name_edition" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                        </group>

                        <group string="Book Binding" attrs="{'invisible': [('state', '!=', 'step3')]}">

                                <field name="name_binding" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                        </group>

                        <group string="Cut Off" attrs="{'invisible': [('state', '!=', 'step3')]}">

                                <field name="name_cut" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                                <field name="description_cut" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                                <field name="cutoff_size" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                        </group>

                        <group string="Paper Master" attrs="{'invisible': [('state', '!=', 'step3')]}">

                                <field name="name_papermaster" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                                <field name="description_papermaster" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                                <field name="paper_type" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                                <field name="uom_papermaster" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                                <field name="gsm_papermaster" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                                <field name="std_cost_rate" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                                <field name="qty_in_kgs" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                                <field name="size_width" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                                <field name="size_height" attrs="{'invisible': [('state', '!=', 'step3')]}"/>

                        </group>

                    </group>

                    <group>

                        <group string="End Paper" attrs="{'invisible': [('state', '!=', 'step4')]}">

                                <field name="name_end_paper" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                                <field name="category_end_paper" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                                <field name="size_end_paper" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                        </group>

                        <group string="Printing Code" attrs="{'invisible': [('state', '!=', 'step4')]}">

                                <field name="description_code" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                                <field name="size_code" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                        </group>

                        <group string="Book Edge" attrs="{'invisible': [('state', '!=', 'step4')]}">

                                <field name="name_book_edge" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                        </group>

                        <group string="Job Rate" attrs="{'invisible': [('state', '!=', 'step4')]}">

                                <field name="name_jobrate" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                                <field name="binding" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                                <field name="size_binding_job_rate" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                                <field name="bind_variety" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                                <field name="rates" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                                <field name="addl_rate" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                                <field name="uptoforme" attrs="{'invisible': [('state', '!=', 'step4')]}"/>

                        </group>

                    </group>

            </form>

            </field>

        </record>


I just need it to be clickable and save the data on the table.

I saw some solution like this one:

<button string="Save" name="create" type="object"/>

But it doesn't works, so, any ideas?



0
Аватар
Відмінити
Аватар
DIlip Shyani
Найкраща відповідь

Hello Kristian,

You have mention name="create" ,  so you have to create "create method" in .py file of your wizard ,

tou have to write code inside that create method.


you have to write below code in form tags.

 <footer>

                        <button string="Save" class="oe_highlight"

                            name="create" type="object" />

                        or

                        <button string="Cancel" class="oe_highlight" special="cancel" />

        </footer>

1
Аватар
Відмінити
Аватар
Michel Alexis Valenzuela Orduño
Найкраща відповідь

<button string="Save" name="create" type="object"/>
▲▲▲That peace of code is ok. ▲▲▲

But you have to add the create function on your python code, just like if you want to overwrite it.

  • If you want to excecute more code before or after the create use this code:
    ####################
    @api.model
    def create(self, values):

             #Code before create
             record = super(your_model, self).create(values)
             #Code after create
             return record
    ####################

  • If you just want to execute the create function:
    ####################
    @api.model
    def create(self, values):

             return super(your_model, self).create(values)
    ####################



0
Аватар
Відмінити
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Реєстрація
Related Posts Відповіді Переглядів Дія
Prevent save model when clicking on a button that raises a wizard Вирішено
wizard save odooV8
Аватар
Аватар
Аватар
2
серп. 22
9829
how can i add default image to wizard?? Вирішено
wizard odooV8
Аватар
Аватар
Аватар
Аватар
3
черв. 19
5984
Wizard didn't refresh main page in Odoo v8 or new API
wizard odooV8
Аватар
1
бер. 15
7772
Close wizard after print report Вирішено
wizard report odooV8
Аватар
Аватар
Аватар
Аватар
3
лют. 24
13514
Launch a wizard with Save button
wizard button save
Аватар
Аватар
1
серп. 20
6085
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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 - це набір програм для роботи з відкритим кодом, які охоплюють всі ваші потреби компанії: CRM, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція 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