Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profit organisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Odoo 8 - wizard cannot sent back editable input after submit

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
wizardodooV8odoo8.0odoo8
1 Beantwoorden
4311 Weergaven
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
Annuleer
Avatar
Salim Rahal
Auteur Beste antwoord

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
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Return a wizard
wizard odoo odooV8 odoo8.0 odoo8
Avatar
Avatar
1
mei 16
8976
High Availability Odoo 8.0 on Windows
odooV8 odoo8.0 odoo8
Avatar
0
feb. 21
4501
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
4355
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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