def create_membership_invoice(self, cr, uid, ids, product_id=None, datas=None, context=None):
# NOTE: use context to supply date_from to account_invoice_line.create
- ctx = context and context.copy() or {}
- ctx['date_from'] = datas.get('date_from', None)
+ context = context and context.copy() or {}
+ context['date_from'] = datas.get('date_from', None)
# XXX: copied from openerp/addons/membership/membership.py to fix account_invoice_line creation
print ("DEV: [remembership] [partner] [create_membership_invoice] ids=%s" % str(ids))
invoice_obj = self.pool.get('account.invoice')
and context['date_from']
and datetime.strptime(context['date_from'], "%Y-%m-%d")
or date.today())
- date_to = date_from + relativedelta(months = +12) # TODO: parameterize this delta?
+ date_to = date_from + relativedelta(days = +364) # TODO: parameterize this delta?
date_from = date_from.strftime("%Y-%m-%d")
date_to = date_to .strftime("%Y-%m-%d")
print ("DEV: [create] date_from: %s" % str(date_from))