Initial Port of customer statements
This commit is contained in:
committed by
Miquel Raïch
parent
1ffec3d4ee
commit
ad482b33d0
57
partner_statement/wizard/res_config_settings.py
Normal file
57
partner_statement/wizard/res_config_settings.py
Normal file
@@ -0,0 +1,57 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
group_activity_statement = fields.Boolean(
|
||||
"Enable OCA Activity Statements",
|
||||
group='account.group_account_invoice',
|
||||
implied_group='partner_statement.group_activity_statement',
|
||||
)
|
||||
|
||||
default_aging_type = fields.Selection(
|
||||
[("days", "Age by Days"), ("months", "Age by Months")],
|
||||
string="Aging Method",
|
||||
required=True,
|
||||
default_model="statement.common.wizard",
|
||||
)
|
||||
|
||||
default_show_aging_buckets = fields.Boolean(
|
||||
string="Show Aging Buckets",
|
||||
default_model="statement.common.wizard",
|
||||
)
|
||||
|
||||
default_filter_partners_non_due = fields.Boolean(
|
||||
string='Exclude partners with no due entries',
|
||||
default_model="statement.common.wizard",
|
||||
)
|
||||
|
||||
default_filter_negative_balances = fields.Boolean(
|
||||
"Exclude Negative Balances",
|
||||
default_model="statement.common.wizard",
|
||||
)
|
||||
|
||||
group_outstanding_statement = fields.Boolean(
|
||||
"Enable OCA Outstanding Statements",
|
||||
group='account.group_account_invoice',
|
||||
implied_group='partner_statement.group_outstanding_statement',
|
||||
)
|
||||
|
||||
def set_values(self):
|
||||
self = self.with_context(active_test=False)
|
||||
# default values fields
|
||||
IrDefault = self.env['ir.default'].sudo()
|
||||
for name, field in self._fields.items():
|
||||
if (name.startswith("default_") and
|
||||
field.default_model == 'statement.common.wizard'):
|
||||
if isinstance(self[name], models.BaseModel):
|
||||
if self._fields[name].type == 'many2one':
|
||||
value = self[name].id
|
||||
else:
|
||||
value = self[name].ids
|
||||
else:
|
||||
value = self[name]
|
||||
IrDefault.set('activity.statement.wizard', name[8:], value)
|
||||
IrDefault.set('outstanding.statement.wizard', name[8:], value)
|
||||
return super().set_values()
|
||||
Reference in New Issue
Block a user