Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
gen 24
12932
2
gen 25
1532
0
gen 24
2858
6
mag 19
15405
3
apr 19
6267