Odoo Help


This community 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.


Update context values in Odoo version 8

Djordje Marjanovic
on 4/21/15, 8:18 AM 2,525 views


I am trying to upgrade 'contract_customer_invoice' module that adds new field relations in analytic account (contract) from version 7 to version 8. Lines of code that result in error (NotImplementedError: 'update' not supported on frozendict) are in bold.

class one2many_mod(fields.one2many):
def get(self, cr, obj, ids, name, user=None,
offset=0, context=None, values=None):
if context is None:
context = {}
if self._context:
context = context.copy()
  'default_active': False,
  'active_test': False,
return super(one2many_mod, self.with_context(default_active=False,active_test=False)).\
get(cr, obj, ids, name, user=user,
offset=offset, context=context, values=values)

class account_analytic_account(orm.Model):
_inherit = 'account.analytic.account'
_columns = {
'active': fields.boolean('Active'),
'client_num': fields.char('Client Number', size=64),
'period_ids': fields.one2many('period.contract', 'contract_id',
'invoice_ids': fields.one2many('account.invoice', 'contract_id',
'Invoices', readonly=True),
'product_ids': one2many_mod('product.product', 'contract_id',

'sap_number': fields.char('SAP Number', size=64),
'payment_term_id': fields.many2one('account.payment.term', 'Payment Term'),

 Any ideas how to resolve it?



| 6 5 7
Tbilisi, Georgia
On 4/21/15, 8:58 AM

-- context = context.copy() 
++ context = self._context.copy()

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 4/21/15, 8:18 AM
Seen: 2525 times
Last updated: 4/21/15, 9:33 AM