Debian Codegraph @

addons/l10n_tw_edi_ecpay/models/res_company.py

raw
1 # Part of Odoo. See LICENSE file for full copyright and licensing details.
2
3 from odoo import fields, models
4
5
6 class ResCompany(models.Model):
7 _inherit = "res.company"
8
9 l10n_tw_edi_ecpay_staging_mode = fields.Boolean(string="Staging mode", groups="base.group_system")
10 l10n_tw_edi_ecpay_merchant_id = fields.Char(string="MerchantID", groups="base.group_system")
11 l10n_tw_edi_ecpay_hashkey = fields.Char(string="Hashkey", groups="base.group_system")
12 l10n_tw_edi_ecpay_hashIV = fields.Char(string="HashIV", groups="base.group_system")
13
14 def _is_ecpay_enabled(self):
15 return bool(self.sudo().l10n_tw_edi_ecpay_merchant_id
16 and self.sudo().l10n_tw_edi_ecpay_hashkey
17 and self.sudo().l10n_tw_edi_ecpay_hashIV)