Browse Source

Merge 97c77bd563 into 1ac8744ae8

pull/739/merge
Jordi Ballester Alomar 3 years ago
committed by GitHub
parent
commit
97ee8d44ef
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      account_financial_report_qweb/report/general_ledger.py
  2. 3
      account_financial_report_qweb/report/general_ledger_xlsx.py
  3. 24
      account_financial_report_qweb/report/open_items.py
  4. 17
      account_financial_report_qweb/report/open_items_xlsx.py
  5. 9
      account_financial_report_qweb/report/templates/general_ledger.xml
  6. 14
      account_financial_report_qweb/report/templates/open_items.xml
  7. 4
      account_financial_report_qweb/wizard/general_ledger_wizard.py
  8. 1
      account_financial_report_qweb/wizard/general_ledger_wizard_view.xml
  9. 4
      account_financial_report_qweb/wizard/open_items_wizard.py
  10. 1
      account_financial_report_qweb/wizard/open_items_wizard_view.xml

23
account_financial_report_qweb/report/general_ledger.py

@ -32,6 +32,7 @@ class GeneralLedgerReport(models.TransientModel):
hide_account_at_0 = fields.Boolean()
foreign_currency = fields.Boolean()
show_analytic_tags = fields.Boolean()
show_partial_reconciliations = fields.Boolean()
company_id = fields.Many2one(comodel_name='res.company')
filter_account_ids = fields.Many2many(comodel_name='account.account')
filter_partner_ids = fields.Many2many(comodel_name='res.partner')
@ -204,6 +205,28 @@ class GeneralLedgerReportMoveLine(models.TransientModel):
currency_id = fields.Many2one(comodel_name='res.currency')
amount_currency = fields.Float(digits=(16, 2))
# Display full or partial reconciliations
reconcile_string = fields.Char(
compute='_compute_reconcile', string='Reconcile')
partial_reconcile_ids = fields.Many2many(
comodel_name='account.partial.reconcile',
compute='_compute_reconcile',
string='Reconciliation move lines')
def _compute_reconcile(self):
for line in self:
ml = line.move_line_id
partial_recs = self.env['account.partial.reconcile']
if ml.full_reconcile_id:
rec_str = ml.full_reconcile_id.name
else:
rec_str = ', '.join([
'a%d' % pr.id for pr in
ml.matched_debit_ids + ml.matched_credit_ids])
partial_recs = ml.matched_debit_ids + ml.matched_credit_ids
line.reconcile_string = rec_str
line.partial_reconcile_ids = partial_recs
class GeneralLedgerReportCompute(models.TransientModel):
""" Here, we just define methods.

3
account_financial_report_qweb/report/general_ledger_xlsx.py

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

24
account_financial_report_qweb/report/open_items.py

@ -28,7 +28,7 @@ class OpenItemsReport(models.TransientModel):
company_id = fields.Many2one(comodel_name='res.company')
filter_account_ids = fields.Many2many(comodel_name='account.account')
filter_partner_ids = fields.Many2many(comodel_name='res.partner')
show_reconciliations = fields.Boolean()
# Data fields, used to browse report data
account_ids = fields.One2many(
comodel_name='report_open_items_qweb_account',
@ -129,6 +129,14 @@ class OpenItemsReportMoveLine(models.TransientModel):
# Data fields, used to keep link with real object
move_line_id = fields.Many2one('account.move.line')
# Display full or partial reconciliations
reconcile_string = fields.Char(
compute='_compute_reconcile', string='Reconcile')
partial_reconcile_ids = fields.Many2many(
comodel_name='account.partial.reconcile',
compute='_compute_reconcile',
string='Reconciliation move lines')
# Data fields, used for report display
date = fields.Date()
date_due = fields.Date()
@ -143,6 +151,20 @@ class OpenItemsReportMoveLine(models.TransientModel):
amount_total_due_currency = fields.Float(digits=(16, 2))
amount_residual_currency = fields.Float(digits=(16, 2))
def _compute_reconcile(self):
for line in self:
ml = line.move_line_id
partial_recs = self.env['account.partial.reconcile']
if ml.full_reconcile_id:
rec_str = ml.full_reconcile_id.name
else:
rec_str = ', '.join([
'a%d' % pr.id for pr in
ml.matched_debit_ids + ml.matched_credit_ids])
partial_recs = ml.matched_debit_ids + ml.matched_credit_ids
line.reconcile_string = rec_str
line.partial_reconcile_ids = partial_recs
class OpenItemsReportCompute(models.TransientModel):
""" Here, we just define methods.

17
account_financial_report_qweb/report/open_items_xlsx.py

@ -27,12 +27,13 @@ class OpenItemsXslx(abstract_report_xlsx.AbstractReportXslx):
3: {'header': _('Account'), 'field': 'account', 'width': 9},
4: {'header': _('Partner'), 'field': 'partner', 'width': 25},
5: {'header': _('Ref - Label'), 'field': 'label', 'width': 40},
6: {'header': _('Due date'), 'field': 'date_due', 'width': 11},
7: {'header': _('Original'),
6: {'header': _('Rec.'), 'field': 'reconcile_string', 'width': 11},
7: {'header': _('Due date'), 'field': 'date_due', 'width': 11},
8: {'header': _('Original'),
'field': 'amount_total_due',
'type': 'amount',
'width': 14},
8: {'header': _('Residual'),
9: {'header': _('Residual'),
'field': 'amount_residual',
'field_final_balance': 'final_amount_residual',
'type': 'amount',
@ -40,15 +41,15 @@ class OpenItemsXslx(abstract_report_xlsx.AbstractReportXslx):
}
if report.foreign_currency:
foreign_currency = {
9: {'header': _('Cur.'), 'field': 'currency_id',
'field_currency_balance': 'currency_id',
'type': 'many2one', 'width': 7},
10: {'header': _('Cur. Original'),
10: {'header': _('Cur.'), 'field': 'currency_id',
'field_currency_balance': 'currency_id',
'type': 'many2one', 'width': 7},
11: {'header': _('Cur. Original'),
'field': 'amount_total_due_currency',
'field_final_balance': 'final_amount_total_due_currency',
'type': 'amount_currency',
'width': 14},
11: {'header': _('Cur. Residual'),
12: {'header': _('Cur. Residual'),
'field': 'amount_residual_currency',
'field_final_balance': 'final_amount_residual_currency',
'type': 'amount_currency',

9
account_financial_report_qweb/report/templates/general_ledger.xml

@ -410,6 +410,15 @@
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 t-if="line.partial_reconcile_ids and not line.matched_ml_id and o.show_partial_reconciliations">
<t t-set="domain" t-value="[('id', 'in', line.partial_reconcile_ids.ids)]"/>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.partial.reconcile'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.reconcile_string"/>
</a>
</span>
</div>
<!--## debit-->
<div class="act_as_cell amount">

14
account_financial_report_qweb/report/templates/open_items.xml

@ -105,6 +105,10 @@
<!--## ref - label-->
<div class="act_as_cell" style="width: 25.5%;">Ref -
Label</div>
<t t-if="o.show_reconciliations">
<!--## rec - label-->
<div class="act_as_cell" style="width: 5.74%;">Rec.</div>
</t>
<!--## date_due-->
<div class="act_as_cell" style="width: 5.74%;">Due
date</div>
@ -160,6 +164,16 @@
</div>
<!--## ref - label-->
<div class="act_as_cell left"><span t-field="line.label"/></div>
<!--## rec.-->
<t t-if="o.show_reconciliations">
<t t-set="domain" t-value="[('id', 'in', line.partial_reconcile_ids.ids)]"/>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.partial.reconcile'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="line.reconcile_string"/>
</a>
</t>
<!--## date_due-->
<div class="act_as_cell left"><span t-field="line.date_due"/></div>
<!--## amount_total_due-->

4
account_financial_report_qweb/wizard/general_ledger_wizard.py

@ -85,6 +85,9 @@ class GeneralLedgerReportWizard(models.TransientModel):
comodel_name='account.analytic.tag',
string='Filter accounts',
)
show_partial_reconciliations = fields.Boolean(
string='Display partial reconciliations',
)
def _default_foreign_currency(self):
if self.env.user.has_group('base.group_multi_currency'):
@ -267,6 +270,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
'filter_analytic_tag_ids': [(6, 0, self.analytic_tag_ids.ids)],
'centralize': self.centralize,
'fy_start_date': self.fy_start_date,
'show_partial_reconciliations': self.show_partial_reconciliations,
}
def _export(self, report_type):

1
account_financial_report_qweb/wizard/general_ledger_wizard_view.xml

@ -25,6 +25,7 @@
<field name="hide_account_at_0"/>
<field name="foreign_currency"/>
<field name="show_analytic_tags"/>
<field name="show_partial_reconciliations"/>
</group>
</group>
<notebook>

4
account_financial_report_qweb/wizard/open_items_wizard.py

@ -53,6 +53,9 @@ class OpenItemsReportWizard(models.TransientModel):
'account currency is not setup through chart of accounts '
'will display initial and final balance in that currency.'
)
show_reconciliations = fields.Boolean(
string='Display reconciliations',
)
@api.onchange('company_id')
def onchange_company_id(self):
@ -153,6 +156,7 @@ class OpenItemsReportWizard(models.TransientModel):
'company_id': self.company_id.id,
'filter_account_ids': [(6, 0, self.account_ids.ids)],
'filter_partner_ids': [(6, 0, self.partner_ids.ids)],
'show_reconciliations': self.show_reconciliations,
}
def _export(self, report_type):

1
account_financial_report_qweb/wizard/open_items_wizard_view.xml

@ -18,6 +18,7 @@
<field name="target_move" widget="radio"/>
<field name="hide_account_at_0"/>
<field name="foreign_currency"/>
<field name="show_reconciliations"/>
</group>
</group>
<group name="partner_filter" col="1">

Loading…
Cancel
Save