for res in self.read(cr, uid, ids, context=context):
- if res.get('open_close_periods', False) and res.get('date_start', False) and res.get('date_stop', False) and res.get('company_id', False):
- f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_id'])], context=context)
- if f_ids:
- fy_obj.create_period_special(cr, uid, [f_ids[0]])
+ if 'open_close_periods' in res and 'date_start' in res and 'date_stop' in res:
+ if res['open_close_periods']:
+ f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_id'])], context=context)
+ if f_ids:
+ fiscal_id = f_ids[0]
+ if fiscal_id:
+ fy_obj.create_period_special(cr, uid, [fiscal_id])
No me deja hacer commit que la rama es privada te pego aqui el diff:
=== modified file 'l10n_es_ pyme_account/ installer. py' pyme_account/ installer. py 2011-07-08 12:06:18 +0000 pyme_account/ installer. py 2011-07-08 12:09:32 +0000 ####### ####### ####### ####### ####### ####### ####### ####### ####### ####### ##
--- l10n_es_
+++ l10n_es_
@@ -23,8 +23,16 @@
#
######
+import time relativedelta import relativedelta
from datetime import datetime
+#from dateutil.
+#from operator import itemgetter
+
+from tools.translate import _
from osv import fields, osv
+import netsvc
+import tools
+
class account_ fiscalyear( osv.osv) : fiscalyear" get('account. fiscalyear' )
_name = "account.
@@ -91,9 +99,12 @@
fy_obj = self.pool.
for res in self.read(cr, uid, ids, context=context): 'open_close_ periods' , False) and res.get( 'date_start' , False) and res.get( 'date_stop' , False) and res.get( 'company_ id', False): id'])], context=context) create_ period_ special( cr, uid, [f_ids[0]]) periods' in res and 'date_start' in res and 'date_stop' in res: close_periods' ]: id'])], context=context) create_ period_ special( cr, uid, [fiscal_id])
- if res.get(
- f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_
- if f_ids:
- fy_obj.
+ if 'open_close_
+ if res['open_
+ f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_
+ if f_ids:
+ fiscal_id = f_ids[0]
+ if fiscal_id:
+ fy_obj.
account_ installer( )
\ No newline at end of file
Un saludo