[18][FIX] account_financial_report : make aged report configuration working with multi-company
This commit is contained in:
@@ -1,14 +1,36 @@
|
|||||||
# Copyright 2023 Tecnativa - Carolina Fernandez
|
# Copyright 2023 Tecnativa - Carolina Fernandez
|
||||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||||
|
|
||||||
from odoo import fields, models
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
class ResConfigSettings(models.TransientModel):
|
class ResConfigSettings(models.TransientModel):
|
||||||
_inherit = "res.config.settings"
|
_inherit = "res.config.settings"
|
||||||
|
|
||||||
default_age_partner_config_id = fields.Many2one(
|
age_partner_config_id = fields.Many2one(
|
||||||
"account.age.report.configuration",
|
"account.age.report.configuration",
|
||||||
string="Intervals configuration",
|
string="Intervals configuration",
|
||||||
default_model="aged.partner.balance.report.wizard",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def set_values(self):
|
||||||
|
self.env["ir.default"].sudo().set(
|
||||||
|
"aged.partner.balance.report.wizard",
|
||||||
|
"age_partner_config_id",
|
||||||
|
self.age_partner_config_id.id,
|
||||||
|
company_id=self.env.company.id,
|
||||||
|
)
|
||||||
|
return super().set_values()
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def get_values(self):
|
||||||
|
res = super().get_values()
|
||||||
|
res.update(
|
||||||
|
age_partner_config_id=self.env["ir.default"]
|
||||||
|
.sudo()
|
||||||
|
.get(
|
||||||
|
"aged.partner.balance.report.wizard",
|
||||||
|
"age_partner_config_id",
|
||||||
|
company_id=self.env.company.id,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return res
|
||||||
|
|||||||
@@ -24,11 +24,11 @@
|
|||||||
<div class="content-group">
|
<div class="content-group">
|
||||||
<div class="row mt16">
|
<div class="row mt16">
|
||||||
<label
|
<label
|
||||||
for="default_age_partner_config_id"
|
for="age_partner_config_id"
|
||||||
class="col-lg-3 o_light_label"
|
class="col-lg-3 o_light_label"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="default_age_partner_config_id"
|
name="age_partner_config_id"
|
||||||
options="{'no_create_edit': True, 'no_open': True}"
|
options="{'no_create_edit': True, 'no_open': True}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user