Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

Form with tree inside. Problem with function fields.

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
functionformtree
1 Atsakyti
5532 Rodiniai
Portretas
Pau Ubach

I have a form A with a tree inside. When I click on "Add an item" I got a form B, where I can enter some information. Some of the fields in B are function and are calculated. 

When I create new item, everything is OK, functional fields are correctly updated.

But when I edit and change some values, when I save, the form B closes and the functional fields aren't updated on the tree in A form. 

If I click on the tree item to edit it, the fields in form B, also have the old values like the tree.

 

<record id="quotation_form" model="ir.ui.view">
            <field name="name">bdt.quotation.form</field>
            <field name="model">bdt.quotation</field>
            <field name="arch" type="xml">
                <form string="Quotation" version="7.0">
                    <header>
                        <div>
                            <button name="action_button_quot_to_customer" states="0" string="Send to Customer" class="oe_highlight" type="object"/>
                            <button name="action_button_quot_to_draft" states="1" string="Review" type="object"/> 
                            <button name="action_button_quot_won" states="1" string="Accepted" class="oe_highlight" type="object"/>
                            <button name="action_button_quot_lost" states="1" string="Rejected" class="oe_highlight" type="object"/> 
                            <field name="state" widget="statusbar"/>
                        </div>  
                    </header>
                    <sheet>
                        <!-- h1>
                            <label string="Customer "/>
                            <field name="cus_id"/>
                        </h1>
                        <h2>
                            <label string="Project "/>
                            <field name="pr_id" class="oe_inline"/>
                        </h2-->
                        <h2>
                            <label string="Quotation Name "/>
                            <field name="name" class="oe_inline"/>
                        </h2>
                        <group>
                            <group>
                                <field name="status_cust_reason"/>
                            </group>
                            <group>
                                <!-- field name="create_date"/-->
                            </group>
                        </group>
                        <notebook>
                            <page string="Forms">
                                <field name="q_form">
                                    <form string="Quotation Forms" version="7.0">
                                        <header>
                                            <div>
                                                <button name="action_button_form_to_review" states="0" string="Send for Revision" class="oe_highlight" type="object"/>
                                                <button name="action_button_form_approve" states="1" string="Approve" class="oe_highlight" type="object"/> 
                                                <button name="action_button_form_reject" states="1" string="Reject" class="oe_highlight" type="object"/>
                                                <button name="action_button_form_to_review" states="3" string="Send for Revision again" class="oe_highlight" type="object"/> 
                                                <button name="action_button_form_cancel" states="3" string="Cancel" class="oe_highlight" type="object"/> 
                                                <field name="state" widget="statusbar" statusbar_colors='{"4":"red","3":"orange","2":"green"}'/>
                                            </div> 
                                        </header>
                                        <h2>
                                            <label string="Quotation Form Name "/>
                                            <field name="name" class="oe_inline"/>
                                        </h2>
                                        <group>
                                            <group>
                                                <field name="amount" on_change="on_change_quot_field_data(amount,speed,hard,setup_price,price_min,profit_rate,sales_com)" />
                                                <field name="speed" on_change="on_change_quot_field_data(amount,speed,hard,setup_price,price_min,profit_rate,sales_com)" />
                                                <field name="hard" on_change="on_change_quot_field_data(amount,speed,hard,setup_price,price_min,profit_rate,sales_com)" />
                                                <field name="setup_price" on_change="on_change_quot_field_data(amount,speed,hard,setup_price,price_min,profit_rate,sales_com)" />
                                                <field name="price_min" on_change="on_change_quot_field_data(amount,speed,hard,setup_price,price_min,profit_rate,sales_com)" />
                                                <field name="profit_rate" on_change="on_change_quot_field_data(amount,speed,hard,setup_price,price_min,profit_rate,sales_com)" />
                                                <field name="sales_com" on_change="on_change_quot_field_data(amount,speed,hard,setup_price,price_min,profit_rate,sales_com)" />                                        
                                            </group>
                                            <group>
                                                <field name="calc_speed"/>
                                                <field name="calc_cost"/>
                                                <field name="calc_profit"/>
                                                <field name="calc_salescom"/>
                                                <field name="calc_price"/>
                                                <field name="calc_revenue"/>
                                            </group>
                                        </group>
                                    </form>
                                    <tree string="Sales Order Lines">
                                        <field name="amount" style="align:left"/>
                                        <field name="calc_speed" style="align:left"/>
                                        <field name="calc_cost"/>
                                        <field name="calc_profit"/>
                                        <field name="calc_salescom"/>
                                        <field name="calc_price"/>
                                        <field name="calc_revenue"/>
                                        <field name="state"/>
                                    </tree>
                                </field>
                            </page>
                        </notebook>
                    </sheet>
                </form>
            </field>
        </record>

0
Portretas
Atmesti
Portretas
Ludo - 21South
Best Answer

Might be very obvious, but did you also save form A? 

And if so: how did you make the tree view in form A? Perhaps you can post some code?

0
Portretas
Atmesti
Pau Ubach
Autorius

I have copied the view. Sorry, but I don't know how to copy code here in a better way to make it easier to read.

René Schuster

That was my first thought too: You have to save the most outer object (in your case Form A)!

Pau Ubach
Autorius

Thanks. Yes, I saved. Still same error.

Ludo - 21South

I can't see anything particularly wrong with that at first glance. Perhaps you can take a working example from an existing object that actually works (invoices come into mind) and base your view on that? Have you checked to see if the data on the database DOES change? What happens when you trigger an on_change on form B?

Pau Ubach
Autorius

For me, invoices has the same error. When I update quantity or price, amount and total aren't recalculated until I save.

Pau Ubach
Autorius

When I use an on_change function on form B, the information is updated in the form, but when I save, the functional fields aren't updated in the tree of form A. I need to save A, and then I can see the changes, but not before.

René Schuster

What you describe is the normal behaviour, Pau Ubach.

Pau Ubach
Autorius

Yes, I know, as it is how it happens in invoices, but being the normal behavior doesn't mean it is right behavior. In order of usability and machine-people interaction, the normal behavior should be as I describe.

Pau Ubach
Autorius

Yes, I know, as it is how it happens in invoices, but being the normal behavior doesn't mean it is right behavior. In order of usability and machine-people interaction, the normal behavior should be as I describe.

Ludo - 21South

I'm afraid there is nothing more we can do. If you want to change this you will need to dig pretty deep into the OpenERP core. Good luck with that.

Pau Ubach
Autorius

Yes. It will be hard and I don't have time now for it, so we will have to live with it. Thanks very much for your support.

Enjoying the discussion? Don't just read, join in!

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

Registracija
Related Posts Replies Rodiniai Veikla
Tree not showing "Add an item"
form tree
Portretas
Portretas
Portretas
Portretas
3
geg. 20
8383
One model, two forms and trees, how to set this up?
developement form tree
Portretas
Portretas
Portretas
3
bal. 24
2738
Make a boolean field editable in a tree view with the possibility of open a form view when clicking on a row ?? Solved
editable form tree
Portretas
Portretas
2
lapkr. 18
14159
How to use two specific views (tree and form view) when using ir.actions.act_window Solved
form tree ir.actions.act
Portretas
Portretas
2
kov. 16
8804
Create a Form View only for functions Solved
function form model
Portretas
Portretas
1
bal. 15
5461
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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