19 changed files with 151 additions and 109 deletions
			
			
		| @ -0,0 +1,32 @@ | |||||
|  | # -*- coding: utf-8 -*- | ||||
|  | ############################################################################# | ||||
|  | # | ||||
|  | #    Cybrosys Technologies Pvt. Ltd. | ||||
|  | # | ||||
|  | #    Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | ||||
|  | #    Author: Cybrosys Techno Solutions(<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) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) | ||||
|  | #    Author: Cybrosys Techno Solutions(<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) | ||||
| @ -1,9 +0,0 @@ | |||||
| from odoo import fields, models |  | ||||
| 
 |  | ||||
| 
 |  | ||||
| class SelectionMessages(models.Model): |  | ||||
|     _name = 'selection.messages' |  | ||||
| 
 |  | ||||
|     name = fields.Char(string='Name of the Message Template') |  | ||||
|     message = fields.Text(string="Message", required=True) |  | ||||
| 
 |  | ||||
| 
 | 
| After Width: | Height: | Size: 100 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> | ||||
| @ -1,55 +0,0 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> |  | ||||
| <odoo> |  | ||||
|     <!--Selection messages Tree View  --> |  | ||||
|     <record id="selection_messages_view_tree" model="ir.ui.view"> |  | ||||
|         <field name="name">selection.messages.view.tree</field> |  | ||||
|         <field name="model">selection.messages</field> |  | ||||
|         <field name="arch" type="xml"> |  | ||||
|             <tree> |  | ||||
|                 <field name="name"/> |  | ||||
|                 <field name="message"/> |  | ||||
|             </tree> |  | ||||
|         </field> |  | ||||
|     </record> |  | ||||
|     <!-- Selection messages Form View--> |  | ||||
|     <record id="selection_messages_view_form" model="ir.ui.view"> |  | ||||
|         <field name="name">selection.messages.view.form</field> |  | ||||
|         <field name="model">selection.messages</field> |  | ||||
|         <field name="arch" type="xml"> |  | ||||
|             <form> |  | ||||
|                 <sheet> |  | ||||
|                     <group> |  | ||||
|                         <group> |  | ||||
|                             <field name="name"/> |  | ||||
|                         </group> |  | ||||
|                     </group> |  | ||||
|                     <notebook> |  | ||||
|                         <page string="Message"> |  | ||||
|                             <group> |  | ||||
|                                 <field colspan="2" name="message" widget="text_emojis" |  | ||||
|                                        nolabel="1" |  | ||||
|                                        placeholder="Write Message here...." |  | ||||
|                                 /> |  | ||||
|                             </group> |  | ||||
|                         </page> |  | ||||
|                     </notebook> |  | ||||
|                 </sheet> |  | ||||
|             </form> |  | ||||
|         </field> |  | ||||
|     </record> |  | ||||
|     <!--Selection messages Action --> |  | ||||
|     <record id="selection_messages_action" model="ir.actions.act_window"> |  | ||||
|         <field name="name">Selection Messages</field> |  | ||||
|         <field name="res_model">selection.messages</field> |  | ||||
|         <field name="type">ir.actions.act_window</field> |  | ||||
|         <field name="view_mode">tree,form</field> |  | ||||
|         <field name="view_id" ref="selection_messages_view_tree"/> |  | ||||
|     </record> |  | ||||
| 
 |  | ||||
|     <menuitem name="Whatsapp Messages" |  | ||||
|               id="menu_website_selection_messages" |  | ||||
|               action="selection_messages_action" |  | ||||
|               parent="website.menu_website_global_configuration" |  | ||||
|               sequence="50" |  | ||||
|               /> |  | ||||
| </odoo> |  | ||||
					Loading…
					
					
				
		Reference in new issue