Code review comment for lp:~angelmoya/openerp-spain/domatix_special_periods

Revision history for this message
Omar (Pexego) (omar7r) wrote :

No me deja hacer commit que la rama es privada te pego aqui el diff:

=== modified file 'l10n_es_pyme_account/installer.py'
--- l10n_es_pyme_account/installer.py 2011-07-08 12:06:18 +0000
+++ l10n_es_pyme_account/installer.py 2011-07-08 12:09:32 +0000
@@ -23,8 +23,16 @@
 #
 ##############################################################################

+import time
 from datetime import datetime
+#from dateutil.relativedelta import relativedelta
+#from operator import itemgetter
+
+from tools.translate import _
 from osv import fields, osv
+import netsvc
+import tools
+

 class account_fiscalyear(osv.osv):
     _name = "account.fiscalyear"
@@ -91,9 +99,12 @@
         fy_obj = self.pool.get('account.fiscalyear')

         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])

 account_installer()
\ No newline at end of file

Un saludo

review: Approve

« Back to merge proposal