mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
Merge pull request #117 from akretion/7.0-account_auto_fy_seq-bug-113
7.0 [FIX] Bug #113 in account_auto_fy_sequence: sequence now created with SUPERUSER_ID
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import orm
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp.tools.translate import _
|
||||
|
||||
FY_SLOT = '%(fy)s'
|
||||
@@ -36,7 +37,7 @@ class Sequence(orm.Model):
|
||||
def _create_fy_sequence(self, cr, uid, seq, fiscalyear, context=None):
|
||||
""" Create a FY sequence by cloning a sequence
|
||||
which has %(fy)s in prefix or suffix """
|
||||
fy_seq_id = self.create(cr, uid, {
|
||||
fy_seq_id = self.create(cr, SUPERUSER_ID, {
|
||||
'name': seq.name + ' - ' + fiscalyear.code,
|
||||
'code': seq.code,
|
||||
'implementation': seq.implementation,
|
||||
@@ -50,7 +51,7 @@ class Sequence(orm.Model):
|
||||
'company_id': seq.company_id.id,
|
||||
}, context=context)
|
||||
self.pool['account.sequence.fiscalyear']\
|
||||
.create(cr, uid, {
|
||||
.create(cr, SUPERUSER_ID, {
|
||||
'sequence_id': fy_seq_id,
|
||||
'sequence_main_id': seq.id,
|
||||
'fiscalyear_id': fiscalyear.id,
|
||||
|
||||
Reference in New Issue
Block a user