[FIX] account: set reconciliation date as admin
The user performing reconciliations may not always have the right to update the corresponding partners, for example if a partner is also a system user. Doing it as super-user after verifying that the user is indeed allowed to reconcile journal items works around the problem. Fixes #11931
This commit is contained in:
parent
534b7c5553
commit
7cafe6a9c1
|
@ -22,6 +22,7 @@
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from openerp import SUPERUSER_ID
|
||||||
from openerp.osv import fields, osv
|
from openerp.osv import fields, osv
|
||||||
|
|
||||||
class account_fiscal_position(osv.osv):
|
class account_fiscal_position(osv.osv):
|
||||||
|
@ -186,7 +187,8 @@ class res_partner(osv.osv):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def mark_as_reconciled(self, cr, uid, ids, context=None):
|
def mark_as_reconciled(self, cr, uid, ids, context=None):
|
||||||
return self.write(cr, uid, ids, {'last_reconciliation_date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
|
self.pool['account.move.reconcile'].check_access_rights(cr, uid, 'write')
|
||||||
|
return self.write(cr, SUPERUSER_ID, ids, {'last_reconciliation_date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'credit': fields.function(_credit_debit_get,
|
'credit': fields.function(_credit_debit_get,
|
||||||
|
|
Loading…
Reference in New Issue