This question has been flagged
1 Reply
10023 Views

Hello,

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()
context.update(self._context)
context.update({
  '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',
'Periods'),
'invoice_ids': fields.one2many('account.invoice', 'contract_id',
'Invoices', readonly=True),
'product_ids': one2many_mod('product.product', 'contract_id',
'Products'),

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

 Any ideas how to resolve it?

Avatar
Discard
Best Answer

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