Add date choice for write-off on manual reconciliation
When we pay and reconcile an invoice, the date of payment is used as the write-off date, but when we reconcile manually with the wizard account/
There should be a date field for the write-off when we manually reconcile entries.
It is possible to do that with these new lines of code. I also add code to get the most recent date of the account move lines which should be the payment date. This date can still be changed in the reconcile form, it is just an extra.
--- /usr/lib/
+++ /usr/lib/
@@ -67,11 +67,11 @@
def _trans_
pool = pooler.
account_
-
form = data['form']
account_id = form.get(
period_id = form.get(
journal_id = form.get(
+ context['date_p'] = form.get('date_p', False)
account_
return {}
@@ -85,6 +85,7 @@
<form string="Information addendum">
<separator string="Write-Off Move" colspan="4"/>
<field name="journal_id"/>
+ <field name="date_p"/>
<field name="period_id"/>
<field name="writeoff_
</form>'''
@@ -93,6 +94,7 @@
'journal_id': {'string': 'Write-Off Journal', 'type': 'many2one', 'relation'
'period_id': {'string': 'Write-Off Period', 'type': 'many2one', 'relation'
'writeoff_
+ 'date_p': {'string'
}
def _trans_
@@ -101,7 +103,17 @@
period_id = False
if len(ids):
period_id = ids[0]
- return {'period_
+ #get the more recent date of the account.move.line selected
+ first = True
+ for ml in data['ids'] :
+ date_ml = pool.get(
+ if first :
+ first = False
+ date_p = date_ml
+ if not first :
+ if date_ml > date_p :
+ date_p = date_ml
+ return {'period_
class wiz_reconcile(
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by