Skip to Content
Menu
This question has been flagged
2266 Views

I just added a new field in the Sales Order model, named "Base Amount without Tax". It's type is float, and it was added via Configuration->Database Structure->Models.

When I try to use it as a Measure in the Graph View, it's shown blank, without any value. What do I have to do so I can use this field as an accumulated measure in Graph View? 

Here is an example of the Graph View:



Base amount without Taxes
Total
Total

15,000.00
  Customer 1

5,000.00
  Customer 2

3,000.00
  Customer 3

7,000.00



Avatar
Discard

Hugo, Did you make sure the field contains value for it? Also, make sure to display on sale order just for assurance. If the value is stored in DB, you should be able to see. In a better practice, its always better to use a module rather than adding a field via GUI. Thanks.

Author

Hi, the field has values in the DB, and I can see it in the Sales Order, but for some reason is not been showed in the Graph View.

Also, If I want to use this field as an accumulated field in a Gamification Goal Definition, I get the following error when I try to activate the Challenge related to it:

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 530, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 567, in dispatch

result = self._call_function(**self.params)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 303, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 300, in checked_call

return self.endpoint(*a, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 796, in __call__

return self.method(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 396, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 939, in call_button

action = self._call_kw(model, method, args, {})

File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 927, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/gamification/models/challenge.py", line 375, in action_start

return self.write(cr, uid, ids, {'state': 'inprogress'}, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/gamification/models/challenge.py", line 243, in write

self._generate_goals_from_challenge(cr, uid, ids, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/gamification/models/challenge.py", line 472, in _generate_goals_from_challenge

goal_obj.update(cr, uid, to_update, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/gamification/models/goal.py", line 393, in update

new_value = res and res[0][field_name] or 0.0

KeyError: u'x_MontoBaseSinImpuesto'

Author

Hi, I just solved the situation. Apparently the name of the field was too long, so it presented some internal problems in ODOO. I created a new field, named x_mbase, and is working perfectly in the Graph View and in Challenges. Best regards!