Skip to Content
Menu
This question has been flagged

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>
Avatar
Discard
Related Posts Replies Views Activity
2
Jan 24
11676
0
Jan 24
1979
6
May 19
14271
3
Apr 19
5350
2
Jun 17
5350