Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Odoo 8 - wizard cannot sent back editable input after submit

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
wizardodooV8odoo8.0odoo8
1 Răspunde
4326 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Salim Rahal
Autor Cel mai bun răspuns

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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Return a wizard
wizard odoo odooV8 odoo8.0 odoo8
Imagine profil
Imagine profil
1
mai 16
8980
High Availability Odoo 8.0 on Windows
odooV8 odoo8.0 odoo8
Imagine profil
0
feb. 21
4507
Product received Administrator in Odoo 8 purchase module
odooV8 odoo8.0 odoo8
Imagine profil
0
feb. 18
3267
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
Imagine profil
Imagine profil
Imagine profil
3
iun. 17
6630
Values are reset on save
odooV8 odoo8.0 odoo8
Imagine profil
0
ian. 16
4361
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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