mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-23 09:02:02 +02:00
19.0 vanilla
This commit is contained in:
parent
5df8c07b59
commit
daa394e8b0
2114 changed files with 564841 additions and 299642 deletions
35
odoo-bringout-oca-ocb-sms/sms/models/iap_account.py
Normal file
35
odoo-bringout-oca-ocb-sms/sms/models/iap_account.py
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models, _
|
||||
|
||||
|
||||
class IapAccount(models.Model):
|
||||
_inherit = 'iap.account'
|
||||
|
||||
sender_name = fields.Char(help="This is the name that will be displayed as the sender of the SMS.", readonly=True)
|
||||
|
||||
def action_open_registration_wizard(self):
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'name': _('Register Account'),
|
||||
'view_mode': 'form',
|
||||
'res_model': 'sms.account.phone',
|
||||
'context': {'default_account_id': self.id},
|
||||
}
|
||||
|
||||
def action_open_sender_name_wizard(self):
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'name': _('Choose your sender name'),
|
||||
'view_mode': 'form',
|
||||
'res_model': 'sms.account.sender',
|
||||
'context': {'default_account_id': self.id},
|
||||
}
|
||||
|
||||
def _get_account_info(self, account_id, balance, information):
|
||||
res = super()._get_account_info(account_id, balance, information)
|
||||
if account_id.service_name == 'sms':
|
||||
res['sender_name'] = information.get('sender_name')
|
||||
return res
|
||||
Loading…
Add table
Add a link
Reference in a new issue