fix notification translate
This commit is contained in:
parent
531fae82d0
commit
e16eef4bd3
|
|
@ -11,6 +11,7 @@
|
|||
'security/ir.model.access.csv',
|
||||
'data/purchase_request.xml',
|
||||
'views/purchase_request.xml',
|
||||
'views/stock_warehouse.xml',
|
||||
'wizards/picking_purchase_request.xml'
|
||||
|
||||
],
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -6,8 +6,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-07-03 02:56+0000\n"
|
||||
"PO-Revision-Date: 2024-07-03 02:56+0000\n"
|
||||
"POT-Creation-Date: 2024-07-29 22:30+0000\n"
|
||||
"PO-Revision-Date: 2024-07-29 22:30+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
|
@ -84,11 +84,6 @@ msgstr "استلام"
|
|||
msgid "Delivery Done"
|
||||
msgstr "تم الستلام"
|
||||
|
||||
#. module: purchase_custom_stock
|
||||
#: model_terms:ir.ui.view,arch_db:purchase_custom_stock.purchase_request_picking_wizard_view_form
|
||||
msgid "Delivery and Close"
|
||||
msgstr "تسليم المتوفر واغلاق الطلب "
|
||||
|
||||
#. module: purchase_custom_stock
|
||||
#: model_terms:ir.ui.view,arch_db:purchase_custom_stock.purchase_request_picking_wizard_view_form
|
||||
msgid "Delivery and Purchase"
|
||||
|
|
@ -198,6 +193,12 @@ msgstr ""
|
|||
msgid "Please Insert Location first"
|
||||
msgstr "يرجى اختيار المستودع و الموقع"
|
||||
|
||||
#. module: purchase_custom_stock
|
||||
#: code:addons/purchase_custom_stock/models/purchase_request.py:0
|
||||
#, python-format
|
||||
msgid "Please Insert a Vendor"
|
||||
msgstr ""
|
||||
|
||||
#. module: purchase_custom_stock
|
||||
#: code:addons/purchase_custom_stock/models/purchase_request.py:0
|
||||
#: code:addons/purchase_custom_stock/models/purchase_request.py:0
|
||||
|
|
@ -251,6 +252,12 @@ msgstr "المستودع"
|
|||
msgid "Warehouses Department"
|
||||
msgstr "المستودعات"
|
||||
|
||||
#. module: purchase_custom_stock
|
||||
#: code:addons/purchase_custom_stock/models/purchase_request.py:0
|
||||
#, python-format
|
||||
msgid "only %s Direct Manager can approve the order"
|
||||
msgstr " يمكن اعتماد الطلب s% فقط المدير المباشر ل"
|
||||
|
||||
#. module: purchase_custom_stock
|
||||
#: model:ir.model,name:purchase_custom_stock.model_purchase_request_picking_wizard
|
||||
msgid "purchase Checking Options wizard"
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
|
||||
from . import purchase_request
|
||||
from . import stock_warehouse
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -213,14 +213,17 @@ class PurchaseRequest(models.Model):
|
|||
limit=1).available_quantity
|
||||
line.qty_purchased=line.qty-line.available_qty
|
||||
def write(self,vals):
|
||||
|
||||
"""Ovveride Send Notification On state"""
|
||||
"""Ovveride Send Notification On state"""
|
||||
res=super(PurchaseRequest,self).write(vals)
|
||||
if 'state' in vals :
|
||||
if vals['state'] =='direct_manager':
|
||||
if vals['state'] == 'direct_manager':
|
||||
direct_manager = self.sudo().department_id.manager_id
|
||||
if direct_manager and direct_manager.user_id:
|
||||
self.message_post(body='Dear %s your approval is required on %s ' % (direct_manager.name, self.name),
|
||||
if self.env.user.partner_id.lang == 'ar_001':
|
||||
body = 'عزيزى %s موافقتك مطلوبة على %s ' % (direct_manager.name, self.name)
|
||||
else:
|
||||
body = 'Dear %s your approval is required on %s ' % (direct_manager.name, self.name)
|
||||
self.message_post(body=body,
|
||||
message_type='notification',
|
||||
author_id=self.env.user.partner_id.id, sticky=True,
|
||||
subtype_id=self.env.ref("mail.mt_comment").id,
|
||||
|
|
@ -231,7 +234,11 @@ class PurchaseRequest(models.Model):
|
|||
for user in stock_users:
|
||||
stock_employee=self.env['hr.employee'].search([('user_id','=',user.id)],limit=1)
|
||||
if stock_employee and user.partner_id.id:
|
||||
self.message_post(body='Dear %s your approval is required on %s ' % (stock_employee.name, self.name),
|
||||
if self.env.user.partner_id.lang=='ar_001':
|
||||
body = 'عزيزى %s موافقتك مطلوبة على %s ' % (stock_employee.name, self.name)
|
||||
else:
|
||||
body='Dear %s your approval is required on %s ' % (stock_employee.name, self.name)
|
||||
self.message_post(body=body,
|
||||
message_type='notification',
|
||||
author_id=self.env.user.partner_id.id, sticky=True,
|
||||
subtype_id=self.env.ref("mail.mt_comment").id,
|
||||
|
|
@ -241,17 +248,24 @@ class PurchaseRequest(models.Model):
|
|||
purchase_users = self.env['res.users'].search([('groups_id', '=', purchase_group.id)])
|
||||
for user in purchase_users:
|
||||
purchase_employee = self.env['hr.employee'].search([('user_id', '=', user.id)], limit=1)
|
||||
if self.env.user.partner_id.lang == 'ar_001':
|
||||
body = 'عزيزى %s موافقتك مطلوبة على %s ' % (purchase_employee.name, self.name)
|
||||
else:
|
||||
body = 'Dear %s your approval is required on %s ' % (purchase_employee.name, self.name)
|
||||
if purchase_employee and user.partner_id.id:
|
||||
self.message_post(body='Dear %s your approval is required on %s ' % (purchase_employee.name, self.name),
|
||||
self.message_post(body=body,
|
||||
message_type='notification',
|
||||
author_id=self.env.user.partner_id.id, sticky=True,
|
||||
subtype_id=self.env.ref("mail.mt_comment").id,
|
||||
partner_ids=[user.partner_id.id])
|
||||
elif vals['state'] == 'employee':
|
||||
print("employee")
|
||||
if self.sudo().employee_id and self.sudo().employee_id.user_id:
|
||||
if self.env.user.partner_id.lang == 'ar_001':
|
||||
body = 'عزيزى %s يرجى تاكيد استلامك على %s ' % (self.sudo().employee_id.name, self.name)
|
||||
else:
|
||||
body = 'Dear %s please confirm Your receipt on %s ' % (self.sudo().employee_id.name, self.name)
|
||||
self.message_post(
|
||||
body='Dear %s please confirm your Delivery on %s ' % (self.sudo().employee_id.name, self.name),
|
||||
body=body,
|
||||
message_type='notification',
|
||||
author_id=self.env.user.partner_id.id, sticky=True,
|
||||
subtype_id=self.env.ref("mail.mt_comment").id,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class StockWarehouse(models.Model):
|
||||
_inherit = 'stock.warehouse'
|
||||
|
||||
manager_id=fields.Many2one("res.users",string="Warehouse Manager")
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_warehouse_inherit_manager_id" model="ir.ui.view">
|
||||
<field name="name">view.warehouse.inherit.manager</field>
|
||||
<field name="model">stock.warehouse</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_id" position="after">
|
||||
<field name="manager_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue