Merge pull request #2330 from expsa/samir-aladawi-fix-errors-hr-expense

Samir aladawi fix errors hr expense
This commit is contained in:
SamirLADOUI-sa 2025-02-06 18:08:03 +01:00 committed by GitHub
commit 85a0223c2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 77 additions and 16 deletions

View File

@ -5,27 +5,27 @@ class AccountPayment(models.Model):
_inherit = 'account.payment'
destination_journal_id = fields.Many2one(comodel_name='account.journal')
available_account_receiving_method_ids = fields.Many2many('account.payment.method.line', compute="_compute_available_account_receiving_method_ids")
account_receiving_method_id = fields.Many2one(
'account.payment.method.line',
string="Receiving Method",
default=False
)
# available_account_receiving_method_ids = fields.Many2many('account.payment.method.line', compute="_compute_available_account_receiving_method_ids")
# account_receiving_method_id = fields.Many2one(
# 'account.payment.method.line',
# string="Receiving Method",
# default=False
# )
paired_internal_transfer_payment_id = fields.Many2one('account.payment',
help="When an internal transfer is posted, a paired payment is created. "
"They are cross referenced trough this field",
copy=False)
@api.depends('destination_journal_id')
def _compute_available_account_receiving_method_ids(self):
AccountPaymentMethodLine = self.env['account.payment.method.line'].sudo()
for rec in self:
rec.available_account_receiving_method_ids = AccountPaymentMethodLine.search([('id', 'in', self.destination_journal_id.outbound_payment_method_line_ids.ids)])
# @api.depends('destination_journal_id')
# def _compute_available_account_receiving_method_ids(self):
# AccountPaymentMethodLine = self.env['account.payment.method.line'].sudo()
# for rec in self:
# rec.available_account_receiving_method_ids = AccountPaymentMethodLine.search([('id', 'in', self.destination_journal_id.outbound_payment_method_line_ids.ids)])
@api.onchange('destination_journal_id')
def _onchange_destination_journal_id(self):
self.account_receiving_method_id = False
# @api.onchange('destination_journal_id')
# def _onchange_destination_journal_id(self):
# self.account_receiving_method_id = False
def action_post(self):
res = super(AccountPayment, self).action_post()

View File

@ -10,7 +10,7 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_bank_id']" position="after">
<field name="destination_journal_id" domain="[('type','in',('bank','cash'))]" context="{'default_partner_id': partner_id}" attrs="{'invisible': [('is_internal_transfer', '=', False)],'readonly': [('state', '!=', 'draft')], 'required': [('is_internal_transfer', '=', True),('state', '=', 'draft')]}"/>
<field name="available_account_receiving_method_ids" invisible="1"/>
<!-- <field name="available_account_receiving_method_ids" invisible="1"/>
<field
name="account_receiving_method_id"
domain="[('id', 'in', available_account_receiving_method_ids)]"
@ -18,7 +18,7 @@
'invisible': [('is_internal_transfer', '=', False)],
'readonly': [('state', '!=', 'draft')],
'required': [('is_internal_transfer', '=', True), ('state', '=', 'draft')]
}" />
}" /> -->
<field name="paired_internal_transfer_payment_id" invisible="1"/>
</xpath>

View File

@ -0,0 +1,61 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_expense_custom
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-02-06 16:59+0000\n"
"PO-Revision-Date: 2025-02-06 16:59+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: hr_expense_custom
#: model:ir.model,name:hr_expense_custom.model_hr_employee
msgid "Employee"
msgstr "الموظف"
#. module: hr_expense_custom
#: model:ir.model,name:hr_expense_custom.model_hr_expense_sheet
msgid "Expense Report"
msgstr "تقرير المصروف"
#. module: hr_expense_custom
#: code:addons/hr_expense_custom/models/hr_expense_sheet.py:0
#, python-format
msgid "Only Managers and HR Officers can approve expenses"
msgstr "يمكن للمديرين وموظفي الموارد البشرية فقط اعتماد المصروفات"
#. module: hr_expense_custom
#: model:res.groups,name:hr_expense_custom.show_hr_expense_module
msgid "Show Expenses Module"
msgstr "إظهار المصروفات"
#. module: hr_expense_custom
#: code:addons/hr_expense_custom/models/hr_expense_sheet.py:0
#, python-format
msgid "The expense reports were successfully approved."
msgstr "تمت الموافقة على تقارير النفقات بنجاح. "
#. module: hr_expense_custom
#: code:addons/hr_expense_custom/models/hr_expense_sheet.py:0
#, python-format
msgid "There are no expense reports to approve."
msgstr "لا توجد تقارير نفقات للموافقة عليها. "
#. module: hr_expense_custom
#: code:addons/hr_expense_custom/models/hr_expense_sheet.py:0
#, python-format
msgid "You can only approve your department expenses"
msgstr "يمكنك اعتماد مصروفات قسمك فقط"
#. module: hr_expense_custom
#: code:addons/hr_expense_custom/models/hr_expense_sheet.py:0
#, python-format
msgid "You cannot approve your own expenses"
msgstr "لا يمكنك اعتماد مصروفاتك بنفسك"