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