def _centralise(self, cr, uid, move, mode, context=None):
assert mode in ('debit', 'credit'), 'Invalid Mode' #to prevent sql injection
- currency_obj = self.pool.get('res.currency')
+ currency_obj = self.pool.get('res.currency')
if context is None:
context = {}
(parent_ids,) + where_params)
res=dict(cr.fetchall())
obj_precision = self.pool.get('decimal.precision')
- res2 = {}
+ res2 = {}
for record in self.browse(cr, uid, ids, context=context):
def _rec_get(record):
amount = res.get(record.id, 0.0)
period_id = period_id[0]
for model in self.browse(cr, uid, ids, context=context):
- entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
+ entry['name'] = model.name%{'year':context.get('date',time.strftime('%Y')), 'month':context.get('date',time.strftime('%m')), 'date':context.get('date',time.strftime('%d'))}
move_id = account_move_obj.create(cr, uid, {
'ref': entry['name'],
'period_id': period_id,
'analytic_account_id': analytic_account_id
}
- date_maturity = time.strftime('%Y-%m-%d')
+ date_maturity = context.get('date',time.strftime('%Y-%m-%d'))
if line.date_maturity == 'partner':
if not line.partner_id:
raise osv.except_osv(_('Error !'), _("Maturity date of entry line generated by model line '%s' of model '%s' is based on partner payment term!" \