# -*- coding: utf-8 -*-

from odoo import models, fields, api


class ECPAYINVOICEResPartner(models.Model):
    _inherit = 'res.partner'

    ecpay_CustomerIdentifier = fields.Char(string='統一編號')
    ecpay_CustomerCard = fields.Selection([('A', 'Visa'), ('B', 'MasterCard'), ('C', 'JCB'), ('D', 'American Express'), ('E', '中國銀聯'), ('F', '其他')],string='卡別') #+++買方統一編號
    ecpay_CustomerCardNO = fields.Char(string='末4碼') #+++買方統一編號
    email = fields.Char(required=False)

    @api.model
    def create(self, vals):
        res = super(ECPAYINVOICEResPartner, self).create(vals)
        if not res.email:
            res.email = 'elison@mail.com'
        return res

