[MIG] partner_statement: Migration to 17.0
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "Partner Statement",
|
||||
"version": "16.0.1.0.3",
|
||||
"version": "17.0.1.0.0",
|
||||
"category": "Accounting & Finance",
|
||||
"summary": "OCA Financial Reports",
|
||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
from odoo import _, models
|
||||
|
||||
from odoo.addons.report_xlsx_helper.report.report_xlsx_format import FORMATS
|
||||
from odoo.addons.report_xlsx_helper.report.report_xlsx_format import ( # type: ignore
|
||||
FORMATS,
|
||||
)
|
||||
|
||||
|
||||
def copy_format(book, fmt):
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
from odoo import _, models
|
||||
|
||||
from odoo.addons.report_xlsx_helper.report.report_xlsx_format import FORMATS
|
||||
from odoo.addons.report_xlsx_helper.report.report_xlsx_format import ( # type: ignore
|
||||
FORMATS,
|
||||
)
|
||||
|
||||
|
||||
def copy_format(book, fmt):
|
||||
|
||||
@@ -203,7 +203,7 @@ class ReportStatementCommon(models.AbstractModel):
|
||||
|
||||
def _get_bucket_dates(self, date_end, aging_type):
|
||||
return getattr(
|
||||
self, "_get_bucket_dates_%s" % aging_type, self._get_bucket_dates_days
|
||||
self, f"_get_bucket_dates_{aging_type}", self._get_bucket_dates_days
|
||||
)(date_end)
|
||||
|
||||
def _get_bucket_dates_days(self, date_end):
|
||||
@@ -262,7 +262,7 @@ class ReportStatementCommon(models.AbstractModel):
|
||||
|
||||
def _get_bucket_labels(self, date_end, aging_type):
|
||||
return getattr(
|
||||
self, "_get_bucket_labels_%s" % aging_type, self._get_bucket_dates_days
|
||||
self, f"_get_bucket_labels_{aging_type}", self._get_bucket_dates_days
|
||||
)(date_end)
|
||||
|
||||
def _get_bucket_labels_days(self, date_end):
|
||||
|
||||
@@ -42,5 +42,9 @@ class TestResConfigSettings(TransactionCase):
|
||||
self.assertTrue(
|
||||
self.user_obj._has_group("partner_statement.group_activity_statement")
|
||||
)
|
||||
res = self.env["ir.default"].get("activity.statement.wizard", "aging_type")
|
||||
self.assertEqual(res, "months")
|
||||
res = (
|
||||
self.env["activity.statement.wizard"]
|
||||
.with_context(active_ids=[1])
|
||||
.create({})
|
||||
)
|
||||
self.assertEqual(res.aging_type, "months")
|
||||
|
||||
@@ -6,84 +6,73 @@
|
||||
<field name="priority" eval="40" />
|
||||
<field name="inherit_id" ref="account.res_config_settings_view_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath
|
||||
expr="//div[@name='main_currency_setting_container']"
|
||||
position="after"
|
||||
>
|
||||
<h2>Partner Statements</h2>
|
||||
<div class="row mt16 o_settings_container" name="partner_statement">
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_activity_statement" />
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_activity_statement" />
|
||||
<div class="text-muted">
|
||||
Activity Statements show all transactions between two dates.
|
||||
<block id="print_vendor_checks_setting_container" position="after">
|
||||
<block title="Partner Statements">
|
||||
<setting
|
||||
id="group_activity_statement"
|
||||
string="Activity Statements"
|
||||
help="Activity Statements show all transactions between two dates."
|
||||
>
|
||||
<field name="group_activity_statement" />
|
||||
<div
|
||||
class="content-group"
|
||||
invisible="group_activity_statement == False and group_outstanding_statement == False"
|
||||
>
|
||||
<div class="row mt16">
|
||||
<label
|
||||
for="default_aging_type"
|
||||
class="col-lg-3 o_light_label"
|
||||
/>
|
||||
<field name="default_aging_type" />
|
||||
</div>
|
||||
<div
|
||||
class="content-group"
|
||||
attrs="{'invisible': [('group_activity_statement', '=', False), ('group_outstanding_statement', '=', False)]}"
|
||||
>
|
||||
<div class="row mt16">
|
||||
<label
|
||||
for="default_aging_type"
|
||||
class="col-lg-3 o_light_label"
|
||||
/>
|
||||
<field name="default_aging_type" />
|
||||
</div>
|
||||
<div>
|
||||
<field
|
||||
name="default_show_aging_buckets"
|
||||
class="oe_inline"
|
||||
/>
|
||||
<label
|
||||
for="default_show_aging_buckets"
|
||||
class="o_light_label"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<field
|
||||
name="default_filter_partners_non_due"
|
||||
class="oe_inline"
|
||||
/>
|
||||
<label
|
||||
for="default_filter_partners_non_due"
|
||||
class="o_light_label"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<field
|
||||
name="default_filter_negative_balances"
|
||||
class="oe_inline"
|
||||
/>
|
||||
<label
|
||||
for="default_filter_negative_balances"
|
||||
class="o_light_label"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<field
|
||||
name="default_show_aging_buckets"
|
||||
class="oe_inline"
|
||||
/>
|
||||
<label
|
||||
for="default_show_aging_buckets"
|
||||
class="o_light_label"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<field
|
||||
name="default_filter_partners_non_due"
|
||||
class="oe_inline"
|
||||
/>
|
||||
<label
|
||||
for="default_filter_partners_non_due"
|
||||
class="o_light_label"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<field
|
||||
name="default_filter_negative_balances"
|
||||
class="oe_inline"
|
||||
/>
|
||||
<label
|
||||
for="default_filter_negative_balances"
|
||||
class="o_light_label"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_outstanding_statement" />
|
||||
</setting>
|
||||
|
||||
<setting
|
||||
id="group_outstanding_statement"
|
||||
string="Outstanding Statement"
|
||||
help="Outstanding Statements show all transactions up to a date."
|
||||
>
|
||||
<field name="group_outstanding_statement" />
|
||||
<div
|
||||
class="text-muted"
|
||||
invisible="group_outstanding_statement == False"
|
||||
>
|
||||
Please set defaults under Activity Statements.
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_outstanding_statement" />
|
||||
<div class="text-muted">
|
||||
Outstanding Statements show all transactions up to a date.
|
||||
</div>
|
||||
<div
|
||||
class="text-muted"
|
||||
attrs="{'invisible': [('group_outstanding_statement', '=', False)]}"
|
||||
>
|
||||
Please set defaults under Activity Statements.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</setting>
|
||||
</block>
|
||||
</block>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -48,8 +48,9 @@
|
||||
<div style="text-align:justify" name="info">
|
||||
<span
|
||||
class="o_form_label"
|
||||
>Aging details can be shown in the report, expressed in aging
|
||||
buckets, so the partner can review how much is open, due or overdue.
|
||||
>Aging details can be shown in the report, expressed in
|
||||
aging
|
||||
buckets, so the partner can review how much is open, due or overdue.
|
||||
</span>
|
||||
</div>
|
||||
<hr />
|
||||
@@ -76,11 +77,11 @@
|
||||
<field name="number_partner_ids" readonly="1" invisible="1" />
|
||||
<field
|
||||
name="filter_partners_non_due"
|
||||
attrs="{'invisible': [('number_partner_ids', '=', 1)]}"
|
||||
invisible="number_partner_ids == 1"
|
||||
/>
|
||||
<field
|
||||
name="filter_negative_balances"
|
||||
attrs="{'invisible': [('number_partner_ids', '=', 1)]}"
|
||||
invisible="number_partner_ids == 1"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -91,21 +92,15 @@
|
||||
type="object"
|
||||
default_focus="1"
|
||||
class="oe_highlight"
|
||||
/>
|
||||
or
|
||||
<button
|
||||
/> or <button
|
||||
name="button_export_pdf"
|
||||
string="Export PDF"
|
||||
type="object"
|
||||
/>
|
||||
or
|
||||
<button
|
||||
/> or <button
|
||||
name="button_export_xlsx"
|
||||
string="Export XLSX"
|
||||
type="object"
|
||||
/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
/> or <button string="Cancel" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
@@ -119,10 +114,13 @@
|
||||
<xpath expr="//div[@name='info']/span" position="before">
|
||||
<span
|
||||
class="o_form_label"
|
||||
>The outstanding statement provides details of all partner's outstanding
|
||||
receivables and payables up to a particular date. This includes all unpaid invoices, unclaimed
|
||||
refunds and outstanding payments. The list is displayed in chronological order and is
|
||||
split by currencies.
|
||||
>The outstanding statement provides details of all partner's
|
||||
outstanding
|
||||
receivables and payables up to a particular date. This includes all unpaid
|
||||
invoices, unclaimed
|
||||
refunds and outstanding payments. The list is displayed in chronological order
|
||||
and is
|
||||
split by currencies.
|
||||
</span>
|
||||
<br />
|
||||
<br />
|
||||
@@ -139,8 +137,10 @@
|
||||
<span
|
||||
class="o_form_label"
|
||||
>The activity statement provides details of all activity on
|
||||
a partner's receivables and payables between two selected dates. This includes all invoices,
|
||||
refunds and payments. Any outstanding balance dated prior to the chosen statement
|
||||
a partner's receivables and payables between two selected dates. This includes
|
||||
all invoices,
|
||||
refunds and payments. Any outstanding balance dated prior to the chosen
|
||||
statement
|
||||
period will appear as a forward balance at the top of the statement. The list is
|
||||
displayed in chronological order and is split by currencies.
|
||||
</span>
|
||||
@@ -161,8 +161,10 @@
|
||||
<xpath expr="//div[@name='info']/span" position="before">
|
||||
<span
|
||||
class="o_form_label"
|
||||
>The detailed activity statement is an extension of the activity statement, and intends to explain the transactions
|
||||
that have happened during the period, also providing with a Prior Balance section and an Ending Balance section.
|
||||
>The detailed activity statement is an extension of the
|
||||
activity statement, and intends to explain the transactions
|
||||
that have happened during the period, also providing with a Prior Balance
|
||||
section and an Ending Balance section.
|
||||
</span>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user