fix issue regarding security

This commit is contained in:
ronozoro 2024-10-13 17:00:26 -07:00
parent 221b1ab973
commit 04fcbe33bb
No known key found for this signature in database
GPG Key ID: 7C2BDED35C62C0F3
2 changed files with 25 additions and 12 deletions

View File

@ -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:58+0000\n"
"PO-Revision-Date: 2024-10-07 06:58+0000\n"
"POT-Creation-Date: 2024-10-13 23:59+0000\n"
"PO-Revision-Date: 2024-10-13 23:59+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -27,12 +27,6 @@ msgstr ""
msgid "Analytic Account"
msgstr "الحساب التحليلي"
#. module: exp_budget_check
#: code:addons/exp_budget_check/models/hr_expense.py:0
#, python-format
msgid "Analytic account %s is not linked with budget"
msgstr ""
#. module: exp_budget_check
#: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__budget_approve
#: model:ir.model.fields.selection,name:exp_budget_check.selection__hr_expense__state__budget_approve
@ -186,7 +180,7 @@ msgstr "الدفعات"
#: code:addons/exp_budget_check/models/hr_expense.py:0
#, python-format
msgid "Please Check Budget First"
msgstr "برجاء التحقق من الضريبة"
msgstr ""
#. module: exp_budget_check
#: code:addons/exp_budget_check/models/account_invoice.py:0
@ -264,7 +258,7 @@ msgstr ""
#: code:addons/exp_budget_check/models/hr_expense.py:0
#, python-format
msgid "The Expense account %s is assigned to more than one budget position %s"
msgstr "حساب المصروف %s مخصص لأكثر من مركز ميزانية %s"
msgstr ""
#. module: exp_budget_check
#: code:addons/exp_budget_check/models/account_budget.py:0
@ -302,6 +296,14 @@ msgstr "فاتورة المورد :%s"
msgid "Wait Budget"
msgstr "إنتظار تحقق الموازنة"
#. module: exp_budget_check
#: code:addons/exp_budget_check/wizard/payment_register.py:0
#, python-format
msgid ""
"You can not create payment for this invoice because there is a draft payment"
" for it"
msgstr "لا يمكنك إنشاء دفعة لهذه الفاتورة لأن هناك دفعة مسودة لها"
#. module: exp_budget_check
#: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation__type
msgid "type"

View File

@ -1,16 +1,27 @@
from odoo import models,fields
from odoo import models, fields, _
from odoo.exceptions import UserError
class AccountPayment(models.Model):
_inherit = "account.payment"
invoice_rec_id = fields.Many2one(comodel_name='account.move', string='Invoice', copy=False)
class AccountPaymentRegister(models.TransientModel):
_inherit = 'account.payment.register'
def _create_payments(self):
self.ensure_one()
active_id = self.env.context.get('active_id')
if active_id:
invoice_payment = self.env['account.payment'].search(
[('invoice_rec_id', '=', active_id),
('state', '=', 'draft')])
if invoice_payment:
raise UserError(
_('You can not create payment for this invoice because there is a draft payment for it'))
batches = self._get_batches()
edit_mode = self.can_edit_wizard and (len(batches[0]['lines']) == 1 or self.group_payment)
to_process = []
@ -50,4 +61,4 @@ class AccountPaymentRegister(models.TransientModel):
payment.invoice_rec_id = active_id
payment.action_cancel()
payment.action_draft()
return payments
return payments