fix issues in purchase expense
This commit is contained in:
parent
9b364aa434
commit
4b71e106be
|
|
@ -6,8 +6,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-10-27 03:56+0000\n"
|
||||
"PO-Revision-Date: 2024-10-27 03:56+0000\n"
|
||||
"POT-Creation-Date: 2024-11-17 03:22+0000\n"
|
||||
"PO-Revision-Date: 2024-11-17 03:22+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
|
@ -26,6 +26,12 @@ msgstr "قيد اليومية"
|
|||
msgid "Paid by Petty Cash"
|
||||
msgstr "منصرفه من العهد"
|
||||
|
||||
#. module: purchase_petty_invoice
|
||||
#: model:ir.model.fields,field_description:purchase_petty_invoice.field_purchase_order__petty_employee_id
|
||||
#: model_terms:ir.ui.view,arch_db:purchase_petty_invoice.view_purchase_order_filter
|
||||
msgid "Petty Cashier"
|
||||
msgstr "موظف العهد"
|
||||
|
||||
#. module: purchase_petty_invoice
|
||||
#: model:ir.model,name:purchase_petty_invoice.model_purchase_order
|
||||
msgid "Purchase Order"
|
||||
|
|
|
|||
|
|
@ -6,18 +6,23 @@ from odoo import models, fields, api
|
|||
class PurchaseOrder(models.Model):
|
||||
_inherit = "purchase.order"
|
||||
is_petty_paid = fields.Boolean(string='Paid by Petty Cash', default=False, copy=False)
|
||||
petty_employee_id = fields.Many2one('hr.employee', string='Petty Cashier', copy=False)
|
||||
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
|
||||
@api.onchange('purchase_vendor_bill_id', 'purchase_id')
|
||||
def _onchange_purchase_auto_complete(self):
|
||||
super()._onchange_purchase_auto_complete()
|
||||
if self.purchase_id:
|
||||
self.is_petty_paid = self.purchase_id.is_petty_paid
|
||||
self.petty_employee_id = self.purchase_id.petty_employee_id
|
||||
else:
|
||||
self.is_petty_paid = False
|
||||
self.petty_employee_id = False
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
|
|
@ -25,10 +30,12 @@ class AccountMove(models.Model):
|
|||
for move in moves:
|
||||
if move.purchase_id:
|
||||
move.is_petty_paid = move.purchase_id.is_petty_paid
|
||||
move.petty_employee_id = move.purchase_id.petty_employee_id.id
|
||||
return moves
|
||||
|
||||
def write(self, vals):
|
||||
if vals.get('purchase_id'):
|
||||
po = self.env['purchase.order'].browse(vals['purchase_id'])
|
||||
vals['is_petty_paid'] = po.is_petty_paid
|
||||
vals['petty_employee_id'] = po.petty_employee_id.id
|
||||
super(AccountMove, self).write(vals)
|
||||
|
|
|
|||
|
|
@ -6,10 +6,14 @@
|
|||
<field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_id']" position="after">
|
||||
<field name="petty_employee_id"/>
|
||||
<field name="is_petty_paid"/>
|
||||
<filter name="is_petty_paid" string="Paid by Petty Cash"
|
||||
domain="[('is_petty_paid', '=',True)]"/>
|
||||
</xpath>
|
||||
<xpath expr="//group" position="inside">
|
||||
<filter name="group_by_petty_employee_id" string="Petty Cashier" context="{'group_by':'petty_employee_id'}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
@ -20,6 +24,8 @@
|
|||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='partner_id']" position="after">
|
||||
<field name="is_petty_paid"/>
|
||||
<field name="petty_employee_id" options='{"no_open": True, "no_create": True}'
|
||||
attrs="{'invisible':[('is_petty_paid','=',False)],'required':[('is_petty_paid','=',True)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-10-07 06:57+0000\n"
|
||||
"PO-Revision-Date: 2024-10-07 06:57+0000\n"
|
||||
"POT-Creation-Date: 2024-11-17 03:23+0000\n"
|
||||
"PO-Revision-Date: 2024-11-17 03:23+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
|
@ -141,6 +141,7 @@ msgstr "تم اعتماد الموازنة"
|
|||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order__attach_no
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_requisition__attach_no
|
||||
msgid "Attach No"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -172,7 +173,7 @@ msgstr "الإكمال التلقائي من أمر شراء سابق."
|
|||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_budget_confirmation__available
|
||||
msgid "Available"
|
||||
msgstr ""
|
||||
msgstr "متوفر"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields.selection,name:purchase_requisition_custom.selection__change_purchase_user_state__state__open
|
||||
|
|
@ -181,10 +182,15 @@ msgstr ""
|
|||
msgid "Bid Selection"
|
||||
msgstr "طريقة الاختيار"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order__billed_amount
|
||||
msgid "Billed Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order__budget_id
|
||||
msgid "Budget"
|
||||
msgstr ""
|
||||
msgstr "الموازنة"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model,name:purchase_requisition_custom.model_budget_confirmation
|
||||
|
|
@ -202,6 +208,11 @@ msgstr "بند الموازنة"
|
|||
msgid "Budgeting"
|
||||
msgstr "الموازنات"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:res.groups,name:purchase_requisition_custom.can_see_his_pos_vis
|
||||
msgid "Can see his purchase orders only"
|
||||
msgstr " رؤية طلبات الشراء الخاصة به فقط"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: code:addons/purchase_requisition_custom/models/purchase_request.py:0
|
||||
#: code:addons/purchase_requisition_custom/models/purchase_request.py:0
|
||||
|
|
@ -393,7 +404,7 @@ msgstr "العقد"
|
|||
#. module: purchase_requisition_custom
|
||||
#: model_terms:ir.ui.view,arch_db:purchase_requisition_custom.convert_to_contract_po_wizard
|
||||
msgid "Contract Information"
|
||||
msgstr ""
|
||||
msgstr "معلومات العقد "
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_convert_po_contract_wizard__contract_name
|
||||
|
|
@ -595,6 +606,7 @@ msgstr "انتهاء صلاحية المستند"
|
|||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model_terms:ir.ui.view,arch_db:purchase_requisition_custom.purchase_order_custom_form_view
|
||||
#: model_terms:ir.ui.view,arch_db:purchase_requisition_custom.purchase_requisition_custom_form_view
|
||||
msgid "Documents"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -638,7 +650,7 @@ msgstr "معالج تكوين رسالة البريد الإلكتروني"
|
|||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_budget_confirmation__emergency
|
||||
msgid "Emergency"
|
||||
msgstr ""
|
||||
msgstr "طوارئ"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model,name:purchase_requisition_custom.model_hr_employee
|
||||
|
|
@ -714,7 +726,7 @@ msgstr "المتابعون (الشركاء)"
|
|||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,help:purchase_requisition_custom.field_purchase_request__activity_type_icon
|
||||
msgid "Font awesome icon e.g. fa-tasks"
|
||||
msgstr ""
|
||||
msgstr "رمز الخط الرائع ، على سبيل المثال FA- المهام"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_res_company__general_supervisor_id
|
||||
|
|
@ -1516,7 +1528,7 @@ msgstr "تم إرسال طلب الشراء المدئي"
|
|||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_request__reason
|
||||
msgid "Reason/Justification"
|
||||
msgstr ""
|
||||
msgstr "السببظ المبرر"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order__recommendation_order
|
||||
|
|
@ -1576,10 +1588,15 @@ msgstr "سبب الرفض"
|
|||
msgid "Rejected By Budget"
|
||||
msgstr "مرفوضة حسب الميزاينة"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order__remaining_amount
|
||||
msgid "Remaining Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model,name:purchase_requisition_custom.model_res_partner
|
||||
msgid "Renter"
|
||||
msgstr ""
|
||||
msgstr "المستأجر"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.ui.menu,name:purchase_requisition_custom.reports
|
||||
|
|
@ -1631,6 +1648,7 @@ msgstr ""
|
|||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order__res_id
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_requisition__res_id
|
||||
msgid "Res"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1641,6 +1659,7 @@ msgstr ""
|
|||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order__res_model
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_requisition__res_model
|
||||
msgid "Res Model"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -1685,7 +1704,7 @@ msgstr "حفظ"
|
|||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_request_cancel_wizard__user_id
|
||||
msgid "Scheduler User"
|
||||
msgstr ""
|
||||
msgstr "المستخدم المُجدوِل "
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields.selection,name:purchase_requisition_custom.selection__change_purchase_user_state__state__second_approve
|
||||
|
|
@ -1881,7 +1900,7 @@ msgstr ""
|
|||
#: code:addons/purchase_requisition_custom/models/purchase_order.py:0
|
||||
#, python-format
|
||||
msgid "The Expense account %s is assigned to more than one budget position %s"
|
||||
msgstr "حساب المصروفات %s مخصص لأكثر من مركز ميزانية %s"
|
||||
msgstr ""
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.module.category,description:purchase_requisition_custom.module_category_purchase_request
|
||||
|
|
|
|||
|
|
@ -107,6 +107,11 @@
|
|||
|
||||
</record>
|
||||
|
||||
<record id="can_see_his_pos_vis" model="res.groups">
|
||||
<field name="name">Can see his purchase orders only</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="purchase_requisition_second_approve" model="res.groups">
|
||||
<field name="name">Minimum Amount Approval</field>
|
||||
<field name="category_id" ref="purchase_requisition_custom.module_category_purchase_requisition_custom"/>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,18 @@
|
|||
eval="[ (4, ref('purchase_requisition_custom.group_direct_manger'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="employee_pos_visibility_user" model="ir.rule">
|
||||
<field name="name">User can only see his / her Purchase Orders</field>
|
||||
<field name="model_id" ref="purchase.model_purchase_order"/>
|
||||
<field name="groups" eval="[(4, ref ('purchase_requisition_custom.can_see_his_pos_vis'))]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="True"/>
|
||||
<field name="perm_create" eval="True"/>
|
||||
<field name="perm_unlink" eval="False"/>
|
||||
<field name="domain_force">[('user_id', '=', user.id)]</field>
|
||||
|
||||
</record>
|
||||
|
||||
|
||||
<!-- employee request-->
|
||||
<record id="employee_request_visibility_user" model="ir.rule">
|
||||
|
|
|
|||
Loading…
Reference in New Issue