11 changed files with 148 additions and 13 deletions
			
			
		@ -0,0 +1,32 @@ | 
				
			|||
# -*- coding: utf-8 -*- | 
				
			|||
############################################################################# | 
				
			|||
# | 
				
			|||
#    Cybrosys Technologies Pvt. Ltd. | 
				
			|||
# | 
				
			|||
#    Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			|||
#    Author: Sayooj A O (<https://www.cybrosys.com>) | 
				
			|||
# | 
				
			|||
#    You can modify it under the terms of the GNU LESSER | 
				
			|||
#    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | 
				
			|||
# | 
				
			|||
#    This program is distributed in the hope that it will be useful, | 
				
			|||
#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
#    GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | 
				
			|||
# | 
				
			|||
#    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | 
				
			|||
#    (LGPL v3) along with this program. | 
				
			|||
#    If not, see <http://www.gnu.org/licenses/>. | 
				
			|||
# | 
				
			|||
############################################################################# | 
				
			|||
from odoo import fields, models | 
				
			|||
 | 
				
			|||
 | 
				
			|||
class ResCompany(models.Model): | 
				
			|||
    """ | 
				
			|||
    Extends the 'res.company' model to include WhatsApp message template. | 
				
			|||
    """ | 
				
			|||
    _inherit = 'res.company' | 
				
			|||
 | 
				
			|||
    whatsapp_message = fields.Text(string="Message Template", | 
				
			|||
                                   help="whatsapp message template") | 
				
			|||
@ -0,0 +1,33 @@ | 
				
			|||
# -*- coding: utf-8 -*- | 
				
			|||
############################################################################# | 
				
			|||
# | 
				
			|||
#    Cybrosys Technologies Pvt. Ltd. | 
				
			|||
# | 
				
			|||
#    Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | 
				
			|||
#    Author: Sayooj A O (<https://www.cybrosys.com>) | 
				
			|||
# | 
				
			|||
#    You can modify it under the terms of the GNU LESSER | 
				
			|||
#    GENERAL PUBLIC LICENSE (LGPL v3), Version 3. | 
				
			|||
# | 
				
			|||
#    This program is distributed in the hope that it will be useful, | 
				
			|||
#    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
#    GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. | 
				
			|||
# | 
				
			|||
#    You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE | 
				
			|||
#    (LGPL v3) along with this program. | 
				
			|||
#    If not, see <http://www.gnu.org/licenses/>. | 
				
			|||
# | 
				
			|||
############################################################################# | 
				
			|||
from odoo import fields, models | 
				
			|||
 | 
				
			|||
 | 
				
			|||
class ResConfigSettings(models.TransientModel): | 
				
			|||
    """ | 
				
			|||
    Extends the 'res.config.settings' model to include additional configuration settings. | 
				
			|||
    """ | 
				
			|||
    _inherit = 'res.config.settings' | 
				
			|||
 | 
				
			|||
    whatsapp_message = fields.Text(string="Message Template", | 
				
			|||
                                   related='company_id.whatsapp_message', | 
				
			|||
                                   readonly=False) | 
				
			|||
| 
		 After Width: | Height: | Size: 143 KiB  | 
@ -0,0 +1,16 @@ | 
				
			|||
<?xml version="1.0" encoding="UTF-8" ?> | 
				
			|||
<odoo> | 
				
			|||
    <record id="res_company_view_form" model="ir.ui.view"> | 
				
			|||
        <field name="name"> | 
				
			|||
            res.company.view.form.inherit.whatsapp.mail.messaging | 
				
			|||
        </field> | 
				
			|||
        <field name="model">res.company</field> | 
				
			|||
        <field name="inherit_id" | 
				
			|||
               ref="base.view_company_form"/> | 
				
			|||
        <field name="arch" type="xml"> | 
				
			|||
            <xpath expr="//field[@name='country_id']" position="after"> | 
				
			|||
                <field name="whatsapp_message" invisible="1"/> | 
				
			|||
            </xpath> | 
				
			|||
        </field> | 
				
			|||
    </record> | 
				
			|||
</odoo> | 
				
			|||
@ -0,0 +1,31 @@ | 
				
			|||
<?xml version="1.0" encoding="UTF-8" ?> | 
				
			|||
<odoo> | 
				
			|||
    <record id="res_config_settings_view_form" model="ir.ui.view"> | 
				
			|||
        <field name="name"> | 
				
			|||
            res.config.settings.view.form.inherit.whatsapp.mail.messaging | 
				
			|||
        </field> | 
				
			|||
        <field name="model">res.config.settings</field> | 
				
			|||
        <field name="inherit_id" | 
				
			|||
               ref="base.res_config_settings_view_form"/> | 
				
			|||
        <field name="arch" type="xml"> | 
				
			|||
            <xpath expr="//div[@name='integration']" position="after"> | 
				
			|||
                <h2>Whatsapp</h2> | 
				
			|||
                        <div class="row mt16 o_settings_container" name="whatsapp_message"> | 
				
			|||
                            <div class="col-12 col-lg-6 o_setting_box" id="whatsapp_message_tempalte"> | 
				
			|||
                            <label for="whatsapp_message"/> | 
				
			|||
                            <field name="whatsapp_message" placeholder="Message..." widget="text_emojis"/> | 
				
			|||
                            <div class="text-muted"> | 
				
			|||
                                This WhatsApp message template is for sales orders and invoices. | 
				
			|||
                            </div> | 
				
			|||
                            </div> | 
				
			|||
                        </div> | 
				
			|||
<!--                <block title="Whatsapp" id="whatsapp_message">--> | 
				
			|||
<!--                    <setting--> | 
				
			|||
<!--                            help="This WhatsApp message template is for sales orders and invoices.">--> | 
				
			|||
<!--                        <field name="whatsapp_message" placeholder="Message..." widget="text_emojis"/>--> | 
				
			|||
<!--                    </setting>--> | 
				
			|||
<!--                </block>--> | 
				
			|||
            </xpath> | 
				
			|||
        </field> | 
				
			|||
    </record> | 
				
			|||
</odoo> | 
				
			|||
					Loading…
					
					
				
		Reference in new issue