Browse Source

[IMP] Link reconcile model instead just name

pull/503/head
Iryna Vyshnevska 6 years ago
parent
commit
50ef29e405
  1. 6
      account_financial_report_qweb/report/general_ledger.py
  2. 5
      account_financial_report_qweb/report/general_ledger_xlsx.py
  3. 14
      account_financial_report_qweb/report/templates/general_ledger.xml

6
account_financial_report_qweb/report/general_ledger.py

@ -186,6 +186,7 @@ class GeneralLedgerReportMoveLine(models.TransientModel):
# Data fields, used to keep link with real object # Data fields, used to keep link with real object
move_line_id = fields.Many2one('account.move.line') move_line_id = fields.Many2one('account.move.line')
matched_ml_id = fields.Many2one("account.full.reconcile")
# Data fields, used for report display # Data fields, used for report display
date = fields.Date() date = fields.Date()
@ -197,7 +198,6 @@ class GeneralLedgerReportMoveLine(models.TransientModel):
label = fields.Char() label = fields.Char()
cost_center = fields.Char() cost_center = fields.Char()
tags = fields.Char() tags = fields.Char()
matching_number = fields.Char()
debit = fields.Float(digits=(16, 2)) debit = fields.Float(digits=(16, 2))
credit = fields.Float(digits=(16, 2)) credit = fields.Float(digits=(16, 2))
cumul_balance = fields.Float(digits=(16, 2)) cumul_balance = fields.Float(digits=(16, 2))
@ -1067,6 +1067,7 @@ INSERT INTO
create_uid, create_uid,
create_date, create_date,
move_line_id, move_line_id,
matched_ml_id,
date, date,
entry, entry,
journal, journal,
@ -1075,7 +1076,6 @@ INSERT INTO
partner, partner,
label, label,
cost_center, cost_center,
matching_number,
debit, debit,
credit, credit,
cumul_balance, cumul_balance,
@ -1096,6 +1096,7 @@ SELECT
%s AS create_uid, %s AS create_uid,
NOW() AS create_date, NOW() AS create_date,
ml.id AS move_line_id, ml.id AS move_line_id,
fr.id AS matched_ml_id,
ml.date, ml.date,
m.name AS entry, m.name AS entry,
j.code AS journal, j.code AS journal,
@ -1139,7 +1140,6 @@ SELECT
query_inject_move_line += """ query_inject_move_line += """
CONCAT_WS(' - ', NULLIF(ml.ref, ''), NULLIF(ml.name, '')) AS label, CONCAT_WS(' - ', NULLIF(ml.ref, ''), NULLIF(ml.name, '')) AS label,
aa.name AS cost_center, aa.name AS cost_center,
fr.name AS matching_number,
ml.debit, ml.debit,
ml.credit, ml.credit,
""" """

5
account_financial_report_qweb/report/general_ledger_xlsx.py

@ -37,7 +37,10 @@ class GeneralLedgerXslx(abstract_report_xlsx.AbstractReportXslx):
8: {'header': _('Tags'), 8: {'header': _('Tags'),
'field': 'tags', 'field': 'tags',
'width': 10}, 'width': 10},
9: {'header': _('Rec.'), 'field': 'matching_number', 'width': 5},
9: {'header': _('Rec.'),
'field': 'matched_ml_id',
'type': 'many2one',
'width': 5},
10: {'header': _('Debit'), 10: {'header': _('Debit'),
'field': 'debit', 'field': 'debit',
'field_initial_balance': 'initial_debit', 'field_initial_balance': 'initial_debit',

14
account_financial_report_qweb/report/templates/general_ledger.xml

@ -336,8 +336,8 @@
<a t-att-data-active-id="line.move_line_id.move_id.id" <a t-att-data-active-id="line.move_line_id.move_id.id"
t-att-data-res-model="res_model" t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action underline-on-hover" class="o_account_financial_reports_web_action underline-on-hover"
style="color: black; cursor: pointer;">
<t t-raw="line.entry"/></a>
t-att-style="style">
<t t-att-style="style" t-raw="line.entry"/></a>
</span> </span>
</div> </div>
<!--## journal--> <!--## journal-->
@ -403,12 +403,12 @@
</t> </t>
<!--## matching_number--> <!--## matching_number-->
<div class="act_as_cell"> <div class="act_as_cell">
<t t-set="res_model" t-value="'account_full_reconcile'"/>
<span t-if="line.matching_number">
<a t-att-data-active-id="line.move_line_id.full_reconcile_id.id"
<t t-set="res_model" t-value="'account.full.reconcile'"/>
<span t-if="line.matched_ml_id">
<a t-att-data-active-id="line.matched_ml_id.id"
t-att-data-res-model="res_model" t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action underline-on-hover"
style="color: black; cursor: pointer;"><t t-raw="line.matching_number"/></a>
class="o_account_financial_reports_web_action underline-on-hover">
<t t-att-style="style" t-raw="line.matched_ml_id.name"/></a>
</span> </span>
</div> </div>
<!--## debit--> <!--## debit-->

Loading…
Cancel
Save