Skip to Content
Menu
This question has been flagged

All I need to do is to add a checkbox in the settings of settings>configuration>sales.

This is the .py file:


from openerp import fields, models, _
class sale_quote_settings(models.TransientModel):
_name = 'sale.config.settings'
_inherit = 'sale.config.settings'
group_qty_warning_on_selected_wh = fields.Boolean(_('Qty warning on selected warehouse'),
group="", implied_group="",
required=True, default=True,
help=_("To restrict product count to the stock location of selected warehouse only, when making a quotation"))


this is the .xml file:


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


this is the error I get:


 2015-05-27 11:09:07,680 8124 INFO nemr werkzeug: 127.0.0.1 - - [27/May/2015 11:09:07] "POST /web/dataset/call_kw/sale.config.settings/fields_view_get HTTP/1.1" 200 -
2015-05-27 11:09:07,738 8124 ERROR nemr openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/home/hesham/odoo/openerp/http.py", line 536, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/hesham/odoo/openerp/http.py", line 573, in dispatch
    result = self._call_function(**self.params)
  File "/home/hesham/odoo/openerp/http.py", line 309, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/hesham/odoo/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/hesham/odoo/openerp/http.py", line 306, in checked_call
    return self.endpoint(*a, **kw)
  File "/home/hesham/odoo/openerp/http.py", line 802, in __call__
    return self.method(*args, **kw)
  File "/home/hesham/odoo/openerp/http.py", line 402, in response_wrap
    response = f(*args, **kw)
  File "/home/hesham/odoo/openerp/addons/web/controllers/main.py", line 937, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/hesham/odoo/openerp/addons/web/controllers/main.py", line 929, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/home/hesham/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/hesham/odoo/openerp/addons/sale_stock/res_config.py", line 64, in default_get
    res = super(sale_configuration, self).default_get(cr, uid, fields, context)
  File "/home/hesham/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/hesham/odoo/openerp/addons/sale/res_config.py", line 88, in default_get
    res = super(sale_configuration, self).default_get(cr, uid, fields, context)
  File "/home/hesham/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/hesham/odoo/openerp/addons/base/res/res_config.py", line 510, in default_get
    classified = self._get_classified_fields(cr, uid, context)
  File "/home/hesham/odoo/openerp/api.py", line 241, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/hesham/odoo/openerp/addons/base/res/res_config.py", line 498, in _get_classified_fields
    groups.append((name, map(ref, field_groups), ref(field.implied_group)))
  File "/home/hesham/odoo/openerp/addons/base/res/res_config.py", line 489, in ref
    mod, xml = xml_id.split('.', 1)
ValueError: need more than 1 value to unpack


What is wrong with my code?

Avatar
Discard
Best Answer

Error in line ... group="", implied_group=""

You define not empty groups, like ... group='base.group_user', implied_group='my.group'

See examples  


Avatar
Discard
Author

Thank you zbik. You are right.

Related Posts Replies Views Activity
6
Apr 23
36895
2
Apr 24
2536
1
May 15
4255
0
Mar 15
6202
1
Mar 15
5464