发送消息
This commit is contained in:
@@ -11,13 +11,15 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['sale', 'purchase', 'sf_plan', 'jikimo_message_notify', 'stock', 'sf_quality', 'mrp','sf_manufacturing'],
|
||||
'depends': ['sale', 'purchase', 'sf_plan', 'jikimo_message_notify', 'stock', 'sf_quality', 'mrp',
|
||||
'sf_manufacturing'],
|
||||
'data': [
|
||||
'data/bussiness_node.xml',
|
||||
'data/cron_data.xml',
|
||||
'data/template_data.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/mrp_workorder_views.xml',
|
||||
'views/purchase_order_view.xml',
|
||||
],
|
||||
'test': [
|
||||
],
|
||||
|
||||
@@ -28,13 +28,15 @@ class SFMessagePurchase(models.Model):
|
||||
content = message_queue_id.message_template_id.content
|
||||
if message_queue_id.message_template_id.name == '采购订单预警提醒':
|
||||
domain = [('delivery_warning', '=', 'warning')]
|
||||
action_id = self.env.ref("sf_message.purchase_form_warning_action").id
|
||||
else:
|
||||
domain = [('delivery_warning', '=', 'overdue')]
|
||||
action_id = self.env.ref("sf_message.purchase_form_overdue_action").id
|
||||
purchase_order_num = self.env['purchase.order'].sudo().search_count(domain)
|
||||
if purchase_order_num >= 1:
|
||||
url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
|
||||
action_id = self.env.ref("purchase.purchase_form_action").id
|
||||
url_with_id = f"{url}/web#view_type=list&action={action_id}"
|
||||
menu_id = self.env.ref('purchase.menu_purchase_form_action').id
|
||||
url_with_id = f"{url}/web#view_type=list&action={action_id}&menu_id={menu_id}"
|
||||
content = content.replace('{{url}}', url_with_id).replace('{{num}}', str(purchase_order_num))
|
||||
contents.append(content)
|
||||
if process_outsourcing:
|
||||
|
||||
46
sf_message/views/purchase_order_view.xml
Normal file
46
sf_message/views/purchase_order_view.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="purchase_form_warning_action" model="ir.actions.act_window">
|
||||
<field name="name">采购订单</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">purchase.order</field>
|
||||
<field name="view_mode">tree,kanban,form,pivot,graph,calendar,activity</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('purchase.purchase_order_view_tree')}),
|
||||
(0, 0, {'view_mode': 'kanban', 'view_id': ref('purchase.purchase_order_view_kanban_without_dashboard')}),
|
||||
]"/>
|
||||
<field name="domain">[('state','in',('purchase', 'done'))]</field>
|
||||
<field name="search_view_id" ref="purchase.purchase_order_view_search"/>
|
||||
<field name="context">{'search_default_filter_order_warning':1}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
还没有采购订单, 我们先创建一个!
|
||||
</p>
|
||||
<p>
|
||||
当您下单到您的供应商,确定您的询价它会变成采购订单.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="purchase_form_overdue_action" model="ir.actions.act_window">
|
||||
<field name="name">采购订单</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">purchase.order</field>
|
||||
<field name="view_mode">tree,kanban,form,pivot,graph,calendar,activity</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('purchase.purchase_order_view_tree')}),
|
||||
(0, 0, {'view_mode': 'kanban', 'view_id': ref('purchase.purchase_order_view_kanban_without_dashboard')}),
|
||||
]"/>
|
||||
<field name="domain">[('state','in',('purchase', 'done'))]</field>
|
||||
<field name="search_view_id" ref="purchase.purchase_order_view_search"/>
|
||||
<field name="context">{'search_default_filter_order_overdue':1}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
还没有采购订单, 我们先创建一个!
|
||||
</p>
|
||||
<p>
|
||||
当您下单到您的供应商,确定您的询价它会变成采购订单.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user