Skip to content

Commit

Permalink
Added other info & data_inici default
Browse files Browse the repository at this point in the history
  • Loading branch information
susu105 committed Jan 10, 2022
1 parent c9924c9 commit b57e368
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def action_fraccionar_via_extralines(self, cursor, uid, ids, context=None):

factura_ids = context.get("active_ids")
factura_o = self.pool.get("giscedata.facturacio.factura")

user_o = self.pool.get("res.users")
data_final = (datetime.strptime(wiz.data_inici, "%Y-%m-%d") + timedelta(days=365*10)).strftime("%Y-%m-%d")

msgs = []
Expand All @@ -39,6 +39,13 @@ def action_fraccionar_via_extralines(self, cursor, uid, ids, context=None):
data_final, journal_id=wiz.journal_id.id,
amount=amount, context=context
)
other_info_head = '{} ({}): Fraccionament extralines en {} quotes.\n'.format(
datetime.now().strftime("%Y-%m-%d"),
[word[0] for word in user_o.read(cursor, uid, uid, ['name'])['name'].split(' ')],
wiz.ntermes
)
new_other_info = other_info_head + factura.other_info
factura.other_info = new_other_info

except Exception as e:
has_errors = True
Expand Down Expand Up @@ -66,6 +73,7 @@ def action_fraccionar_via_extralines(self, cursor, uid, ids, context=None):

_defaults = {
'first_term_payment': lambda *a: True,
'data_inici': lambda *a: (datetime.now() + timedelta(days=1)).strftime("%Y-%m-%d"),
}


Expand Down

0 comments on commit b57e368

Please sign in to comment.