Odoo Help

0

new checkbox in sales configuration settings not updated to DB

By
Hesham ELMAHDY
on 5/27/15, 8:15 PM 962 views

Added an option checkbox to settings>configuration>sale view. But when click and checkbox (make it checked) and then hit the Apply button, the checkbox becomes unchecked. The value `True` is not saved to the database. I reviewed my code and compared it to similar code and could not find any difference, except that my config class is using models.TransientModel but everything else in odoo is still using osv.osv_memory. Hence, the code is practically identical; then why is this happening?


Also, I noticed that every time I check and un-check any other checkbox, a new row is inserted in the relative table xxx.config.settings; where xxx is any model that has a config.settings table. Is this a normal behavior? Shouldn't it be just one row that holds the settings for the model?


Here is the code:

 from openerp import fields, models, _


class sale_quote_settings(models.TransientModel):
_name = 'sale.config.settings'
_inherit = 'sale.config.settings'

group_no_warning_on_wh_qty = fields.Boolean(_('No warning on selected warehouse qty'),
group="group_no_warning_on_wh_qty",
# implied_group="sale.group_no_warning_on_wh_qty",
# required=True, #default=False,
help=_(
"To unrestrict qty count to selected warehouse location only, when making a quotation"))


 <?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="odootec_view_sale_config" model="ir.ui.view">
<field name="name">odootec.sale.config.settings</field>
<field name="model">sale.config.settings</field>
<field name="inherit_id" ref="sale.view_sales_config"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='warehouse_features']" position="inside">
<div>
<field name="group_no_warning_on_wh_qty" class="oe_inline"/>
<label for="group_no_warning_on_wh_qty"/>
</div>
</xpath>
</field>
</record>
</data>
</openerp>

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.

Register

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)

Stats

Asked: 5/27/15, 8:15 PM
Seen: 962 times
Last updated: 5/27/15, 8:15 PM