Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Odoo 8 - wizard cannot sent back editable input after submit

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
wizardodooV8odoo8.0odoo8
1 Svar
4310 Visninger
Avatar
Salim Rahal

I'm trying to validate an editable input defined in an object with many2many relationship with a Wizard, but the new value is not received when I have one item in the list. Whereas when the list is more then one item, all new values are received in backend except the last item!

The Scenario is:

case-1: when I have ONE item in list

1- when I open the Wizard and I hit on a button (fill_product_category) it fills the list of product category in the tree view

2- insert data in the new_price (editable input)

3- hit the compute_result button

4- the updated parameter is not received in the backend, the id of the item is kept normally

5- the wizard is not refreshed with the new value for editable input (it's normal since it's not sent at first submit)

case-2: when I have MORE than one item in the list of products:

- After inserting values in the editable fields and hitting compute_result-> all updated values are received except the last item

Explanation:

-Hitting the button will build a list of product category in Backend and then assign it to the Wizard-Hitting the compute_result will call the backend function and retrieve the list of product-inside this function I iterate thru products and fetch the new_price, I need to know how to edit and submit accordingly an input in wizard

thank you,

1- The Wizard includs one2many relationship

  class wizard(models.TransientModel):

    _name = 'simulator.wizard'

    y_product_category_disc_ids = fields.many2many("category.model", "id",string="Product Category")

  class CategoryModel(models.Model):

       _name = "category.model"

        y_product = fields.Char(string="Product Cat",readonly=True)

       new_price= fields.Integer(string="New Price")

 

2- Snippet of the Wizard Data file

       <field name="y_product_category_disc_ids">

<tree string="Product Category Tree" editable="true">

<field name="y_product"/> <field name="new_price"/> </tree> </field>

<button name="fill_product_category" string="Fill product category" type="object" />

3- function that handle the button fill_product_category

@api.multi def fill_product_category(self):

    self.ensure_one()

    res_record1 = self.env["purchase.product.categorydisc"].\

   create({"y_product": p1,"new_price":0 })

  listProdIds.append(res_record1.id)

  #adding the second product can be omitted in order to add only one item to wizard

  res_record2 = self.env["purchase.product.categorydisc"].\

 create({"y_product": p2, "new_price":0})

  listProdIds.append(res_record2.id)


self.y_product_category_disc_ids = listProdIds

return {

'context': self.env.context,

'view_type': 'form',

'view_mode': 'form',

'res_model': 'simulator.wizard',

'res_id': self.id, 'view_id': False,

'type': 'ir.actions.act_window',

'target': 'new',

}

4- function that receives the new prices per items and make computation, where new_price is not received for first item

@api.multi def compute_result(self):

         self.ensure_one()

       product_category_disc_ids = self.y_product_category_disc_ids

       for prod in product_category_disc_ids:

             print("compute_result prod category={} new price={}").format(prod.y_product, prod.new_price)

  return {

   'context': self.env.context,

    'view_type': 'form',

   'view_mode': 'form',

  'res_model': 'simulator.wizard',

  'res_id': self.id, 'view_id': False,

 'type': 'ir.actions.act_window',

  'target': 'new',

  }

0
Avatar
Kassér
Avatar
Salim Rahal
Forfatter Bedste svar

My solution is to follow what is feasible in Odoo-8 framework, hence I omitted the use of a datatable within a Wizard , on the otherhand I have added the Datatable within a tab (example of a Sales order editable lines). and it works.

0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Return a wizard
wizard odoo odooV8 odoo8.0 odoo8
Avatar
Avatar
1
maj 16
8976
High Availability Odoo 8.0 on Windows
odooV8 odoo8.0 odoo8
Avatar
0
feb. 21
4498
Product received Administrator in Odoo 8 purchase module
odooV8 odoo8.0 odoo8
Avatar
0
feb. 18
3266
blockUI requires jQuery v1.2.3 or later! You are using v1.11.1 error when installing Odoo 8 on Windows 10
odooV8 odoo8.0 odoo8
Avatar
Avatar
Avatar
3
jun. 17
6626
Values are reset on save
odooV8 odoo8.0 odoo8
Avatar
0
jan. 16
4352
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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