跳至內容
選單
此問題已被標幟
1 回覆
11266 瀏覽次數

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?

頭像
捨棄
最佳答案

-- context = context.copy() 
++ context = self._context.copy()
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
2月 24
4616
1
1月 25
1247
0
7月 22
2352
3
9月 20
3021
2
3月 16
4380