whatsapp_mail
This commit is contained in:
parent
8b4ccf839c
commit
4196323008
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
'name': 'Odoo Whatsapp Integration',
|
'name': 'Odoo Whatsapp Integration',
|
||||||
'version': '18.0.1.0.0', # تغيير الإصدار إلى 18.0
|
'version': '18.0.1.0.0',
|
||||||
'category': 'Sales',
|
'category': 'Sales',
|
||||||
'summary': """Odoo 18 Whatsapp Integration For Sales,Contacts,Crm,Stock,Purchase,Invoice, and Floating button in Website""",
|
'summary': """Odoo 18 Whatsapp Integration For Sales,Contacts,Crm,Stock,Purchase,Invoice, and Floating button in Website""",
|
||||||
'description': """Odoo 18 Version: Added options for sending Whatsapp messages and Mails in systray bar,sale order, invoices,
|
'description': """Odoo 18 Version: Added options for sending Whatsapp messages and Mails in systray bar,sale order, invoices,
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
'company': 'Expert',
|
'company': 'Expert',
|
||||||
'depends': ['base', 'contacts', 'crm', 'stock', 'sale_management', 'purchase', 'account', 'website'],
|
'depends': ['base', 'contacts', 'crm', 'stock', 'sale_management', 'purchase', 'account', 'website'],
|
||||||
|
|
||||||
# لا نغير هذا القسم الآن، سنعالج ملفاته واحدًا تلو الآخر
|
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'views/portal_whatsapp_view.xml',
|
'views/portal_whatsapp_view.xml',
|
||||||
|
|
@ -26,14 +25,13 @@
|
||||||
'wizard/portal_share_inherited.xml',
|
'wizard/portal_share_inherited.xml',
|
||||||
],
|
],
|
||||||
|
|
||||||
# هذا هو التغيير الهيكلي الأهم في Odoo 18
|
|
||||||
# تم نقل تعريفات الجافاسكريبت و قوالب QWeb إلى هنا
|
|
||||||
'assets': {
|
'assets': {
|
||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
# '/whatsapp_mail_messaging/static/src/js/whatsapp_button.js', # معطل مؤقتاً
|
'/whatsapp_mail_messaging/static/src/js/whatsapp_button.js',
|
||||||
# '/whatsapp_mail_messaging/static/src/js/mail_button.js', # معطل مؤقتاً
|
'/whatsapp_mail_messaging/static/src/js/mail_button.js',
|
||||||
# '/whatsapp_mail_messaging/static/src/xml/whatsapp_button.xml', # معطل مؤقتاً
|
'/whatsapp_mail_messaging/static/src/xml/whatsapp_button.xml',
|
||||||
# '/whatsapp_mail_messaging/static/src/xml/mail_button.xml', # معطل مؤقتاً
|
'/whatsapp_mail_messaging/static/src/xml/mail_button.xml',
|
||||||
|
'/whatsapp_mail_messaging/static/src/css/systray_icons.css',
|
||||||
],
|
],
|
||||||
'web.assets_frontend': [
|
'web.assets_frontend': [
|
||||||
'/whatsapp_mail_messaging/static/src/css/whatsapp.css',
|
'/whatsapp_mail_messaging/static/src/css/whatsapp.css',
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ class Account(models.Model):
|
||||||
compose_form_id = self.env.ref('whatsapp_mail_messaging.whatsapp_message_wizard_form').id
|
compose_form_id = self.env.ref('whatsapp_mail_messaging.whatsapp_message_wizard_form').id
|
||||||
ctx = dict(self.env.context)
|
ctx = dict(self.env.context)
|
||||||
|
|
||||||
# استخدام f-string والكشف عن القيم الفارغة لتجنب الخطأ
|
|
||||||
partner_name = self.partner_id.name or ''
|
partner_name = self.partner_id.name or ''
|
||||||
invoice_name = self.name or ''
|
invoice_name = self.name or ''
|
||||||
total_amount = self.amount_total or 0.0
|
total_amount = self.amount_total or 0.0
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
.o_systray_item .fa-whatsapp,
|
||||||
|
.o_systray_item .fa-envelope {
|
||||||
|
margin: 0 5px;
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
/** @odoo-module **/
|
|
||||||
|
|
||||||
import { registry } from "@web/core/registry";
|
import { registry } from "@web/core/registry";
|
||||||
import { useService } from "@web/core/utils/hooks";
|
import { useService } from "@web/core/utils/hooks";
|
||||||
import { Component } from "@odoo/owl";
|
import { Component } from "@odoo/owl";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import { registry } from "@web/core/registry";
|
import { registry } from "@web/core/registry";
|
||||||
import { useService } from "@web/core/utils/hooks";
|
import { useService } from "@web/core/utils/hooks";
|
||||||
import { Component } from "@odoo/owl";
|
import { Component } from "@odoo/owl";
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,17 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<!-- 1. تعديل واجهة النموذج لإضافة زر الإرسال الفردي -->
|
|
||||||
<record model="ir.ui.view" id="account_move_form_view_inherited">
|
<record model="ir.ui.view" id="account_move_form_view_inherited">
|
||||||
<field name="name">account.move.form.view.inherited</field>
|
<field name="name">account.move.form.view.inherited</field>
|
||||||
<field name="model">account.move</field>
|
<field name="model">account.move</field>
|
||||||
<field name="inherit_id" ref="account.view_move_form"/>
|
<field name="inherit_id" ref="account.view_move_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//button[@name='preview_invoice']" position="after">
|
<xpath expr="//button[@name='preview_invoice']" position="after">
|
||||||
<!-- استخدام فئات Bootstrap 5 بدلاً من style المضمن -->
|
|
||||||
<button type="object" class="btn btn-success"
|
<button type="object" class="btn btn-success"
|
||||||
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 2. إنشاء إجراء خادم (Server Action) لاستدعاء دالة الإرسال الجماعي -->
|
|
||||||
<record id="action_whatsapp_multi_account_move" model="ir.actions.server">
|
<record id="action_whatsapp_multi_account_move" model="ir.actions.server">
|
||||||
<field name="name">Send by Whatsapp</field>
|
<field name="name">Send by Whatsapp</field>
|
||||||
<field name="model_id" ref="account.model_account_move"/>
|
<field name="model_id" ref="account.model_account_move"/>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<!-- 1. تعديل واجهة النموذج لإضافة زر الإرسال الفردي -->
|
|
||||||
<record id="whatsapp_res_view_form" model="ir.ui.view">
|
<record id="whatsapp_res_view_form" model="ir.ui.view">
|
||||||
<field name="name">whatsapp.view.form.inherit.res</field>
|
<field name="name">whatsapp.view.form.inherit.res</field>
|
||||||
<field name="model">res.partner</field>
|
<field name="model">res.partner</field>
|
||||||
|
|
@ -8,7 +7,6 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='image_1920']" position="before">
|
<xpath expr="//field[@name='image_1920']" position="before">
|
||||||
<div class="oe_button_box" name="button_box">
|
<div class="oe_button_box" name="button_box">
|
||||||
<!-- استخدام فئات Bootstrap 5 بدلاً من style المضمن -->
|
|
||||||
<button type="object" class="btn btn-success"
|
<button type="object" class="btn btn-success"
|
||||||
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -16,7 +14,6 @@
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 2. إنشاء إجراء خادم (Server Action) لاستدعاء دالة الإرسال الجماعي -->
|
|
||||||
<record id="action_whatsapp_multi_res_partner" model="ir.actions.server">
|
<record id="action_whatsapp_multi_res_partner" model="ir.actions.server">
|
||||||
<field name="name">Send by Whatsapp</field>
|
<field name="name">Send by Whatsapp</field>
|
||||||
<field name="model_id" ref="base.model_res_partner"/>
|
<field name="model_id" ref="base.model_res_partner"/>
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,17 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<!-- 1. تعديل واجهة النموذج لإضافة زر الإرسال الفردي -->
|
|
||||||
<record id="whatsapp_crm_view_form" model="ir.ui.view">
|
<record id="whatsapp_crm_view_form" model="ir.ui.view">
|
||||||
<field name="name">whatsapp.view.form.inherit.crm</field>
|
<field name="name">whatsapp.view.form.inherit.crm</field>
|
||||||
<field name="model">crm.lead</field>
|
<field name="model">crm.lead</field>
|
||||||
<field name="inherit_id" ref="crm.crm_lead_view_form"/>
|
<field name="inherit_id" ref="crm.crm_lead_view_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<!-- استخدام xpath أكثر تحديدًا لضمان العثور على الـ header -->
|
|
||||||
<xpath expr="//form/header" position="inside">
|
<xpath expr="//form/header" position="inside">
|
||||||
<!-- استخدام فئات Bootstrap 5 بدلاً من style المضمن -->
|
|
||||||
<button type="object" class="btn btn-success"
|
<button type="object" class="btn btn-success"
|
||||||
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 2. إنشاء إجراء خادم (Server Action) لاستدعاء دالة الإرسال الجماعي -->
|
|
||||||
<record id="action_whatsapp_multi_crm_lead" model="ir.actions.server">
|
<record id="action_whatsapp_multi_crm_lead" model="ir.actions.server">
|
||||||
<field name="name">Send by Whatsapp</field>
|
<field name="name">Send by Whatsapp</field>
|
||||||
<field name="model_id" ref="crm.model_crm_lead"/>
|
<field name="model_id" ref="crm.model_crm_lead"/>
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,17 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<!-- 1. تعديل واجهة النموذج لإضافة زر الإرسال الفردي -->
|
|
||||||
<record model="ir.ui.view" id="purchase_order_form_view_inherited">
|
<record model="ir.ui.view" id="purchase_order_form_view_inherited">
|
||||||
<field name="name">purchase.order.form.view.inherited</field>
|
<field name="name">purchase.order.form.view.inherited</field>
|
||||||
<field name="model">purchase.order</field>
|
<field name="model">purchase.order</field>
|
||||||
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//button[@name='action_rfq_send']" position="after">
|
<xpath expr="//button[@name='action_rfq_send']" position="after">
|
||||||
<!-- استخدام فئات Bootstrap 5 بدلاً من style المضمن -->
|
|
||||||
<button type="object" class="btn btn-success"
|
<button type="object" class="btn btn-success"
|
||||||
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 2. إنشاء إجراء خادم (Server Action) لاستدعاء دالة الإرسال الجماعي -->
|
|
||||||
<record id="action_whatsapp_multi_purchase_order" model="ir.actions.server">
|
<record id="action_whatsapp_multi_purchase_order" model="ir.actions.server">
|
||||||
<field name="name">Send by Whatsapp</field>
|
<field name="name">Send by Whatsapp</field>
|
||||||
<field name="model_id" ref="purchase.model_purchase_order"/>
|
<field name="model_id" ref="purchase.model_purchase_order"/>
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,17 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<!-- 1. تعديل واجهة النموذج لإضافة زر الإرسال الفردي -->
|
|
||||||
<record model="ir.ui.view" id="sale_order_form_view_inherited">
|
<record model="ir.ui.view" id="sale_order_form_view_inherited">
|
||||||
<field name="name">sale.order.form.view.inherited</field>
|
<field name="name">sale.order.form.view.inherited</field>
|
||||||
<field name="model">sale.order</field>
|
<field name="model">sale.order</field>
|
||||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//button[@name='action_quotation_send']" position="after">
|
<xpath expr="//button[@name='action_quotation_send']" position="after">
|
||||||
<!-- استخدام فئات Bootstrap 5 بدلاً من style المضمن -->
|
|
||||||
<button type="object" class="btn btn-success"
|
<button type="object" class="btn btn-success"
|
||||||
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 2. إنشاء إجراء خادم (Server Action) لاستدعاء دالة الإرسال الجماعي -->
|
|
||||||
<record id="action_whatsapp_multi_sale_order" model="ir.actions.server">
|
<record id="action_whatsapp_multi_sale_order" model="ir.actions.server">
|
||||||
<field name="name">Send by Whatsapp</field>
|
<field name="name">Send by Whatsapp</field>
|
||||||
<field name="model_id" ref="sale.model_sale_order"/>
|
<field name="model_id" ref="sale.model_sale_order"/>
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,17 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<!-- 1. تعديل واجهة النموذج لإضافة زر الإرسال الفردي -->
|
|
||||||
<record id="whatsapp_stock_view_form" model="ir.ui.view">
|
<record id="whatsapp_stock_view_form" model="ir.ui.view">
|
||||||
<field name="name">whatsapp.view.form.inherit.stock</field>
|
<field name="name">whatsapp.view.form.inherit.stock</field>
|
||||||
<field name="model">stock.picking</field>
|
<field name="model">stock.picking</field>
|
||||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//button[@name='do_print_picking']" position="after">
|
<xpath expr="//button[@name='do_print_picking']" position="after">
|
||||||
<!-- استخدام فئات Bootstrap 5 بدلاً من style المضمن -->
|
|
||||||
<button type="object" class="btn btn-success"
|
<button type="object" class="btn btn-success"
|
||||||
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
name="action_send_whatsapp" icon="fa-whatsapp" string="Send by Whatsapp"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 2. إنشاء إجراء خادم (Server Action) لاستدعاء دالة الإرسال الجماعي -->
|
|
||||||
<record id="action_whatsapp_multi_stock_picking" model="ir.actions.server">
|
<record id="action_whatsapp_multi_stock_picking" model="ir.actions.server">
|
||||||
<field name="name">Send by Whatsapp</field>
|
<field name="name">Send by Whatsapp</field>
|
||||||
<field name="model_id" ref="stock.model_stock_picking"/>
|
<field name="model_id" ref="stock.model_stock_picking"/>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
<field name="share_type" widget="radio"/>
|
<field name="share_type" widget="radio"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<!-- تم حذف attrs من الأزرار -->
|
|
||||||
<xpath expr="//button[@name='action_send_mail']" position="replace">
|
<xpath expr="//button[@name='action_send_mail']" position="replace">
|
||||||
<button string="Send Mail" name="action_send_mail"
|
<button string="Send Mail" name="action_send_mail"
|
||||||
type="object" class="btn btn-primary"/>
|
type="object" class="btn btn-primary"/>
|
||||||
|
|
@ -19,7 +18,6 @@
|
||||||
type="object" class="btn btn-success" icon="fa-whatsapp"/>
|
type="object" class="btn btn-success" icon="fa-whatsapp"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<!-- تم حذف attrs من الحقول -->
|
|
||||||
<xpath expr="//field[@name='partner_ids']" position="replace">
|
<xpath expr="//field[@name='partner_ids']" position="replace">
|
||||||
<field name="partner_ids" widget="many2many_tags_email"
|
<field name="partner_ids" widget="many2many_tags_email"
|
||||||
placeholder="Add contacts to share the document..."/>
|
placeholder="Add contacts to share the document..."/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue