Odoo Help


Update context values in Odoo version 8

Djordje Marjanovic
on 4/21/15, 8:18 AM 4,232 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?

On 4/21/15, 8:58 AM

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

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


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