add cenhomes addons
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import controllers
|
||||
from . import models
|
||||
@@ -0,0 +1,40 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
{
|
||||
'name': "SMS test",
|
||||
|
||||
'summary': """
|
||||
Module Cen Academy for students""",
|
||||
|
||||
'description': """
|
||||
|
||||
""",
|
||||
|
||||
'author': "Cenhomes",
|
||||
'website': "https://www.cenhomes.vn",
|
||||
|
||||
# Categories can be used to filter modules in modules listing
|
||||
# Check https://github.com/odoo/odoo/blob/16.0/odoo/addons/base/data/ir_module_category_data.xml
|
||||
# for the full list
|
||||
'category': 'Uncategorized',
|
||||
'version': '0.1',
|
||||
|
||||
# any module necessary for this one to work correctly
|
||||
'depends': ['base', 'web', 'sms',
|
||||
],
|
||||
|
||||
# always loaded
|
||||
'data': [
|
||||
'views/sms_custom.xml',
|
||||
'views/sms_template.xml',
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_common': [
|
||||
('prepend', 'cenhomes_student/static/src/css/css_file.css'),
|
||||
],
|
||||
'web.assets_backend': [
|
||||
'cenhomes_student/static/src/components/**/*',
|
||||
'cenhomes_student/static/src/views/**/*',
|
||||
'cenhomes_student/static/src/xml/**/*',
|
||||
],
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
||||
@@ -0,0 +1,43 @@
|
||||
from odoo import models
|
||||
|
||||
|
||||
class CustomPartner(models.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
def xxxxxx(self):
|
||||
record_url = f"https://cenhomes.vn"
|
||||
client_action = {
|
||||
'name': 'Send zalo ZNS',
|
||||
'view_mode': 'form',
|
||||
'view_id': self.env.ref('custom_sms.custom_sms_form_tiennv').id,
|
||||
'res_model': 'sms.composer',
|
||||
# 'res_id': self.id,
|
||||
# 'views': [(False, "form")],
|
||||
'target': 'new',
|
||||
'type': 'ir.actions.act_window',
|
||||
'context': {
|
||||
'default_res_model': 'res.partner',
|
||||
'default_res_id': self.id,
|
||||
'default_composition_mode': 'comment',
|
||||
'default_number_field_name': 'mobile' if self.mobile else 'phone',
|
||||
}
|
||||
}
|
||||
# type ir.actions.act_window,
|
||||
# target: "new",
|
||||
# name: this.title,
|
||||
# res_model: "sms.composer",
|
||||
# views: [[false, "form"]],
|
||||
# context: {
|
||||
# ...this.user.context,
|
||||
# default_res_model: this.props.record.resModel,
|
||||
# default_res_id: this.props.record.resId,
|
||||
# default_number_field_name: this.props.name,
|
||||
# default_composition_mode: 'comment',
|
||||
return client_action
|
||||
|
||||
|
||||
class SMSComposerCustom(models.TransientModel):
|
||||
_inherit = 'sms.composer'
|
||||
|
||||
def action_send_sms_zns(self):
|
||||
print(11111)
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="custom_sms_form_tiennv" model="ir.ui.view">
|
||||
<field name="name">sms.composer.views.inherit.sms_custom</field>
|
||||
<field name="model">sms.composer</field>
|
||||
<field name="inherit_id" ref="sms.sms_composer_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='composition_mode']" position="after">
|
||||
<field name="res_id"/>
|
||||
</xpath>
|
||||
<xpath expr="//footer//button[@name='action_send_sms']" position="replace">
|
||||
<button string="Send SMS ZNS" type="object" class="oe_highlight" name="action_send_sms_zns" data-hotkey="q"
|
||||
attrs="{'invisible': ['|',('composition_mode', 'not in', ('comment', 'numbers')),('recipient_single_valid', '=', False)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1,16 @@
|
||||
<odoo>
|
||||
<!-- <data>-->
|
||||
<!-- <t t-name="sms.SendSMSButton.custom" t-inherit="sms.SendSMSButton" t-inherit-mode="primary">-->
|
||||
<!-- <xpath expr="//a" position="after">-->
|
||||
<!-- <a-->
|
||||
<!-- t-att-title="title"-->
|
||||
<!-- t-att-href="phoneHref"-->
|
||||
<!-- t-on-click.prevent.stop="onClick"-->
|
||||
<!-- class="ms-3 d-inline-flex align-items-center o_field_phone_sms">-->
|
||||
<!-- <i class="fa fa-mobile"></i>-->
|
||||
<!-- <small class="fw-bold ms-1">SMS ZNS</small>-->
|
||||
<!-- </a>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </t>-->
|
||||
<!-- </data>-->
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user