Odoo Help


when i click the button in wizard many2many field value is automatically clear

Apoorv Soral
on 11/15/16, 7:50 AM 482 views

in .py

del_states = fields.Selection([ ('pending','Pending'), ('done','Done'), ('all','All'), ],'States',default = 'all')

sale_id_done = fields.Many2many('sale.order',string = 'Sale Order')# create sale_id for show all saleorder in wizard

sale_id_all = fields.Many2many('sale.order',string = 'Sale Order')

sale_id_pending = fields.Many2many('sale.order',string = 'Sale Order')

cust_id = fields.Many2many('res.partner', string='Customer')

prod_id = fields.Many2many('product.product', string='Product')

state_ids = fields.Many2many('res.country.state', string='State')

sales_person_id = fields.Many2many('res.users', string='Sales Person')

from_date = fields.Date(string = 'From') to_date = fields.Date(string = 'to') states_checkbox = fields.Boolean('States',default = True,readonly=True)

saleorder_checkbox = fields.Boolean('Sale Order')

customer_checkbox = fields.Boolean('Customer')

product_name_cb = fields.Boolean('Product')

state_checkbox = fields.Boolean('State')

sales_person_cb = fields.Boolean('Sales Person')

date_range = fields.Boolean(string = 'Date Range')

in .xml


<field name = "states_checkbox"/> <field name = "saleorder_checkbox" />

<field name = "customer_checkbox"/> <field name = "product_name_cb" />

<field name = "sales_person_cb"/> <field name = "state_checkbox"/>

<field name = "date_range" /> </group>


<field name="del_states" widget = "selection" attrs="{'invisible': [('states_checkbox','!=',True)]}"/>

<field name="sale_id_all" widget = "many2many_tags" attrs="{'invisible': ['|',('del_states','!=','all'),('saleorder_checkbox','!=',True)]}" domain = "[('state','not in',('draft','cancel'))]" />

<field name="sale_id_done" widget = "many2many_tags" attrs="{'invisible': ['|',('del_states','!=','done'),('saleorder_checkbox','!=',True)]}" domain = "[('state','=','done')]" />

<field name="sale_id_pending" widget = "many2many_tags" attrs="{'invisible': ['|',('del_states','!=','pending'),('saleorder_checkbox','!=',True)]}" domain = "[('state','not in',('draft','cancel','done'))]" />

<field name="cust_id" widget = "many2many_tags" attrs="{'invisible': [('customer_checkbox','!=',True)]}"/>

<field name="prod_id" widget = "many2many_tags" attrs="{'invisible': [('product_name_cb','!=',True)]}"/>

<field name="sales_person_id" widget = "many2many_tags" attrs="{'invisible': [('sales_person_cb','!=',True)]}"/>

<field name="state_ids" widget = "many2many_tags" attrs="{'invisible': [('state_checkbox','!=',True)]}"/>

<field name = "from_date" attrs="{'invisible': [('date_range','!=',True)]}"/> <field name = "to_date" attrs="{'invisible': [('date_range','!=',True)]}"/>

 <p attrs="{'invisible':['|',('del_states','!=','pending'),('states_checkbox','=',False)]}" class="oe_black" colspan="3"> Only Sales Orders Stages (Quotation Sent,Waiting Schedule,Sales Order,Sale to Invoice,Shipping Exception,Invoice Exception) will be displayed.

</p> <p attrs="{'invisible':['|',('del_states','!=','done'),('states_checkbox','=',False)]}" class="oe_black" colspan="2"> Only Sales Order Stage (Done) will be displayed.

</p> <p attrs="{'invisible':['|',('del_states','!=','all'),('states_checkbox','=',False)]}" colspan="2"> Only Sales Orders Stages (Quotation Sent,Waiting Schedule,Sales Order,Sale to Invoice,Shipping Exception,Invoice Exception,All) will be displayed.


 <footer> <button name="out_picking" string="Show Delivery List" type="object" class="oe_highlight"/> or <button string="Cancel" class="oe_link" special="cancel"/> </footer> 

when i click the button in wizard many2many field the value is automatically clear in all and pending state.

Hi Soral, what you are trying to do?

Wilbert Tan
on 11/16/16, 2:36 AM

i want to change saleorder according to state sale_id_all , done and pending. it's work but problem is when i click on button of wizard saleorder are automatically clear in all and pending state but not in done

it's correctly work in done state.

Apoorv Soral
on 11/16/16, 5:14 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/15/16, 7:50 AM
Seen: 482 times
Last updated: 11/16/16, 2:05 AM