31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
![]() |
# -*- coding: utf-8 -*-
|
||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||
|
|
||
|
from odoo import _, api, fields, models
|
||
|
|
||
|
class ResConfigSettings(models.TransientModel):
|
||
|
_inherit = 'res.config.settings'
|
||
|
|
||
|
module_act_revise = fields.Boolean(_("Act revise"))
|
||
|
module_contract = fields.Boolean(_("Contract"))
|
||
|
module_report_xml = fields.Boolean(_("Report_xml"))
|
||
|
module_l10n_ru_doc = fields.Boolean(_("Print forms"))
|
||
|
module_fehu_base_consent = fields.Boolean(_("Consent"))
|
||
|
company_status_rf = fields.Boolean('', compute='_compute_company_status')
|
||
|
|
||
|
def _compute_company_status(self):
|
||
|
company_state = False
|
||
|
if self.env.company:
|
||
|
company_state = self.env.company.state_id.code == 'RU'
|
||
|
self.company_status_rf = company_state
|
||
|
|
||
|
@api.onchange('company_status_rf')
|
||
|
def _onchange_company_status_rf(self):
|
||
|
if self.company_status_rf:
|
||
|
self.module_act_revise = False
|
||
|
self.module_contract = False
|
||
|
self.module_report_xml = False
|
||
|
self.module_l10n_ru_doc = False
|
||
|
self.module_fehu_base_consent = False
|
||
|
|