diff --git a/odex25_accounting/account_budget_custom/__init__.py b/odex25_accounting/account_budget_custom/__init__.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/account_budget_custom/__manifest__.py b/odex25_accounting/account_budget_custom/__manifest__.py old mode 100644 new mode 100755 index d516d42f5..154e8cccd --- a/odex25_accounting/account_budget_custom/__manifest__.py +++ b/odex25_accounting/account_budget_custom/__manifest__.py @@ -8,9 +8,9 @@ """, 'author': "Expert Co. Ltd.", 'website': "http://www.exp-sa.com", - 'category': 'Odex25-Accounting/Odex25-Accounting', + 'category': 'Odex25 Accounting/Accounting', # any module necessary for this one to work correctly - 'depends': ['base','odex25_account_budget', 'odex25_account_reports', 'report_xlsx'], + 'depends': ['odex25_account_budget', 'odex25_account_reports', 'report_xlsx'], # always loaded 'data': [ 'data/budget_operation_data.xml', diff --git a/odex25_accounting/account_budget_custom/data/budget_operation_data.xml b/odex25_accounting/account_budget_custom/data/budget_operation_data.xml old mode 100644 new mode 100755 diff --git a/odex25_accounting/account_budget_custom/i18n/ar_001.po b/odex25_accounting/account_budget_custom/i18n/ar_001.po index a9845b10e..4c55e7ff5 100644 --- a/odex25_accounting/account_budget_custom/i18n/ar_001.po +++ b/odex25_accounting/account_budget_custom/i18n/ar_001.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-08 11:11+0000\n" -"PO-Revision-Date: 2024-05-08 11:11+0000\n" +"POT-Creation-Date: 2024-06-26 18:41+0000\n" +"PO-Revision-Date: 2024-06-26 18:41+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -66,9 +66,40 @@ msgstr "السماح بتخطي الموازنة" #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation__total_amount #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation_line__amount #: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations__amount +#: model_terms:ir.ui.view,arch_db:account_budget_custom.view_budget_operations msgid "Amount" msgstr "مبلغ" +#. module: account_budget_custom +#: code:addons/account_budget_custom/models/account_budget.py:0 +#: model:ir.model.fields,help:account_budget_custom.field_crossovered_budget_lines__above_remain +#, python-format +msgid "Amount of money that has been exceeded" +msgstr "" +" هي المبالغ التي تم صرفها بعد انتهاء رصيد المتبقى من الموازنة في حالة " +"التجاوز الموازنة" + +#. module: account_budget_custom +#: code:addons/account_budget_custom/models/account_budget.py:0 +#: model:ir.model.fields,help:account_budget_custom.field_crossovered_budget_lines__provide +#, python-format +msgid "Amount of money that has been provided" +msgstr "تعزيز او تحويل من هو عبارة عن تعزيزات الموازنة او تحويلات من موزانات أخرى" + +#. module: account_budget_custom +#: code:addons/account_budget_custom/models/account_budget.py:0 +#: model:ir.model.fields,help:account_budget_custom.field_crossovered_budget_lines__pull_out +#, python-format +msgid "Amount of money that has been pulled out" +msgstr "تخفيض او تحويل الى هو عبارة عن تخفيضات للموازنة او تحويلات الى موزانات أخرى" + +#. module: account_budget_custom +#: code:addons/account_budget_custom/models/account_budget.py:0 +#: model:ir.model.fields,help:account_budget_custom.field_crossovered_budget_lines__remain +#, python-format +msgid "Amount of money that has been remained" +msgstr " ( مبلغ متاح - المبلغ المحجوز - مبلغ تعميد - المبلغ الفعلى - المحجوز المبدئي ) يكون صفر عند قابل الاشارة" + #. module: account_budget_custom #: model_terms:ir.ui.view,arch_db:account_budget_custom.view_budget_confirmation_form msgid "Approve" @@ -88,6 +119,7 @@ msgstr "المستفيد" #. module: account_budget_custom #: model:ir.model,name:account_budget_custom.model_crossovered_budget +#: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation_line__crossovered_budget_id #: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations__from_crossovered_budget_id #: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations__to_crossovered_budget_id msgid "Budget" @@ -131,6 +163,7 @@ msgstr "بند الموازنة" #. module: account_budget_custom #: code:addons/account_budget_custom/reports/budget_report_xlsx.py:0 +#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget__crossovered_budget_line #: model_terms:ir.ui.view,arch_db:account_budget_custom.view_crossovered_budget_line_graph #: model_terms:ir.ui.view,arch_db:account_budget_custom.view_crossovered_budget_line_pivot #: model_terms:ir.ui.view,arch_db:account_budget_custom.view_crossovered_budget_line_tree @@ -199,15 +232,21 @@ msgid "Budget XLSX Report" msgstr "تقرير الموازنة (اكسل)" #. module: account_budget_custom -#: model:ir.model,name:account_budget_custom.model_account_budget_post -msgid "Budgetary Position" -msgstr "بند الموازنة" +#: code:addons/account_budget_custom/models/account_budget.py:0 +#, python-format +msgid "Budget lines can not be overlaped with another." +msgstr "لا يمكن تراكب خطوط الميزانية مع بعضها البعض." #. module: account_budget_custom #: model:ir.ui.menu,name:account_budget_custom.main_budgets_menu msgid "Budgets" msgstr "الموازنات" +#. module: account_budget_custom +#: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation__bybass_budget_check +msgid "ByPass Budget Line Check" +msgstr "تخطي ربط الموازنه بالحساب" + #. module: account_budget_custom #: model:ir.model.fields.selection,name:account_budget_custom.selection__budget_confirmation__state__cancel msgid "Cancel" @@ -239,21 +278,16 @@ msgstr "" msgid "Confirm" msgstr "تأكيد" -#. module: account_budget_custom -#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__confirm -msgid "Confirm Amount" -msgstr "المبلغ المصدق" - -#. module: account_budget_custom -#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__budget_confirm_amount -msgid "Confirmation Amount" -msgstr "مبلغ التصديق" - #. module: account_budget_custom #: model:ir.model.fields.selection,name:account_budget_custom.selection__budget_operations__state__confirmed msgid "Confirmed" msgstr "مؤكد" +#. module: account_budget_custom +#: model:ir.model,name:account_budget_custom.model_res_partner +msgid "Contact" +msgstr "جهة الاتصال" + #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation__analytic_account_id #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation_line__analytic_account_id @@ -325,9 +359,12 @@ msgstr "تفاصيل المطابقة" #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation__display_name #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation_line__display_name #: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations__display_name +#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget__display_name +#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__display_name #: model:ir.model.fields,field_description:account_budget_custom.field_reject_wizard__display_name #: model:ir.model.fields,field_description:account_budget_custom.field_report_account_budget_custom_budget_report__display_name #: model:ir.model.fields,field_description:account_budget_custom.field_report_account_budget_custom_budget_xslx_report__display_name +#: model:ir.model.fields,field_description:account_budget_custom.field_res_partner__display_name msgid "Display Name" msgstr "الاسم المعروض" @@ -346,12 +383,25 @@ msgstr "تم التعميد" msgid "Draft" msgstr "موظف الميزانية" +#. module: account_budget_custom +#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__above_remain +#: model_terms:ir.ui.view,arch_db:account_budget_custom.crossovered_budget_view_form +msgid "Exceed Amount" +msgstr "التجاوز الموازنة" + #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__final_amount #: model_terms:ir.ui.view,arch_db:account_budget_custom.crossovered_budget_view_form msgid "Final Amount" msgstr "المبلغ النهائي" +#. module: account_budget_custom +#: code:addons/account_budget_custom/models/account_budget.py:0 +#: model:ir.model.fields,help:account_budget_custom.field_crossovered_budget_lines__final_amount +#, python-format +msgid "Final amount of money that has been provided" +msgstr "هو مبلغ الموازنة المتاح للارتباط ويشمل مبلغ المخطط + تعزيز او تحويل من - تخفيض او تحويل الى" + #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation__message_follower_ids #: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations__message_follower_ids @@ -399,11 +449,14 @@ msgstr "من العملية" #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation__id #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation_line__id #: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations__id +#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget__id +#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__id #: model:ir.model.fields,field_description:account_budget_custom.field_reject_wizard__id #: model:ir.model.fields,field_description:account_budget_custom.field_report_account_budget_custom_budget_report__id #: model:ir.model.fields,field_description:account_budget_custom.field_report_account_budget_custom_budget_xslx_report__id +#: model:ir.model.fields,field_description:account_budget_custom.field_res_partner__id msgid "ID" -msgstr "المرجع" +msgstr "المُعرف" #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations__activity_exception_icon @@ -442,18 +495,16 @@ msgstr "تعزيز" msgid "Is Follower" msgstr "متابع" -#. module: account_budget_custom -#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__is_transfered -msgid "Is Transfered" -msgstr "" - #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation____last_update #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation_line____last_update #: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations____last_update +#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget____last_update +#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines____last_update #: model:ir.model.fields,field_description:account_budget_custom.field_reject_wizard____last_update #: model:ir.model.fields,field_description:account_budget_custom.field_report_account_budget_custom_budget_report____last_update #: model:ir.model.fields,field_description:account_budget_custom.field_report_account_budget_custom_budget_xslx_report____last_update +#: model:ir.model.fields,field_description:account_budget_custom.field_res_partner____last_update msgid "Last Modified on" msgstr "آخر تعديل في" @@ -590,7 +641,7 @@ msgstr "المبلغ الفعلي" #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__provide msgid "Provide" -msgstr "الدعومات" +msgstr "تعزيز/تحويل من" #. module: account_budget_custom #: model_terms:ir.ui.view,arch_db:account_budget_custom.crossovered_budget_view_form @@ -601,7 +652,7 @@ msgstr "مبلغ الدعم" #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__pull_out msgid "Pull Out" -msgstr "تخفيض" +msgstr "تخفيض/تحويل إلي" #. module: account_budget_custom #: model_terms:ir.ui.view,arch_db:account_budget_custom.crossovered_budget_view_form @@ -612,29 +663,23 @@ msgstr "مبلغ السحب" #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__purchase_remain msgid "Purchase Remain" -msgstr "المتبقي من التعميد" +msgstr "المبلغ" #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations__purchase_remind msgid "Purchase Remind" -msgstr "المتبقي من التعميد" +msgstr "المبلغ" #. module: account_budget_custom #: model:ir.model.fields.selection,name:account_budget_custom.selection__budget_confirmation__type__purchase_request msgid "Purchase Request" -msgstr "طلب شراء" +msgstr "" #. module: account_budget_custom #: model:ir.model.fields.selection,name:account_budget_custom.selection__budget_confirmation__type__purchase_order msgid "Purchase Requisition" msgstr "" -#. module: account_budget_custom -#: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation__reason -#: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations__reason -msgid "Reason/Justification" -msgstr "السببظ المبرر" - #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation__ref msgid "Reference" @@ -648,10 +693,14 @@ msgstr "رفض" #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation__reject_reason -#: model:ir.model.fields,field_description:account_budget_custom.field_reject_wizard__reject_reason msgid "Reject Reason" msgstr "سبب الرفض" +#. module: account_budget_custom +#: model:ir.model.fields,field_description:account_budget_custom.field_reject_wizard__reject_reason +msgid "Reject Reson" +msgstr "سبب الرفض" + #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation__res_model msgid "Related Document Model Name" @@ -660,7 +709,7 @@ msgstr "اسم كائن المستند المرتبط" #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_budget_confirmation_line__remain msgid "Remain" -msgstr "الباقي" +msgstr "المبلغ المتاح" #. module: account_budget_custom #: model_terms:ir.ui.view,arch_db:account_budget_custom.crossovered_budget_view_form @@ -688,12 +737,6 @@ msgstr "التقارير" msgid "Request user" msgstr "المستخدم الطالب" -#. module: account_budget_custom -#: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__reserve -#: model_terms:ir.ui.view,arch_db:account_budget_custom.crossovered_budget_view_form -msgid "Reserve Amount" -msgstr "المبلغ المحجوز" - #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_budget_operations__from_reserved msgid "Reserve?" @@ -738,6 +781,12 @@ msgstr "" msgid "Sorry, No data to Print" msgstr "لا يوجد بيانات ليتم طباعتها" +#. module: account_budget_custom +#: code:addons/account_budget_custom/models/account_budget.py:0 +#, python-format +msgid "Sources Sale Orders %s" +msgstr "" + #. module: account_budget_custom #: code:addons/account_budget_custom/models/budget_confirmation.py:0 #, python-format @@ -770,17 +819,26 @@ msgstr "" "اليوم: تاريخ النشاط هو اليوم\n" "المخطط: الأنشطة المستقبلية." +#. module: account_budget_custom +#: code:addons/account_budget_custom/models/budget_operations.py:0 +#, python-format +msgid "The amount must be less than or equal to the budget line final amount" +msgstr "يجب ان يكون المبلغ اقل او يساوي المبلغ النهائي للبند الموازنة" + +#. module: account_budget_custom +#: code:addons/account_budget_custom/models/budget_operations.py:0 +#: code:addons/account_budget_custom/models/budget_operations.py:0 +#: code:addons/account_budget_custom/models/budget_operations.py:0 +#: code:addons/account_budget_custom/models/budget_operations.py:0 +#, python-format +msgid "The date must be between the budget %s post period" +msgstr "يجب ان يكون التاريخ مقابل للفتره المحدده %s" + #. module: account_budget_custom #: model:ir.model.fields,field_description:account_budget_custom.field_crossovered_budget_lines__theoritical_amount msgid "Theoretical Amount" msgstr "القيمة النظرية" -#. module: account_budget_custom -#: code:addons/account_budget_custom/models/account_budget.py:0 -#, python-format -msgid "This position can not be deleted" -msgstr "لا يمكن حذف مركز موازنة" - #. module: account_budget_custom #: model_terms:ir.ui.view,arch_db:account_budget_custom.view_budget_operations msgid "To" @@ -812,6 +870,13 @@ msgstr "إجمالي المبلغ" msgid "Total amount in services request line" msgstr "المبلغ" +#. module: account_budget_custom +#: code:addons/account_budget_custom/models/account_budget.py:0 +#: model:ir.model.fields,help:account_budget_custom.field_crossovered_budget_lines__practical_amount +#, python-format +msgid "Total amount of money that has been spent" +msgstr "" + #. module: account_budget_custom #: model:ir.model.fields.selection,name:account_budget_custom.selection__budget_operations__operation_type__transfer #: model:ir.model.fields.selection,name:account_budget_custom.selection__budget_operations__type__transfer @@ -865,9 +930,10 @@ msgstr "نهاية السنة" #. module: account_budget_custom #: code:addons/account_budget_custom/models/budget_operations.py:0 +#: code:addons/account_budget_custom/models/budget_operations.py:0 #, python-format msgid "You can transfer to approved budget only" -msgstr "" +msgstr "يمكنك التحويل الى موازنة معتمدة فقط" #. module: account_budget_custom #: code:addons/account_budget_custom/models/account_budget.py:0 @@ -877,11 +943,6 @@ msgstr "لا يمكن حذف موازنة ليست في مرحلة مسودة" #. module: account_budget_custom #: code:addons/account_budget_custom/models/account_budget.py:0 -#, python-format -msgid "You can not take more than the remaining amount" -msgstr "لا يمكن أخذ أكثر من المبلغ المتبقي" - -#. module: account_budget_custom #: code:addons/account_budget_custom/models/account_budget.py:0 #, python-format msgid "You can not take more than the remaining amount.." @@ -985,8 +1046,13 @@ msgstr "" msgid "تاريخ البدء" msgstr "" +#. module: account_budget_custom +#: model_terms:ir.ui.view,arch_db:account_budget_custom.crossovered_budget_view_form +msgid "مبلغ نهائي" +msgstr "" + #. module: account_budget_custom #: code:addons/account_budget_custom/reports/budget_report_xlsx.py:0 #, python-format msgid "وضع المـوازنـة" -msgstr "" \ No newline at end of file +msgstr "بند المـوازنـة" diff --git a/odex25_accounting/account_budget_custom/models/__init__.py b/odex25_accounting/account_budget_custom/models/__init__.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/account_budget_custom/models/account_budget.py b/odex25_accounting/account_budget_custom/models/account_budget.py index 7738d5e91..b1dabdf19 100644 --- a/odex25_accounting/account_budget_custom/models/account_budget.py +++ b/odex25_accounting/account_budget_custom/models/account_budget.py @@ -2,14 +2,6 @@ from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError -class AccountBudgetPost(models.Model): - _inherit = "account.budget.post" - - def unlink(self): - raise ValidationError(_('This position can not be deleted')) - # return super(AccountBudgetPost, self).unlink() - - class CrossoveredBudget(models.Model): _inherit = "crossovered.budget" _order = "create_date desc" @@ -18,6 +10,7 @@ class CrossoveredBudget(models.Model): currency_id = fields.Many2one('res.currency', string='Currency', readonly=True, required=True, default=lambda self: self.env.user.company_id.currency_id.id) + crossovered_budget_line = fields.One2many(copy=False) def unlink(self): for budget in self: @@ -25,36 +18,114 @@ class CrossoveredBudget(models.Model): raise UserError(_('You can not delete budget not in draft state')) return super(CrossoveredBudget, self).unlink() + def copy(self, default=None): + default = dict(default or {}) + default.update({ + 'name': self.name + ' (copy)', + 'state': 'draft', + }) + return super(CrossoveredBudget, self).copy(default) + + # check that budget period doesn't overlap with another budget + @api.constrains('crossovered_budget_line', 'date_from', 'date_to') + def _check_budget_line_period(self): + for budget in self: + if budget.state == 'done': + continue + for line in budget.crossovered_budget_line: + domain = [ + ('crossovered_budget_id.date_from', '<=', budget.date_to), + ('crossovered_budget_id.date_to', '>=', budget.date_from), + ('crossovered_budget_id.state', '=', 'done'), + ('id', '!=', line.id), + ('analytic_account_id', '=', line.analytic_account_id.id), + ('general_budget_id', '=', line.general_budget_id.id), + ] + if self.env['crossovered.budget.lines'].search_count(domain): + raise ValidationError(_('Budget lines can not be overlaped with another.')) + class CrossoveredBudgetLines(models.Model): _inherit = "crossovered.budget.lines" reserved_percent = fields.Float(related='crossovered_budget_id.reserved_percent', string='Reserved Percent') reserved_amount = fields.Float(string='Reserved Amount', readonly=True, compute='_compute_reserved_amount') - # pull_out = fields.Float(string='Pull Out', compute='_compute_operations_amount', store=True, tracking=True) - pull_out = fields.Monetary(string='Pull Out') + pull_out = fields.Monetary(string='Pull Out', compute='_compute_pull_out', + help=_('Amount of money that has been pulled out'),store=True) - provide = fields.Float(string='Provide', compute='_compute_operations_amount', store=True) - remain = fields.Float(string='Remain of Christening', compute='_compute_operations_amount') - budget_confirm_amount = fields.Float(string='Confirmation Amount', compute='_compute_operations_amount') + provide = fields.Float(string='Provide', compute='_compute_provide', + help=_('Amount of money that has been provided'),store=True) + + remain = fields.Float(string='Remain of Christening', compute='_compute_remain',help=_('Amount of money that has been remained')) + above_remain = fields.Float(string='Exceed Amount', compute='_compute_remain', + help=_('Amount of money that has been exceeded')) purchase_remain = fields.Float(store=True) practical_amount = fields.Float(compute='_compute_practical_amount', string='Practical Amount', digits=0, - store=False) + store=False, help=_('Total amount of money that has been spent')) theoritical_amount = fields.Float(compute='_compute_theoritical_amount', string='Theoretical Amount', digits=0, store=True) percentage = fields.Float(compute='_compute_percentage', string='Achievement', store=False, digits=(16, 4)) from_operation_ids = fields.One2many('budget.operations', 'from_budget_line_id', string='From Operation') to_operation_ids = fields.One2many('budget.operations', 'to_budget_line_id', string='Cost Center') - reserve = fields.Float(string='Last Reserve Amount') - confirm = fields.Float(string='Confirm Amount') year_end = fields.Boolean(compute="get_year_end") - is_transfered = fields.Boolean(default=False) - final_amount = fields.Float(compute='_compute_final_amount') - @api.depends('planned_amount', 'pull_out', 'provide') + final_amount = fields.Float(string='Final Amount', compute='_compute_final_amount', + help=_('Final amount of money that has been provided'),store=True) + + reserve = fields.Float(string='Reserve Amount', compute='_compute_reserve', + help=_('Total amount of reserved purchase orders')) + + confirm = fields.Float(string='Confirm Amount', compute='_compute_confirm', + help=_('Total amount of confirmed purchase orders')) + + @api.depends('analytic_account_id') + def _compute_confirm(self): + for rec in self: + orders = self.env['purchase.order.line'].search( + [('account_analytic_id', '=', rec.analytic_account_id.id), + ('order_id.state', 'in', ['purchase'])]).mapped('order_id') + total_orders = sum(orders.mapped('amount_total')) + invoiced = self.env['account.move'].search( + [('purchase_id', 'in', orders.ids), ('state', 'not in', ['draft', 'cancel'])]).mapped('amount_total') + rec.confirm = (total_orders - sum(invoiced)) * -1 + + @api.depends('analytic_account_id') + def _compute_reserve(self): + for rec in self: + orders = self.env['purchase.order.line'].search( + [('account_analytic_id', '=', rec.analytic_account_id.id), + ('order_id.state', 'in', ['draft', 'sent', 'to approve'])]).mapped('order_id') + total_orders = sum(orders.mapped('amount_total')) + rec.reserve = total_orders * -1 + + @api.depends('planned_amount', 'provide', 'pull_out') def _compute_final_amount(self): + for rec in self: + rec.final_amount = rec.planned_amount + rec.provide + rec.pull_out + + @api.depends('from_operation_ids') + def _compute_pull_out(self): for line in self: - line.final_amount = line.planned_amount + line.provide - line.pull_out + pull_out = sum(op.amount + op.purchase_remind for op in + line.from_operation_ids.filtered(lambda x: x.state == 'confirmed') if + op.operation_type == 'transfer' or op.operation_type == 'decrease') + line.pull_out = pull_out if line.planned_amount < 0 else pull_out * -1 + + @api.depends('to_operation_ids') + def _compute_provide(self): + for line in self: + provide = sum(op.amount + op.purchase_remind for op in + line.to_operation_ids.filtered(lambda x: x.state == 'confirmed') if + op.operation_type == 'transfer' or op.operation_type == 'increase') + line.provide = provide * -1 if line.planned_amount < 0 else provide + + @api.depends('to_operation_ids', 'from_operation_ids') + def _compute_remain(self): + for line in self: + remain_value = ((abs(line.final_amount) - abs(line.reserve) - abs(line.confirm) - abs( + line.practical_amount)) * -1) + line.remain = 0 if remain_value > 0 else remain_value + line.above_remain = remain_value if remain_value > 0 else 0 def get_year_end(self): for rec in self: @@ -85,69 +156,6 @@ class CrossoveredBudgetLines(models.Model): } } - @api.depends('from_operation_ids', 'to_operation_ids') - def _compute_operations_amount(self): - if not self.ids: return - for line in self: - pull_out = provide = budget_confirm_amount = purchase_remind = reserve_amount = 0.0 - date_to = self.env.context.get('wizard_date_to') or line.date_to - date_from = self.env.context.get( - 'wizard_date_from') or line.date_from - - if line.analytic_account_id.id: - if 'reserved' not in self.env.context: - self.env.cr.execute(""" - SELECT SUM(amount) - FROM budget_operations - WHERE from_budget_line_id=%s - AND (date between %s AND %s) - AND state='confirmed'""", - (line._origin.id, date_from, date_to,)) - pull_out = self.env.cr.fetchone()[0] or 0.0 - - if 'reserved' in self.env.context: - self.env.cr.execute(""" - SELECT SUM(amount) - FROM budget_operations - WHERE from_budget_line_id=%s - AND (date between %s AND %s) - AND state='confirmed' - AND from_reserved=%s""", - (line._origin.id, date_from, date_to, self.env.context['reserved'])) - pull_out = self.env.cr.fetchone()[0] or 0.0 - - self.env.cr.execute(""" - SELECT SUM(amount) - FROM budget_operations - WHERE to_budget_line_id=%s - AND (date between %s AND %s) - AND state='confirmed'""", - (line._origin.id, date_from, date_to,)) - provide = self.env.cr.fetchone()[0] or 0.0 - - self.env.cr.execute(""" - SELECT SUM(purchase_remind) - FROM budget_operations - WHERE to_budget_line_id=%s - AND (date between %s AND %s) - AND state='confirmed'""", - (line._origin.id, date_from, date_to,)) - reserve_amount = self.env.cr.fetchone()[0] or 0.0 - - self.env.cr.execute(""" - SELECT SUM(amount) - FROM budget_confirmation_line - WHERE budget_line_id=%s - AND (date between %s AND %s) - AND state='done'""", - (line._origin.id, date_from, date_to,)) - budget_confirm_amount = self.env.cr.fetchone()[0] or 0.0 - - line.provide = provide - line.budget_confirm_amount = budget_confirm_amount - # line.remain = line.planned_amount + provide + line.pull_out - line.practical_amount + line.reserve + line.purchase_remain - line.remain = line.final_amount - line.practical_amount - @api.depends('analytic_account_id', 'planned_amount', 'practical_amount') def name_get(self): result = [] @@ -155,13 +163,7 @@ class CrossoveredBudgetLines(models.Model): for line in self: name = '' name += line.analytic_account_id and line.analytic_account_id.name or '' + ' ' + _('remaining') + ' ' - - # check if reserved is needed - if self.env.context.get('reserved', False): - name += str(line.reserved_amount) - - if not self.env.context.get('reserved', False): - name += str(line.remain) + name += str(line.final_amount) result.append((line.id, name)) return result @@ -215,20 +217,41 @@ class CrossoveredBudgetLines(models.Model): def _check_amount(self, amount=0, purchase_remind=0, transfer=False): for obj in self: - if self.from_operation_ids.operation_type=='transfer' and self.from_operation_ids.purchase_remind>obj.final_amount: - raise ValidationError(_('''You can not take more than the remaining amount..''')) - # if obj.purchase_remain> - reserved_amount = obj.crossovered_budget_id.reserved_percent * \ obj.planned_amount / 100.0 + if obj.with_context({'reserved': True}).pull_out > reserved_amount: raise ValidationError( _('''You can not take more than the reserved amount.''')) - if obj.planned_amount < 0: - if transfer and obj.purchase_remain != purchase_remind: - raise ValidationError(_('''You can not take more than the remaining amount..''')) - else: - if abs(obj.remain) < amount or obj.purchase_remain < purchase_remind: - raise ValidationError( - _('''You can not take more than the remaining amount''')) + if transfer and abs(obj.remain) < abs(purchase_remind): + raise ValidationError( + _('''You can not take more than the remaining amount..''')) + + if amount and amount > obj.remain: + raise ValidationError( + _('''You can not take more than the remaining amount..''')) + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + def action_view_sale_orders(self): + self.ensure_one() + sale_order_ids = self._get_sale_orders().ids + action = { + 'res_model': 'sale.order', + 'type': 'ir.actions.act_window', + } + if len(sale_order_ids) == 1: + action.update({ + 'view_mode': 'form', + 'res_id': sale_order_ids[0], + }) + else: + action.update({ + 'name': _('Sources Sale Orders %s', self.name), + 'domain': [('id', 'in', sale_order_ids)], + 'view_mode': 'tree,form', + }) + return action diff --git a/odex25_accounting/account_budget_custom/models/budget_confirmation.py b/odex25_accounting/account_budget_custom/models/budget_confirmation.py old mode 100644 new mode 100755 index d02406d9f..117cd49f2 --- a/odex25_accounting/account_budget_custom/models/budget_confirmation.py +++ b/odex25_accounting/account_budget_custom/models/budget_confirmation.py @@ -198,6 +198,11 @@ class BudgetConfirmationLine(models.Model): description = fields.Text( string='Description' ) + crossovered_budget_id = fields.Many2one( + comodel_name='crossovered.budget', + string='Budget', + related='budget_line_id.crossovered_budget_id', + ) def check_budget(self): """ @@ -245,4 +250,8 @@ class RejectWizard(models.TransientModel): raise ValidationError(_('Sorry This object have no field named Selection Reason')) else: origin_rec.write({'reject_reason': self.reject_reason}) + if origin_rec.po_id: + origin_rec.po_id.message_post(body=self.reject_reason) + if origin_rec.invoice_id: + origin_rec.invoice_id.message_post(body=self.reject_reason) return origin_rec.with_context({'reject_reason': self.reject_reason}).cancel() \ No newline at end of file diff --git a/odex25_accounting/account_budget_custom/models/budget_operations.py b/odex25_accounting/account_budget_custom/models/budget_operations.py old mode 100644 new mode 100755 index 27a793e67..8bdee11eb --- a/odex25_accounting/account_budget_custom/models/budget_operations.py +++ b/odex25_accounting/account_budget_custom/models/budget_operations.py @@ -20,21 +20,21 @@ class BudgetOperations(models.Model): name = fields.Char(string='Name', default='/') department_id = fields.Many2one(comodel_name='hr.department', string='Department') - from_crossovered_budget_id = fields.Many2one(comodel_name='crossovered.budget', string='Budget', tracking=True) - from_budget_line_id = fields.Many2one(comodel_name='crossovered.budget.lines', string='Cost Center', tracking=True) - to_crossovered_budget_id = fields.Many2one(comodel_name='crossovered.budget', string='Budget', tracking=True) - to_budget_line_id = fields.Many2one(comodel_name='crossovered.budget.lines', string='Cost Center', tracking=True) + from_crossovered_budget_id = fields.Many2one(comodel_name='crossovered.budget', string='Budget', tracking=True,copy=False) + from_budget_line_id = fields.Many2one(comodel_name='crossovered.budget.lines', string='Cost Center', tracking=True,copy=False) + to_crossovered_budget_id = fields.Many2one(comodel_name='crossovered.budget', string='Budget', tracking=True,copy=False) + to_budget_line_id = fields.Many2one(comodel_name='crossovered.budget.lines', string='Cost Center', tracking=True,copy=False) amount = fields.Monetary(string='Amount', tracking=True) currency_id = fields.Many2one(comodel_name='res.currency', string='Currency', readonly=True, required=True, default=lambda self: self.env.user.company_id.currency_id.id) state = fields.Selection(selection=[('draft', 'Draft'), ('confirmed', 'Confirmed')], - default='draft', string='Status', readonly=True, tracking=True) + default='draft', string='Status', readonly=True, tracking=True,copy=False) type = fields.Selection(selection=[('unlock', 'Unlock'), ('transfer', 'Transfer')], default='transfer', string='type', readonly=True, tracking=True) date = fields.Date() - from_reserved = fields.Boolean(string='Reserve?', tracking=True) - from_budget_post_id = fields.Many2one(comodel_name='account.budget.post', string='Budget Post', tracking=True) - to_budget_post_id = fields.Many2one(comodel_name='account.budget.post', string='Budget Post', tracking=True) + from_reserved = fields.Boolean(string='Reserve?', tracking=True,copy=False) + from_budget_post_id = fields.Many2one(comodel_name='account.budget.post', string='Budget Post', tracking=True,copy=False) + to_budget_post_id = fields.Many2one(comodel_name='account.budget.post', string='Budget Post', tracking=True,copy=False) operation_type = fields.Selection( selection=[('transfer', 'Transfer'), ('increase', 'Increase'), ('decrease', 'Decrease')], default='transfer', string='Operation Type', required=True, tracking=True) @@ -68,6 +68,18 @@ class BudgetOperations(models.Model): self.from_budget_post_id = False self.from_reserved = False + @api.onchange('from_crossovered_budget_id', 'to_crossovered_budget_id', 'date') + def _onchange_budget_check_period(self): + if self.from_crossovered_budget_id and self.date: + if self.from_crossovered_budget_id.date_from > self.date or self.from_crossovered_budget_id.date_to < self.date: + raise ValidationError( + _('The date must be between the budget %s post period') % (self.from_crossovered_budget_id.name)) + + if self.to_crossovered_budget_id and self.date: + if self.to_crossovered_budget_id.date_from > self.date or self.to_crossovered_budget_id.date_to < self.date: + raise ValidationError( + _('The date must be between the budget %s post period') % (self.from_crossovered_budget_id.name)) + @api.onchange('from_budget_post_id') def _onchange_from_budget_post(self): domain = [('id', 'in', [])] @@ -86,7 +98,7 @@ class BudgetOperations(models.Model): if self.to_budget_post_id: budget_line_obj = self.env['crossovered.budget.lines'] search_domain = [('general_budget_id', '=', self.to_budget_post_id.id)] - if self.operation_type == 'transfer' and self.from_crossovered_budget_id: + if self.operation_type == 'transfer' and self.from_crossovered_budget_id.date_to: search_domain += [('date_to', '>', str(self.from_crossovered_budget_id.date_to))] budget_line = budget_line_obj.search(search_domain) domain = [('id', 'in', budget_line.mapped('crossovered_budget_id').ids)] @@ -118,25 +130,26 @@ class BudgetOperations(models.Model): self.state = 'draft' def confirm(self): - """ - """ - if self.date and self.to_crossovered_budget_id: + if self.from_crossovered_budget_id and self.date and self.operation_type in ['transfer', 'decrease']: + if self.from_crossovered_budget_id.date_from > self.date or self.from_crossovered_budget_id.date_to < self.date: + raise ValidationError( + _('The date must be between the budget %s post period') % (self.from_crossovered_budget_id.name)) - budget_start_date = self.to_crossovered_budget_id.date_from - budget_end_date = self.to_crossovered_budget_id.date_to + if self.to_crossovered_budget_id and self.date and self.operation_type in ['transfer', 'increase']: + if self.to_crossovered_budget_id.date_from > self.date or self.to_crossovered_budget_id.date_to < self.date: + raise ValidationError( + _('The date must be between the budget %s post period') % (self.from_crossovered_budget_id.name)) - - if self.date < budget_start_date or self.date > budget_end_date: - raise ValidationError(_('The operation date must be within the budget duration.')) - if self.to_crossovered_budget_id and self.to_crossovered_budget_id.state != 'done': + if self.to_crossovered_budget_id.state != 'done' and self.operation_type in ['transfer', 'increase']: raise ValidationError( _('You can transfer to approved budget only')) - self.to_budget_line_id.pull_out = self.purchase_remind - transfer = True if self.operation_type == 'transfer' else False - self.from_budget_line_id._check_amount(self.amount, self.purchase_remind, transfer) - # self.from_budget_line_id.is_transfered = True - if self.type == 'unlock': - self.from_reserved = True - self.to_crossovered_budget_id = self.from_crossovered_budget_id.id - self.to_budget_line_id = self.from_budget_line_id.id + + if self.from_crossovered_budget_id.state != 'done' and self.operation_type in ['transfer', 'decrease']: + raise ValidationError( + _('You can transfer to approved budget only')) + + if self.operation_type=='transfer': + if abs(self.from_budget_line_id.final_amount) < abs(self.purchase_remind): + raise ValidationError( + _('The amount must be less than or equal to the budget line final amount')) self.state = 'confirmed' diff --git a/odex25_accounting/account_budget_custom/reports/__init__.py b/odex25_accounting/account_budget_custom/reports/__init__.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/account_budget_custom/reports/budget_report_xlsx.py b/odex25_accounting/account_budget_custom/reports/budget_report_xlsx.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/account_budget_custom/reports/reports.xml b/odex25_accounting/account_budget_custom/reports/reports.xml old mode 100644 new mode 100755 diff --git a/odex25_accounting/account_budget_custom/security/budget_groups.xml b/odex25_accounting/account_budget_custom/security/budget_groups.xml index 60f4c2128..80ba9d059 100644 --- a/odex25_accounting/account_budget_custom/security/budget_groups.xml +++ b/odex25_accounting/account_budget_custom/security/budget_groups.xml @@ -3,14 +3,14 @@ Budget User - + Budget Department Manager - + @@ -18,7 +18,7 @@ Budget Executive Director - + diff --git a/odex25_accounting/account_budget_custom/security/ir.model.access.csv b/odex25_accounting/account_budget_custom/security/ir.model.access.csv old mode 100644 new mode 100755 diff --git a/odex25_accounting/account_budget_custom/static/description/icon.png b/odex25_accounting/account_budget_custom/static/description/icon.png old mode 100644 new mode 100755 diff --git a/odex25_accounting/account_budget_custom/static/fonts/ae_AlMohanad.ttf b/odex25_accounting/account_budget_custom/static/fonts/ae_AlMohanad.ttf old mode 100644 new mode 100755 diff --git a/odex25_accounting/account_budget_custom/static/src/css/website_rtl.css b/odex25_accounting/account_budget_custom/static/src/css/website_rtl.css old mode 100644 new mode 100755 diff --git a/odex25_accounting/account_budget_custom/views/account_budget_views.xml b/odex25_accounting/account_budget_custom/views/account_budget_views.xml old mode 100644 new mode 100755 index 285c6ffed..ad09f4343 --- a/odex25_accounting/account_budget_custom/views/account_budget_views.xml +++ b/odex25_accounting/account_budget_custom/views/account_budget_views.xml @@ -23,21 +23,41 @@ 1 + + show + + + show + + + show + + + show + + + show + + + show + - - - - - - - - + + + - - + + + @@ -64,6 +85,9 @@ + + + @@ -78,8 +102,13 @@ - + + + + + + @@ -92,17 +121,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/odex25_accounting/account_budget_custom/views/budget_confirmation_view.xml b/odex25_accounting/account_budget_custom/views/budget_confirmation_view.xml old mode 100644 new mode 100755 index fd2d966e7..c6e8ae7a2 --- a/odex25_accounting/account_budget_custom/views/budget_confirmation_view.xml +++ b/odex25_accounting/account_budget_custom/views/budget_confirmation_view.xml @@ -52,7 +52,6 @@ - @@ -105,6 +104,7 @@ + @@ -115,13 +115,14 @@ - - - + + + + - - - + + + diff --git a/odex25_accounting/account_budget_custom/views/budget_operations_view.xml b/odex25_accounting/account_budget_custom/views/budget_operations_view.xml old mode 100644 new mode 100755 index 0cd1b07de..634bfbea2 --- a/odex25_accounting/account_budget_custom/views/budget_operations_view.xml +++ b/odex25_accounting/account_budget_custom/views/budget_operations_view.xml @@ -61,7 +61,7 @@ - + diff --git a/odex25_accounting/exp_budget_check/i18n/ar.po b/odex25_accounting/exp_budget_check/i18n/ar.po index 736b045d4..63c69b39b 100644 --- a/odex25_accounting/exp_budget_check/i18n/ar.po +++ b/odex25_accounting/exp_budget_check/i18n/ar.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-28 11:05+0000\n" -"PO-Revision-Date: 2022-07-28 11:05+0000\n" +"POT-Creation-Date: 2024-06-26 18:16+0000\n" +"PO-Revision-Date: 2024-06-26 18:16+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -21,28 +21,27 @@ msgid "Analytic Account" msgstr "الحساب التحليلي" #. module: exp_budget_check -#: code:addons/exp_budget_check/models/account_invoice.py:0 #: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__budget_approve -#, python-format +#: model:ir.model.fields.selection,name:exp_budget_check.selection__hr_expense__state__budget_approve msgid "Approved" msgstr "موافقة" #. module: exp_budget_check -#: code:addons/exp_budget_check/models/account_invoice.py:0 -#: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__budget_check -#, python-format -msgid "Budget Check" -msgstr "فحص الموازنة" +#: model:ir.model.fields,field_description:exp_budget_check.field_account_analytic_account__is_auto_check +#: model:ir.model.fields,field_description:exp_budget_check.field_grant_project__is_auto_check +msgid "Auto Check" +msgstr "" #. module: exp_budget_check #: model:ir.model,name:exp_budget_check.model_budget_confirmation +#: model_terms:ir.ui.view,arch_db:exp_budget_check.budget_check_view_move_form msgid "Budget Confirmation" -msgstr "تصديق الموازنة" +msgstr "تعميد الموازنة" #. module: exp_budget_check #: model:ir.model,name:exp_budget_check.model_crossovered_budget_lines msgid "Budget Line" -msgstr "خط الموازنة" +msgstr "بند الموازنة" #. module: exp_budget_check #: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__cancel @@ -54,10 +53,13 @@ msgstr "ملغي" #: model:ir.model.fields,field_description:exp_budget_check.field_account_move__budget_check #: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__budget_check #: model_terms:ir.ui.view,arch_db:exp_budget_check.budget_check_view_move_form +#: model_terms:ir.ui.view,arch_db:exp_budget_check.hr_expense_view_form_inherit msgid "Check Budget" msgstr "فحص الموازنة" #. module: exp_budget_check +#: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__confirm +#: model:ir.model.fields.selection,name:exp_budget_check.selection__hr_expense__state__confirm #: model_terms:ir.ui.view,arch_db:exp_budget_check.budget_check_view_move_form msgid "Confirm" msgstr "تأكيد" @@ -66,7 +68,7 @@ msgstr "تأكيد" #: model:ir.model.fields,field_description:exp_budget_check.field_crossovered_budget_lines__confirm #: model_terms:ir.ui.view,arch_db:exp_budget_check.crossovered_budget_view_form_inherit msgid "Confirm Amount" -msgstr "المبلغ المصدق" +msgstr "المبلغ التعميد" #. module: exp_budget_check #: model_terms:ir.ui.view,arch_db:exp_budget_check.budget_check_view_move_form @@ -79,6 +81,7 @@ msgstr "تأكيد الفاتورة" #: model:ir.model.fields,field_description:exp_budget_check.field_account_move_line__display_name #: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation__display_name #: model:ir.model.fields,field_description:exp_budget_check.field_crossovered_budget_lines__display_name +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__display_name msgid "Display Name" msgstr "الاسم المعروض" @@ -94,12 +97,33 @@ msgstr "مسودة" msgid "Exceed Budget" msgstr "تخطي الموازنة" +#. module: exp_budget_check +#: model:ir.model,name:exp_budget_check.model_hr_expense +#: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation__expense_id +#: model:ir.model.fields.selection,name:exp_budget_check.selection__budget_confirmation__type__expense +msgid "Expense" +msgstr "المصروف" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "Expense :%s" +msgstr "" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__hide_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__hide_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__hide_budget +msgid "Hide Budget" +msgstr "" + #. module: exp_budget_check #: model:ir.model.fields,field_description:exp_budget_check.field_account_analytic_account__id #: model:ir.model.fields,field_description:exp_budget_check.field_account_move__id #: model:ir.model.fields,field_description:exp_budget_check.field_account_move_line__id #: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation__id #: model:ir.model.fields,field_description:exp_budget_check.field_crossovered_budget_lines__id +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__id msgid "ID" msgstr "المُعرف" @@ -112,6 +136,7 @@ msgstr "" #: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__is_approve #: model:ir.model.fields,field_description:exp_budget_check.field_account_move__is_approve #: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__is_approve +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__is_approve msgid "Is Approve" msgstr "" @@ -126,18 +151,14 @@ msgstr "" #: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__is_check #: model:ir.model.fields,field_description:exp_budget_check.field_account_move__is_check #: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__is_check +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__is_check msgid "Is Check" msgstr "" -#. module: exp_budget_check -#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__is_reject -#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__is_reject -#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__is_reject -msgid "Is Reject" -msgstr "" - #. module: exp_budget_check #: model:ir.model.fields,field_description:exp_budget_check.field_account_analytic_account__is_analytic_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_grant_project__is_analytic_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__is_budget msgid "Is Use In Budget" msgstr "يستخدم في الموازنة" @@ -157,9 +178,22 @@ msgstr "عنصر اليومية" #: model:ir.model.fields,field_description:exp_budget_check.field_account_move_line____last_update #: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation____last_update #: model:ir.model.fields,field_description:exp_budget_check.field_crossovered_budget_lines____last_update +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense____last_update msgid "Last Modified on" msgstr "آخر تعديل في" +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "New Expense Report" +msgstr "" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "Please Check Budget First" +msgstr "" + #. module: exp_budget_check #: code:addons/exp_budget_check/models/account_invoice.py:0 #, python-format @@ -169,8 +203,8 @@ msgstr "الرجاء إختيار حسابات تحليلية لهذه الفا #. module: exp_budget_check #: code:addons/exp_budget_check/models/account_invoice.py:0 #, python-format -msgid "Please Set An Expense Account For Product %s" -msgstr "الرجاء إختيار حساب للمنتج%s" +msgid "Please insert Bill Date" +msgstr "الرجاء إدخال تاريخ الفاتورة" #. module: exp_budget_check #: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__posted @@ -178,11 +212,11 @@ msgid "Posted" msgstr "مُرحل" #. module: exp_budget_check -#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__reject -#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__reject -#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__reject -msgid "Reject" -msgstr "رفض" +#: code:addons/exp_budget_check/models/account_invoice.py:0 +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "Rejected By : %s With Reject Reason : %s" +msgstr "تم الرقض بواسطة %s . مع سبب الرقض : %s" #. module: exp_budget_check #: model:ir.model.fields,field_description:exp_budget_check.field_crossovered_budget_lines__reserve @@ -202,19 +236,39 @@ msgstr "المبلغ المحجوز" #: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__state_a #: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__state_b #: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__state_bill +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__state msgid "Status" msgstr "الحالة" +#. module: exp_budget_check +#: model:ir.model.fields,help:exp_budget_check.field_hr_expense__state +msgid "Status of the expense." +msgstr "حالة المصروف." + #. module: exp_budget_check #: model:ir.model.fields,field_description:exp_budget_check.field_account_move_line__price_tax msgid "Tax" msgstr "ضريبة" #. module: exp_budget_check -#: code:addons/exp_budget_check/models/account_invoice.py:0 +#: code:addons/exp_budget_check/models/hr_expense.py:0 #, python-format -msgid "The Budget Has Been Rejected" -msgstr "تم رفض الموازنة لهذه الفاتورة" +msgid "The Budget Confirmation Doesn't Approve yet" +msgstr "" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/account_budget.py:0 +#: model:ir.model.fields,help:exp_budget_check.field_crossovered_budget_lines__confirm +#, python-format +msgid "Total amount of confirmed purchase orders" +msgstr "المبلغ التعميد : هو عبارة قيمة التعميد ( أوامر الشراء)" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/account_budget.py:0 +#: model:ir.model.fields,help:exp_budget_check.field_crossovered_budget_lines__reserve +#, python-format +msgid "Total amount of reserved purchase orders" +msgstr "المبلغ المحجوز وهو عبارة عن طلبات عروض الأسعار تم الموافقة عليها من الموازنة ( ارتباط مبدئى)" #. module: exp_budget_check #: model:ir.model.fields.selection,name:exp_budget_check.selection__budget_confirmation__type__vendor_bill @@ -228,39 +282,18 @@ msgid "Vendor Bill :%s" msgstr "فاتورة المورد :%s" #. module: exp_budget_check -#: code:addons/exp_budget_check/models/account_invoice.py:0 #: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__wait_budget -#, python-format +#: model:ir.model.fields.selection,name:exp_budget_check.selection__hr_expense__state__wait_budget msgid "Wait Budget" msgstr "إنتظار تحقق الموازنة" +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "analytic account is %s not link with budget" +msgstr "" #. module: exp_budget_check #: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation__type msgid "type" msgstr "النوع" - -#. module: exp_budget_check -#: code:addons/exp_budget_check/models/account_invoice.py:0 -#, python-format -msgid "analytic account is %s not link with budget" -msgstr "الحساب التحليلي %s ليس له موازنة" - -#. module: exp_budget_check -#: code:addons/exp_budget_check/models/account_invoice.py:0 -#, python-format -msgid "Rejected By : %s With Reject Reason : %s" -msgstr "تم الرقض بواسطة %s . مع سبب الرقض : %s" - - -#. module: exp_budget_check -#: code:addons/exp_budget_check/models/account_invoice.py:0 -#, python-format -msgid "Please insert Bill Date" -msgstr "الرجاء إدخال تاريخ الفاتورة" - -#. module: account_budget_custom -#: code:addons/account_budget_custom/models/budget_confirmation.py:0 -#, python-format -msgid "Specify Reject Reason" -msgstr "تحديد سبب الرفض" diff --git a/odex25_accounting/exp_budget_check/i18n/ar_001.po b/odex25_accounting/exp_budget_check/i18n/ar_001.po new file mode 100644 index 000000000..63c69b39b --- /dev/null +++ b/odex25_accounting/exp_budget_check/i18n/ar_001.po @@ -0,0 +1,299 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * exp_budget_check +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-06-26 18:16+0000\n" +"PO-Revision-Date: 2024-06-26 18:16+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: exp_budget_check +#: model:ir.model,name:exp_budget_check.model_account_analytic_account +msgid "Analytic Account" +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 +msgid "Approved" +msgstr "موافقة" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_analytic_account__is_auto_check +#: model:ir.model.fields,field_description:exp_budget_check.field_grant_project__is_auto_check +msgid "Auto Check" +msgstr "" + +#. module: exp_budget_check +#: model:ir.model,name:exp_budget_check.model_budget_confirmation +#: model_terms:ir.ui.view,arch_db:exp_budget_check.budget_check_view_move_form +msgid "Budget Confirmation" +msgstr "تعميد الموازنة" + +#. module: exp_budget_check +#: model:ir.model,name:exp_budget_check.model_crossovered_budget_lines +msgid "Budget Line" +msgstr "بند الموازنة" + +#. module: exp_budget_check +#: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__cancel +msgid "Cancelled" +msgstr "ملغي" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__budget_check +#: model_terms:ir.ui.view,arch_db:exp_budget_check.budget_check_view_move_form +#: model_terms:ir.ui.view,arch_db:exp_budget_check.hr_expense_view_form_inherit +msgid "Check Budget" +msgstr "فحص الموازنة" + +#. module: exp_budget_check +#: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__confirm +#: model:ir.model.fields.selection,name:exp_budget_check.selection__hr_expense__state__confirm +#: model_terms:ir.ui.view,arch_db:exp_budget_check.budget_check_view_move_form +msgid "Confirm" +msgstr "تأكيد" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_crossovered_budget_lines__confirm +#: model_terms:ir.ui.view,arch_db:exp_budget_check.crossovered_budget_view_form_inherit +msgid "Confirm Amount" +msgstr "المبلغ التعميد" + +#. module: exp_budget_check +#: model_terms:ir.ui.view,arch_db:exp_budget_check.budget_check_view_move_form +msgid "Confirm Bill" +msgstr "تأكيد الفاتورة" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_analytic_account__display_name +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__display_name +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move_line__display_name +#: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation__display_name +#: model:ir.model.fields,field_description:exp_budget_check.field_crossovered_budget_lines__display_name +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__display_name +msgid "Display Name" +msgstr "الاسم المعروض" + +#. module: exp_budget_check +#: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__draft +msgid "Draft" +msgstr "مسودة" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__exceed_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__exceed_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__exceed_budget +msgid "Exceed Budget" +msgstr "تخطي الموازنة" + +#. module: exp_budget_check +#: model:ir.model,name:exp_budget_check.model_hr_expense +#: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation__expense_id +#: model:ir.model.fields.selection,name:exp_budget_check.selection__budget_confirmation__type__expense +msgid "Expense" +msgstr "المصروف" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "Expense :%s" +msgstr "" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__hide_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__hide_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__hide_budget +msgid "Hide Budget" +msgstr "" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_analytic_account__id +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__id +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move_line__id +#: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation__id +#: model:ir.model.fields,field_description:exp_budget_check.field_crossovered_budget_lines__id +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__id +msgid "ID" +msgstr "المُعرف" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation__invoice_id +msgid "Invoice" +msgstr "" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__is_approve +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__is_approve +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__is_approve +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__is_approve +msgid "Is Approve" +msgstr "" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__is_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__is_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__is_budget +msgid "Is Budget" +msgstr "" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__is_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__is_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__is_check +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__is_check +msgid "Is Check" +msgstr "" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_analytic_account__is_analytic_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_grant_project__is_analytic_budget +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__is_budget +msgid "Is Use In Budget" +msgstr "يستخدم في الموازنة" + +#. module: exp_budget_check +#: model:ir.model,name:exp_budget_check.model_account_move +msgid "Journal Entry" +msgstr "قيد اليومية" + +#. module: exp_budget_check +#: model:ir.model,name:exp_budget_check.model_account_move_line +msgid "Journal Item" +msgstr "عنصر اليومية" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_analytic_account____last_update +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move____last_update +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move_line____last_update +#: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation____last_update +#: model:ir.model.fields,field_description:exp_budget_check.field_crossovered_budget_lines____last_update +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense____last_update +msgid "Last Modified on" +msgstr "آخر تعديل في" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "New Expense Report" +msgstr "" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "Please Check Budget First" +msgstr "" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/account_invoice.py:0 +#, python-format +msgid "Please Choose Analytic account for This Bill" +msgstr "الرجاء إختيار حسابات تحليلية لهذه الفاتورة" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/account_invoice.py:0 +#, python-format +msgid "Please insert Bill Date" +msgstr "الرجاء إدخال تاريخ الفاتورة" + +#. module: exp_budget_check +#: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__posted +msgid "Posted" +msgstr "مُرحل" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/account_invoice.py:0 +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "Rejected By : %s With Reject Reason : %s" +msgstr "تم الرقض بواسطة %s . مع سبب الرقض : %s" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_crossovered_budget_lines__reserve +#: model_terms:ir.ui.view,arch_db:exp_budget_check.crossovered_budget_view_form_inherit +msgid "Reserve Amount" +msgstr "المبلغ المحجوز" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__state_a +#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__state_b +#: model:ir.model.fields,field_description:exp_budget_check.field_account_bank_statement_line__state_bill +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__state +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__state_a +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__state_b +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move__state_bill +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__state +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__state_a +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__state_b +#: model:ir.model.fields,field_description:exp_budget_check.field_account_payment__state_bill +#: model:ir.model.fields,field_description:exp_budget_check.field_hr_expense__state +msgid "Status" +msgstr "الحالة" + +#. module: exp_budget_check +#: model:ir.model.fields,help:exp_budget_check.field_hr_expense__state +msgid "Status of the expense." +msgstr "حالة المصروف." + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_account_move_line__price_tax +msgid "Tax" +msgstr "ضريبة" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "The Budget Confirmation Doesn't Approve yet" +msgstr "" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/account_budget.py:0 +#: model:ir.model.fields,help:exp_budget_check.field_crossovered_budget_lines__confirm +#, python-format +msgid "Total amount of confirmed purchase orders" +msgstr "المبلغ التعميد : هو عبارة قيمة التعميد ( أوامر الشراء)" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/account_budget.py:0 +#: model:ir.model.fields,help:exp_budget_check.field_crossovered_budget_lines__reserve +#, python-format +msgid "Total amount of reserved purchase orders" +msgstr "المبلغ المحجوز وهو عبارة عن طلبات عروض الأسعار تم الموافقة عليها من الموازنة ( ارتباط مبدئى)" + +#. module: exp_budget_check +#: model:ir.model.fields.selection,name:exp_budget_check.selection__budget_confirmation__type__vendor_bill +msgid "Vendor Bill" +msgstr "فاتورة مورد" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/account_invoice.py:0 +#, python-format +msgid "Vendor Bill :%s" +msgstr "فاتورة المورد :%s" + +#. module: exp_budget_check +#: model:ir.model.fields.selection,name:exp_budget_check.selection__account_move__state__wait_budget +#: model:ir.model.fields.selection,name:exp_budget_check.selection__hr_expense__state__wait_budget +msgid "Wait Budget" +msgstr "إنتظار تحقق الموازنة" + +#. module: exp_budget_check +#: code:addons/exp_budget_check/models/hr_expense.py:0 +#, python-format +msgid "analytic account is %s not link with budget" +msgstr "" + +#. module: exp_budget_check +#: model:ir.model.fields,field_description:exp_budget_check.field_budget_confirmation__type +msgid "type" +msgstr "النوع" diff --git a/odex25_accounting/exp_budget_check/models/account_budget.py b/odex25_accounting/exp_budget_check/models/account_budget.py index 65a3201bd..84ba717e9 100644 --- a/odex25_accounting/exp_budget_check/models/account_budget.py +++ b/odex25_accounting/exp_budget_check/models/account_budget.py @@ -4,8 +4,30 @@ from odoo import api, fields, models, _ class CrossoveredBudgetLines(models.Model): _inherit = "crossovered.budget.lines" - reserve = fields.Float(string='Reserve Amount') - confirm = fields.Float(string='Confirm Amount') + reserve = fields.Float(string='Reserve Amount', compute='_compute_reserve', + help=_('Total amount of reserved purchase orders')) + confirm = fields.Float(string='Confirm Amount', compute='_compute_confirm', + help=_('Total amount of confirmed purchase orders')) + + @api.depends('analytic_account_id') + def _compute_confirm(self): + for rec in self: + orders = self.env['purchase.order.line'].search( + [('account_analytic_id', '=', rec.analytic_account_id.id), + ('order_id.state', 'in', ['purchase'])]).mapped('order_id') + total_orders = sum(orders.mapped('amount_total')) + invoiced = self.env['account.move'].search( + [('purchase_id', 'in', orders.ids), ('state', 'not in', ['draft', 'cancel'])]).mapped('amount_total') + rec.confirm = (total_orders - sum(invoiced)) * -1 + + @api.depends('analytic_account_id') + def _compute_reserve(self): + for rec in self: + orders = self.env['purchase.order.line'].search( + [('account_analytic_id', '=', rec.analytic_account_id.id), + ('order_id.state', 'in', ['draft', 'sent', 'to approve'])]).mapped('order_id') + total_orders = sum(orders.mapped('amount_total')) + rec.reserve = total_orders * -1 def _compute_operations_amount(self): if not self.ids: return @@ -58,7 +80,3 @@ class CrossoveredBudgetLines(models.Model): line.pull_out = abs(pull_out) line.provide = abs(provide) line.budget_confirm_amount = budget_confirm_amount - line.remain = abs(line.planned_amount) + provide - abs(pull_out) - abs(line.practical_amount) - abs( - line.reserved_amount) + line.reserve - if line.planned_amount < 0: - line.remain = -line.remain diff --git a/odex25_accounting/exp_budget_check/models/account_invoice.py b/odex25_accounting/exp_budget_check/models/account_invoice.py index 0cce1e65e..e6430b1ca 100644 --- a/odex25_accounting/exp_budget_check/models/account_invoice.py +++ b/odex25_accounting/exp_budget_check/models/account_invoice.py @@ -14,7 +14,7 @@ class BudgetConfirmationCustom(models.Model): if self.invoice_id and self.type == 'vendor.bill': self.invoice_id.write({'state': 'draft'}) self.invoice_id.message_post(body=_( - "Rejected By : %s With Reject Reason : %s" % (str(self.env.user.name), str(self.reject_reason)))) + "Rejected By : %s With Reject Reason : %s" % (str(self.env.user.name), str(self.reject_reason or self.env.context.get('reject_reason',''))))) def done(self): super(BudgetConfirmationCustom, self).done() @@ -30,6 +30,8 @@ class BudgetConfirmationCustom(models.Model): lambda x: x.general_budget_id in budget_post and x.crossovered_budget_id.state == 'done' and x.date_from <= self.date <= x.date_to) + if len(budget_lines) > 1: + budget_lines = budget_lines[0] print("budget_lines.reserve budget_lines.reserve budget_lines.reserve", budget_lines.reserve) amount = budget_lines.reserve amount += line.amount @@ -51,13 +53,13 @@ class AccountMove(models.Model): state_a = fields.Selection(related='state') state_b = fields.Selection(related='state') - is_budget = fields.Boolean(default=True) + is_budget = fields.Boolean(defaul=True) state_bill = fields.Selection(related='state') budget_check = fields.Boolean(string="Check Budget", default=False, readonly=True) - exceed_budget = fields.Boolean(default=False) - is_check = fields.Boolean(default=False) - is_approve = fields.Boolean(default=False) - + exceed_budget = fields.Boolean(defaul=False) + is_check = fields.Boolean(defaul=False) + is_approve = fields.Boolean(defaul=False) + hide_budget = fields.Boolean(defaul=False,copy=False) def copy(self): self.write({'budget_check': False}) # self.write({'is_check':False}) @@ -76,6 +78,22 @@ class AccountMove(models.Model): self.write({ 'state': 'budget_approve' }) + other_confirms = self.env['budget.confirmation'].search( + [('invoice_id', '=', self.id), ('state', '=', 'cancel')], limit=1, + order='id desc') + if other_confirms: + other_confirms.state='draft' + return + if self.purchase_id: + confirm_budget = self.env['budget.confirmation'].search([('po_id', '=', self.purchase_id.id)], limit=1, + order='id desc') + if confirm_budget: + confirm_budget.invoice_id = self.id + self.write({ + 'is_check': True, + 'state': 'budget_approve' if confirm_budget.state == 'done' else 'wait_budget' + }) + return True def button_cancel(self): res = super(AccountMove, self).button_cancel() @@ -133,20 +151,38 @@ class AccountMove(models.Model): def action_budget(self): confirmation_lines = [] + self.hide_budget = True if not self.budget_check: + other_confirms = self.env['budget.confirmation'].search( + [('invoice_id', '=', self.id), ('state', '!=', 'cancel')], limit=1, + order='id desc') + if other_confirms: + return amount = 0 + if self.purchase_id: + confirm_budget = self.env['budget.confirmation'].search([('po_id', '=', self.purchase_id.id)], limit=1, + order='id desc') + if confirm_budget: + confirm_budget.invoice_id = self.id + self.write({ + 'is_check': True, + 'state': 'budget_approve' if confirm_budget.state == 'done' else 'wait_budget' + }) + if confirm_budget.state =='cancel': + confirm_budget.state='draft' + return True for line in self.invoice_line_ids.filtered(lambda r: r.analytic_account_id.is_analytic_budget == True): if line.analytic_account_id: if not line.analytic_account_id: raise ValidationError(_('Please Choose Analytic account for This Bill')) - budget_lines = line.analytic_account_id.crossovered_budget_line.filtered( - lambda x: - x.crossovered_budget_id.state == 'done' and - fields.Date.from_string(x.date_from) <= fields.Date.from_string( - self.invoice_date) <= fields.Date.from_string(x.date_to)) + budget_lines = self.env['crossovered.budget.lines'].search( + [('analytic_account_id', '=', line.analytic_account_id.id), + ('general_budget_id.account_ids', 'in', [line.account_id.id]), + ('crossovered_budget_id.state', '=', 'done'), + ('crossovered_budget_id.date_from', '<=', self.invoice_date), + ('crossovered_budget_id.date_to', '>=', self.invoice_date)]) if not budget_lines: - raise UserError( - _('analytic account is %s not link with budget') % line.analytic_account_id.name) + confirmation_lines=[] else: remain = abs(budget_lines[0].remain) amount = amount + (line.price_subtotal + line.price_tax) @@ -174,23 +210,25 @@ class AccountMove(models.Model): 'invoice_id': self.id } self.env['budget.confirmation'].create(data) - - self.write({ - 'is_check': True - }) self.write({ 'state': 'wait_budget' }) - - def action_open_budget_confirmation(self): - self.ensure_one() + def open_confirmation(self): + formview_ref = self.env.ref('account_budget_custom.view_budget_confirmation_form', False) + treeview_ref = self.env.ref('account_budget_custom.view_budget_confirmation_tree', False) + confirm_budget = self.env['budget.confirmation'].search([('invoice_id', '=', self.id)]) return { - "name": _('Budget Confirmation'), - "type": "ir.actions.act_window", - "res_model": "budget.confirmation", - "view_mode": "form", - "target": "new", - "domain": [('invoice_id', '=', self.id)] + 'name': ("Budget Confirmation"), + 'view_mode': 'tree, form', + 'view_id': False, + 'view_type': 'form', + 'res_model': 'budget.confirmation', + 'type': 'ir.actions.act_window', + 'target': 'current', + 'domain': "[('id', 'in', %s)]" % confirm_budget.ids, + 'views': [(treeview_ref and treeview_ref.id or False, 'tree'), + (formview_ref and formview_ref.id or False, 'form')], + 'context': {'create': False} } diff --git a/odex25_accounting/exp_budget_check/models/hr_expense.py b/odex25_accounting/exp_budget_check/models/hr_expense.py index 5d62a9761..5df1a324c 100644 --- a/odex25_accounting/exp_budget_check/models/hr_expense.py +++ b/odex25_accounting/exp_budget_check/models/hr_expense.py @@ -46,8 +46,8 @@ class AccountMove(models.Model): ]) is_budget = fields.Boolean(related='analytic_account_id.is_analytic_budget') - is_check = fields.Boolean(default=False, copy=False) - is_approve = fields.Boolean(default=False, copy=False) + is_check = fields.Boolean(defaul=False, copy=False) + is_approve = fields.Boolean(defaul=False, copy=False) def action_submit_expenses(self): if self.analytic_account_id.is_analytic_budget: diff --git a/odex25_accounting/exp_budget_check/views/account_invoice_view.xml b/odex25_accounting/exp_budget_check/views/account_invoice_view.xml index 4522542b9..dcd45191f 100644 --- a/odex25_accounting/exp_budget_check/views/account_invoice_view.xml +++ b/odex25_accounting/exp_budget_check/views/account_invoice_view.xml @@ -27,25 +27,12 @@ - + + - - - - - - - - - - - - budget.account.view.move.inherit.form @@ -62,15 +49,20 @@ + + attrs="{'invisible': ['|','|',('move_type', '!=', 'in_invoice'), ('state', '!=', 'confirm'),('hide_budget','=',True)]}"/> + + + + {'invisible' : ['|', ('id', '=', False), ('state', 'not in', ('draft','confirm','budget_approve'))]} @@ -93,13 +85,6 @@ - - - - - - diff --git a/odex25_accounting/exp_budget_check/views/hr_expense_view.xml b/odex25_accounting/exp_budget_check/views/hr_expense_view.xml index 9fadf6493..dcdbd72db 100644 --- a/odex25_accounting/exp_budget_check/views/hr_expense_view.xml +++ b/odex25_accounting/exp_budget_check/views/hr_expense_view.xml @@ -14,5 +14,54 @@ + + expert.budget.confirmation.tree + budget.confirmation + + + + + + + + + + + crossovered.budget.lines.tree + crossovered.budget.lines + + + + + + + + + + + crossovered.budget.lines.tree + crossovered.budget.lines + + + + + + + + + + + crossovered.budget.lines.tree + crossovered.budget.lines + + + + + + + + + + \ No newline at end of file diff --git a/odex25_accounting/initial_engagement_budget/__init__.py b/odex25_accounting/initial_engagement_budget/__init__.py new file mode 100755 index 000000000..cde864bae --- /dev/null +++ b/odex25_accounting/initial_engagement_budget/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import models diff --git a/odex25_accounting/initial_engagement_budget/__manifest__.py b/odex25_accounting/initial_engagement_budget/__manifest__.py new file mode 100755 index 000000000..d6e66ffe5 --- /dev/null +++ b/odex25_accounting/initial_engagement_budget/__manifest__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +{ + 'name': "Initial engagement budget", + 'description': """ + Add new features to budget : + - Initial engagement budget workflow. + - Budget Confirmation. + """, + 'author': "Expert Co. Ltd.", + 'website': "http://www.exp-sa.com", + 'category': 'Odex25 Accounting/Accounting', + # any module necessary for this one to work correctly + 'depends': ['account_budget_custom','purchase_requisition_custom','exp_budget_check'], + # always loaded + 'data': [ + 'views/account_budget_views.xml', + 'views/purchase_request_view.xml', + 'views/res_config_view.xml', + ], +} diff --git a/odex25_accounting/initial_engagement_budget/i18n/ar_001.po b/odex25_accounting/initial_engagement_budget/i18n/ar_001.po new file mode 100644 index 000000000..e32095c9a --- /dev/null +++ b/odex25_accounting/initial_engagement_budget/i18n/ar_001.po @@ -0,0 +1,224 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * initial_engagement_budget +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-17 00:08+0000\n" +"PO-Revision-Date: 2024-07-17 00:08+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: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_res_company__activate_initial_engagement +#: model:ir.model.fields,field_description:initial_engagement_budget.field_res_config_settings__activate_initial_engagement +msgid "Activate Initial Engagement" +msgstr "تفعيل الربط المبدئي بالموازنات" + +#. module: initial_engagement_budget +#: model_terms:ir.ui.view,arch_db:initial_engagement_budget.purchase_requisition_custom_setting +msgid "Activate Initial Engagement Budget" +msgstr "تفعيل الربط المبدئي بالموازنات" + +#. module: initial_engagement_budget +#: code:addons/initial_engagement_budget/models/account_budget.py:0 +#, python-format +msgid "Amount of money that has been exceeded" +msgstr "تم تجاوز المبلغ المالي" + +#. module: initial_engagement_budget +#: code:addons/initial_engagement_budget/models/account_budget.py:0 +#, python-format +msgid "Amount of money that has been remained" +msgstr "تم البقاء على المبلغ المالي" + +#. module: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request_line__analytic_account_id +msgid "Analytic Account" +msgstr "حساب تحليلي" + +#. module: initial_engagement_budget +#: model:ir.model,name:initial_engagement_budget.model_crossovered_budget_lines +msgid "Budget Line" +msgstr "بند الموازنة" + +#. module: initial_engagement_budget +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__state__cancel +msgid "Cancel" +msgstr "إلغاء" + +#. module: initial_engagement_budget +#: model:ir.model,name:initial_engagement_budget.model_res_company +msgid "Companies" +msgstr "شركات" + +#. module: initial_engagement_budget +#: model:ir.model,name:initial_engagement_budget.model_res_config_settings +msgid "Config Settings" +msgstr "ضبط الاعدادات" + +#. module: initial_engagement_budget +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__purchase_cost__default +msgid "Default Cost Center" +msgstr "حساب تحليلي مرتبط بالشركة" + +#. module: initial_engagement_budget +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__purchase_cost__department +msgid "Department" +msgstr "الإدارة" + +#. module: initial_engagement_budget +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__state__direct_manager +msgid "Direct Manager" +msgstr "المدير المباشر" + +#. module: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_crossovered_budget_lines__display_name +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request__display_name +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request_line__display_name +#: model:ir.model.fields,field_description:initial_engagement_budget.field_res_company__display_name +#: model:ir.model.fields,field_description:initial_engagement_budget.field_res_config_settings__display_name +msgid "Display Name" +msgstr "الاسم المعروض" + +#. module: initial_engagement_budget +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__state__done +msgid "Done" +msgstr "تم" + +#. module: initial_engagement_budget +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__state__draft +msgid "Draft" +msgstr "مبدئي" + +#. module: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request_line__expected_price +msgid "Expected Price" +msgstr "السعر التقديري شامل الضريبة " + +#. module: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_crossovered_budget_lines__id +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request__id +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request_line__id +#: model:ir.model.fields,field_description:initial_engagement_budget.field_res_company__id +#: model:ir.model.fields,field_description:initial_engagement_budget.field_res_config_settings__id +msgid "ID" +msgstr "المُعرف" + +#. module: initial_engagement_budget +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__state__waiting +msgid "In Purchase" +msgstr "في الشراء" + +#. module: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_crossovered_budget_lines__initial_engagement_amount +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__state__initial +#: model_terms:ir.ui.view,arch_db:initial_engagement_budget.crossovered_budget_view_form +#: model_terms:ir.ui.view,arch_db:initial_engagement_budget.purchase_request_form +#: model_terms:ir.ui.view,arch_db:initial_engagement_budget.view_crossovered_budget_line_tree +msgid "Initial Engagement" +msgstr "الربط المبدئي" + +#. module: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request__initial_engagement_activate +msgid "Initial Engagement Activate" +msgstr "وضع الربط المبدئي" + +#. module: initial_engagement_budget +#: model_terms:ir.ui.view,arch_db:initial_engagement_budget.purchase_requisition_custom_setting +msgid "Initial Engagement Budget" +msgstr "الربط المبدئي للموازنات" + +#. module: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_crossovered_budget_lines____last_update +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request____last_update +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request_line____last_update +#: model:ir.model.fields,field_description:initial_engagement_budget.field_res_company____last_update +#: model:ir.model.fields,field_description:initial_engagement_budget.field_res_config_settings____last_update +msgid "Last Modified on" +msgstr "آخر تعديل في" + +#. module: initial_engagement_budget +#: code:addons/initial_engagement_budget/models/purchase_request.py:0 +#, python-format +msgid "Please put cost center to the product line" +msgstr "برجاء ادخال حساب تحليلي للمنتج" + +#. module: initial_engagement_budget +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__purchase_cost__product_line +msgid "Product Line" +msgstr "على مستوي سطر الشراء" + +#. module: initial_engagement_budget +#: model:ir.model,name:initial_engagement_budget.model_purchase_request +msgid "Purchase Request" +msgstr "طلبات الشراء" + +#. module: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request__purchase_cost +msgid "Purchase Request Cost" +msgstr "نوع الحساب التحليلي" + +#. module: initial_engagement_budget +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__state__refuse +msgid "Refuse" +msgstr "رفض" + +#. module: initial_engagement_budget +#: model:ir.actions.act_window,name:initial_engagement_budget.action_budget_confirmation_form +#: model:ir.ui.menu,name:initial_engagement_budget.menu_budget_confirmation +msgid "Request Budget Confirmations" +msgstr "الربط المبدئي" + +#. module: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request__state +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request__state_a +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request__state_b +msgid "State" +msgstr "الحالة" + +#. module: initial_engagement_budget +#: code:addons/initial_engagement_budget/models/purchase_request.py:0 +#, python-format +msgid "This product has no expense account" +msgstr "هذا المنتج ليس له حساب مصروف" + +#. module: initial_engagement_budget +#: model:ir.model.fields,field_description:initial_engagement_budget.field_purchase_request_line__line_total +msgid "Total" +msgstr "إجمالي" + +#. module: initial_engagement_budget +#: code:addons/initial_engagement_budget/models/purchase_request.py:0 +#, python-format +msgid "Total Amount MUST be greater than 0 !!!" +msgstr "برجاء ادخال قيمة اكبر من 0" + +#. module: initial_engagement_budget +#: code:addons/initial_engagement_budget/models/account_budget.py:0 +#: model:ir.model.fields,help:initial_engagement_budget.field_crossovered_budget_lines__initial_engagement_amount +#, python-format +msgid "Total amount of confirmed purchase requests for this budget line." +msgstr "المبلغ الإجمالي لطلبات الشراء المؤكدة لهذا البند الميزاني." + +#. module: initial_engagement_budget +#: model:ir.model.fields.selection,name:initial_engagement_budget.selection__purchase_request__state__wait_for_send +msgid "Wait For Sent" +msgstr "فى انتظار الارسال" + +#. module: initial_engagement_budget +#: code:addons/initial_engagement_budget/models/purchase_request.py:0 +#, python-format +msgid "You must set a Vendor this PO" +msgstr "برجاء ادخال مورد لهذا الطلب" + +#. module: initial_engagement_budget +#: model:ir.model,name:initial_engagement_budget.model_purchase_request_line +msgid "purchase request line" +msgstr "بند طلب الشراء" diff --git a/odex25_accounting/initial_engagement_budget/models/__init__.py b/odex25_accounting/initial_engagement_budget/models/__init__.py new file mode 100755 index 000000000..771a6927b --- /dev/null +++ b/odex25_accounting/initial_engagement_budget/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from . import account_budget +from . import purchase_request +from . import res_config diff --git a/odex25_accounting/initial_engagement_budget/models/account_budget.py b/odex25_accounting/initial_engagement_budget/models/account_budget.py new file mode 100644 index 000000000..37cb13b17 --- /dev/null +++ b/odex25_accounting/initial_engagement_budget/models/account_budget.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, _ + + +class CrossoveredBudgetLines(models.Model): + _inherit = "crossovered.budget.lines" + + initial_engagement_amount = fields.Float(string='Initial Engagement', compute='_compute_initial_engagement_amount', + help=_( + 'Total amount of confirmed purchase requests for this budget line.')) + remain = fields.Float(string='Remain of Christening', compute='_compute_remain_new', + help=_('Amount of money that has been remained')) + above_remain = fields.Float(string='Exceed Amount', compute='_compute_remain_new', + help=_('Amount of money that has been exceeded')) + + @api.depends('to_operation_ids', 'from_operation_ids') + def _compute_remain_new(self): + for line in self: + remain_value = ((abs(line.final_amount) - abs(line.reserve) - abs(line.confirm) - abs( + line.practical_amount)- abs(line.initial_engagement_amount)) * -1) + line.remain = 0 if remain_value > 0 else remain_value + line.above_remain = remain_value if remain_value > 0 else 0 + + @api.depends('analytic_account_id') + def _compute_initial_engagement_amount(self) -> None: + for rec in self: + rec.initial_engagement_amount = sum( + self.env['budget.confirmation.line'].search([('confirmation_id.state', '=', 'done'), + ('confirmation_id.request_id.state', '!=', 'done'), + ('confirmation_id.request_id.purchase_create', '!=', True), + ('confirmation_id.type', '=', + 'purchase.request'), + ('account_id', 'in', + rec.general_budget_id.account_ids.ids), + ('analytic_account_id', '=', + rec.analytic_account_id.id)]).mapped( + 'amount')) diff --git a/odex25_accounting/initial_engagement_budget/models/purchase_request.py b/odex25_accounting/initial_engagement_budget/models/purchase_request.py new file mode 100755 index 000000000..7a2d05e8e --- /dev/null +++ b/odex25_accounting/initial_engagement_budget/models/purchase_request.py @@ -0,0 +1,152 @@ +# -*- coding: utf-8 -*- +from datetime import datetime +from typing import Optional + +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError, UserError + + +class PurchaseRequest(models.Model): + _inherit = 'purchase.request' + + state = fields.Selection( + selection=[('draft', 'Draft'), ('direct_manager', 'Direct Manager'), ('wait_for_send', 'Wait For Sent'), + ('initial', 'Initial Engagement'), + ('waiting', 'In Purchase'), ('done', 'Done'), ('cancel', 'Cancel'), ('refuse', 'Refuse')], + default="draft", + tracking=True + ) + state_a = fields.Selection(related='state') + state_b = fields.Selection(related='state') + + initial_engagement_activate = fields.Boolean(compute='_check_initial_engagement_activate', store=True, + default=False) + + @api.depends('name', 'date', 'department_id', 'state') + def _check_initial_engagement_activate(self): + for rec in self: + rec.initial_engagement_activate = rec.company_id.activate_initial_engagement + + def action_confirm(self) -> Optional[bool]: + if self.env.user.company_id.activate_initial_engagement: + for rec in self: + rec.state = 'wait_for_send' + return + return super(PurchaseRequest, self).action_confirm() + + def initial_engagement(self) -> None: + for rec in self: + rec.action_budget_initial() + rec.state = 'initial' + + def action_refuse(self): + res = super(PurchaseRequest, self).action_refuse() + for rec in self: + budget_confs = self.env['budget.confirmation'].search([('request_id', '=', rec.id)]) + budget_confs.write({'state': 'cancel'}) + return res + + def action_budget_initial(self): + confirmation_lines = [] + amount = 0 + total_amount = sum(line.line_total for line in self.line_ids) + if total_amount <= 0: + raise ValidationError(_("Total Amount MUST be greater than 0 !!!")) + if self.use_analytic: + analytic_account = self.account_analytic_id + else: + analytic_account = self.department_id.analytic_account_id + + for order in self: + for rec in order.line_ids: + if not ( + rec.product_id.property_account_expense_id.id and rec.product_id.property_account_expense_id.id or rec.product_id.categ_id.property_account_expense_categ_id.id): + raise ValidationError( + _("This product has no expense account") + ': {}'.format(rec.product_id.name)) + + budget_lines = analytic_account.crossovered_budget_line.filtered( + lambda x: + x.crossovered_budget_id.state == 'done' and + rec.product_id.property_account_expense_id.id in x.general_budget_id.account_ids.ids and + fields.Date.from_string(x.date_from) <= fields.Date.from_string(self.date) and + fields.Date.from_string(x.date_to) >= fields.Date.from_string(self.date)) + budget_line = budget_lines.mapped('crossovered_budget_id') + if len(budget_line) > 1: + self.budget_id = budget_line[0].id + if budget_lines: + remain = abs(budget_lines[0].remain) + amount = amount + rec.line_total + new_balance = remain - amount + confirmation_lines.append((0, 0, { + 'amount': rec.line_total, + 'analytic_account_id': analytic_account.id, + 'description': rec.product_id.name, + 'budget_line_id': budget_lines[0].id, + 'remain': remain, + 'new_balance': new_balance, + 'account_id': rec.product_id.property_account_expense_id.id and rec.product_id.property_account_expense_id.id or rec.product_id.categ_id.property_account_expense_categ_id.id + })) + + data = { + 'name': self.name, + 'date': self.date, + 'beneficiary_id': self.partner_id.id, + 'department_id': self.department_id.id, + 'type': 'purchase.request', + 'ref': self.name, + 'description': self.name, + 'total_amount': total_amount, + 'lines_ids': confirmation_lines or False, + 'request_id': self.id + } + self.env['budget.confirmation'].create(data) + + def create_purchase_order2(self): + if not self.partner_id: + raise UserError(_("You must set a Vendor this PO")) + if self.use_analytic: + analytic_account = self.account_analytic_id.id + else: + analytic_account = self.department_id.analytic_account_id.id + line_ids = [] + for line in self.line_ids: + line_ids.append((0, 6, { + 'product_id': line.product_id.id, + 'product_qty': line.qty, + 'name': line.description or line.product_id.name, + 'department_name': self.employee_id.department_id.id, + 'account_analytic_id':analytic_account, + 'date_planned': datetime.today(), + 'price_unit': 0, + })) + + purchase_order = self.env['purchase.order'].sudo().create({ + 'category_ids': self.product_category_ids.ids, + 'origin': self.name, + 'request_id': self.id, + 'partner_id': self.partner_id.id, + 'department_id': self.department_id.id, + 'purpose': self.purchase_purpose, + 'purchase_cost': 'product_line', + 'order_line': line_ids, + + }) + self.write({'purchase_create': True}) + + return { + 'name': "Purchase orders from employee", + 'type': 'ir.actions.act_window', + 'res_model': 'purchase.order', + 'view_mode': 'form', + 'res_id': purchase_order.id} + + +class PurchaseRequestLine(models.Model): + _inherit = 'purchase.request.line' + expected_price = fields.Float(string='Expected Price', tracking=True, ) + line_total = fields.Float(string='Total', compute='_compute_line_total', store=True) + + @api.depends('qty', 'expected_price') + def _compute_line_total(self) -> None: + for line in self: + line.line_total = line.qty * line.expected_price diff --git a/odex25_accounting/initial_engagement_budget/models/res_config.py b/odex25_accounting/initial_engagement_budget/models/res_config.py new file mode 100644 index 000000000..bea5ec641 --- /dev/null +++ b/odex25_accounting/initial_engagement_budget/models/res_config.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + activate_initial_engagement = fields.Boolean(related='company_id.activate_initial_engagement', readonly=False) + + +class ResCompany(models.Model): + _inherit = 'res.company' + + activate_initial_engagement = fields.Boolean(string='Activate Initial Engagement', default=False) diff --git a/odex25_accounting/initial_engagement_budget/static/description/icon.png b/odex25_accounting/initial_engagement_budget/static/description/icon.png new file mode 100644 index 000000000..b79487bda Binary files /dev/null and b/odex25_accounting/initial_engagement_budget/static/description/icon.png differ diff --git a/odex25_accounting/initial_engagement_budget/views/account_budget_views.xml b/odex25_accounting/initial_engagement_budget/views/account_budget_views.xml new file mode 100755 index 000000000..9b4c03a3c --- /dev/null +++ b/odex25_accounting/initial_engagement_budget/views/account_budget_views.xml @@ -0,0 +1,41 @@ + + + + crossovered.budget.view.inherit.form + crossovered.budget + + + + + + + + + + crossovered.budget.lines.inherit.tree + crossovered.budget.lines + + + + + + + + + + + Request Budget Confirmations + budget.confirmation + + tree,kanban,form + [('type','=','purchase.request')] + + + diff --git a/odex25_accounting/initial_engagement_budget/views/purchase_request_view.xml b/odex25_accounting/initial_engagement_budget/views/purchase_request_view.xml new file mode 100755 index 000000000..efcd5faad --- /dev/null +++ b/odex25_accounting/initial_engagement_budget/views/purchase_request_view.xml @@ -0,0 +1,37 @@ + + + + purchase.request.inherit.form + purchase.request + + + + + + + + direct_manager,wait_for_send,initial + + + + + + + + + + + + + + + + + + diff --git a/odex25_accounting/initial_engagement_budget/views/res_config_view.xml b/odex25_accounting/initial_engagement_budget/views/res_config_view.xml new file mode 100644 index 000000000..68860f714 --- /dev/null +++ b/odex25_accounting/initial_engagement_budget/views/res_config_view.xml @@ -0,0 +1,30 @@ + + + + + model.name.inherit.view.form + res.config.settings + + + + Initial Engagement Budget + + + + + + + + + + + Initial Engagement Budget + + + + + + + + + \ No newline at end of file diff --git a/odex25_accounting/odex25_account_budget/__init__.py b/odex25_accounting/odex25_account_budget/__init__.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/__manifest__.py b/odex25_accounting/odex25_account_budget/__manifest__.py old mode 100644 new mode 100755 index 2745aadc7..899c2930a --- a/odex25_accounting/odex25_account_budget/__manifest__.py +++ b/odex25_accounting/odex25_account_budget/__manifest__.py @@ -2,7 +2,7 @@ { 'name': 'Budget Management', - 'category': 'Odex25-Accounting/Odex25-Accounting', + 'category': 'Odex25 Accounting/Accounting', 'description': """ Use budgets to compare actual with expected revenues and costs -------------------------------------------------------------- @@ -17,4 +17,5 @@ Use budgets to compare actual with expected revenues and costs 'views/account_budget_views.xml', 'views/account_analytic_account_views.xml', ], + 'demo': ['data/account_budget_demo.xml'], } diff --git a/odex25_accounting/odex25_account_budget/data/account_budget_demo.xml b/odex25_accounting/odex25_account_budget/data/account_budget_demo.xml old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/i18n/ar.po b/odex25_accounting/odex25_account_budget/i18n/ar.po old mode 100644 new mode 100755 index dc9eac0ae..d9d9ecaf1 --- a/odex25_accounting/odex25_account_budget/i18n/ar.po +++ b/odex25_accounting/odex25_account_budget/i18n/ar.po @@ -1,36 +1,19 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * odex25_account_budget -# -# Translators: -# Sherif Abd Ekmoniem , 2020 -# Mustafa Rawi , 2020 -# Sadig Adam , 2020 -# amrnegm , 2020 -# Martin Trigaux, 2020 -# Osoul , 2020 -# Osama Ahmaro , 2020 -# amal ahmed , 2020 -# Shaima Safar , 2020 -# Islam Eldeeb , 2020 -# Mostafa Hanafy , 2020 -# Nisrine Tagri , 2020 -# Tasneem Sarhan , 2020 -# Talal Albahra , 2020 -# +# msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-16 13:44+0000\n" -"PO-Revision-Date: 2020-09-07 08:17+0000\n" -"Last-Translator: Talal Albahra , 2020\n" -"Language-Team: Arabic (https://www.transifex.com/odoo/teams/41243/ar/)\n" +"POT-Creation-Date: 2024-07-01 07:42+0000\n" +"PO-Revision-Date: 2024-07-01 07:42+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" -"Language: ar\n" -"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" +"Plural-Forms: \n" #. module: odex25_account_budget #: code:addons/odex25_account_budget/models/account_budget.py:0 @@ -51,7 +34,7 @@ msgstr "يجب أن تتضمن فترة الموازنة تاريخ بدء بن #. module: odex25_account_budget #: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_kanban msgid "" -msgstr "" +msgstr "" #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__account_ids @@ -62,7 +45,7 @@ msgstr "الحسابات" #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__percentage msgid "Achievement" -msgstr "الإنجاز" +msgstr "نسبة الصرف" #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_needaction @@ -89,16 +72,6 @@ msgstr "حالة النشاط" msgid "Activity Type Icon" msgstr "أيقونة نوع النشاط" -#. module: odex25_account_budget -#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget_lines__practical_amount -msgid "Amount really earned/spent." -msgstr "الإيرادات/المصروفات الفعلية." - -#. module: odex25_account_budget -#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget_lines__theoritical_amount -msgid "Amount you are supposed to have earned/spent at this date." -msgstr "المبلغ الذي يُفترض أن تكون ربحته/أنفقته في هذا التاريخ." - #. module: odex25_account_budget #: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget_lines__planned_amount msgid "" @@ -111,9 +84,16 @@ msgstr "" #. module: odex25_account_budget #: model:ir.model,name:odex25_account_budget.model_account_analytic_account #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__analytic_account_id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__analytic_account_id msgid "Analytic Account" msgstr "الحساب التحليلي" +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/wizard/crossovered_budget_percentage_wizard.py:0 +#, python-format +msgid "Analytic Accounts" +msgstr "" + #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__analytic_group_id msgid "Analytic Group" @@ -148,7 +128,7 @@ msgstr "بنود الموازنة" #. module: odex25_account_budget #: model:ir.model,name:odex25_account_budget.model_crossovered_budget_lines msgid "Budget Line" -msgstr "خط الموازنة" +msgstr "بند الموازنة" #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_account_analytic_account__crossovered_budget_line @@ -176,11 +156,12 @@ msgstr "حالة الموازنة" #. module: odex25_account_budget #: model:ir.model,name:odex25_account_budget.model_account_budget_post #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__general_budget_id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__budget_post_id #: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_budget_post_form #: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_budget_post_search #: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_budget_post_tree msgid "Budgetary Position" -msgstr "وضع الموازنة" +msgstr "بند الموازنة" #. module: odex25_account_budget #: model:ir.actions.act_window,name:odex25_account_budget.open_budget_post_form @@ -242,10 +223,22 @@ msgstr "تأكيد" msgid "Confirmed" msgstr "مؤكد" +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_percentage_wizard_form +msgid "Copy" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.actions.act_window,name:odex25_account_budget.crossovered_budget_percentage_wizard_action +msgid "Copy Budgetary Positions" +msgstr "" + #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__create_uid #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__create_uid #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__create_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__create_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__create_uid msgid "Created by" msgstr "أنشئ بواسطة" @@ -253,9 +246,21 @@ msgstr "أنشئ بواسطة" #: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__create_date #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__create_date #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__create_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__create_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__create_date msgid "Created on" msgstr "أنشئ في" +#. module: odex25_account_budget +#: model:ir.model,name:odex25_account_budget.model_crossovered_budget_percentage_line_wizard +msgid "CrossOvered Budget Percentage Lines Wizard" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model,name:odex25_account_budget.model_crossovered_budget_percentage_wizard +msgid "CrossOvered Budget Percentage Wizard" +msgstr "" + #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__currency_id msgid "Currency" @@ -266,11 +271,18 @@ msgstr "العملة" msgid "Date" msgstr "التاريخ" +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_percentage_wizard_form +msgid "Discard" +msgstr "" + #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_account_analytic_account__display_name #: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__display_name #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__display_name #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__display_name +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__display_name +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__display_name msgid "Display Name" msgstr "الاسم المعروض" @@ -291,6 +303,11 @@ msgstr "مسودة" msgid "Draft Budgets" msgstr "موازنة مؤقتة" +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_account_analytic_account_form_inherit_budget +msgid "Duplicate" +msgstr "" + #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__date_to #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__date_to @@ -337,6 +354,8 @@ msgstr "تجميع حسب" #: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__id #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__id #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__id msgid "ID" msgstr "المُعرف" @@ -377,6 +396,8 @@ msgstr "متابع" #: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post____last_update #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget____last_update #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines____last_update +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard____last_update +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard____last_update msgid "Last Modified on" msgstr "آخر تعديل في" @@ -384,6 +405,8 @@ msgstr "آخر تعديل في" #: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__write_uid #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__write_uid #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__write_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__write_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__write_uid msgid "Last Updated by" msgstr "آخر تحديث بواسطة" @@ -391,6 +414,8 @@ msgstr "آخر تحديث بواسطة" #: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__write_date #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__write_date #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__write_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__write_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__write_date msgid "Last Updated on" msgstr "آخر تحديث في" @@ -399,6 +424,11 @@ msgstr "آخر تحديث في" msgid "Late Activities" msgstr "الأنشطة المتأخرة" +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__line_ids +msgid "Lines" +msgstr "" + #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_main_attachment_id msgid "Main Attachment" @@ -414,6 +444,11 @@ msgstr "خطأ في تسليم الرسائل" msgid "Messages" msgstr "الرسائل" +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__my_activity_date_deadline +msgid "My Activity Deadline" +msgstr "" + #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__name #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__name @@ -470,6 +505,21 @@ msgstr "عدد الرسائل الجديدة" msgid "Paid Date" msgstr "تاريخ السداد" +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_analytic_account__parent_id +msgid "Parent" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_analytic_account__parent_path +msgid "Parent Path" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__percentage +msgid "Percentage" +msgstr "" + #. module: odex25_account_budget #: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form msgid "Period" @@ -487,6 +537,11 @@ msgstr "المبلغ المخطط" msgid "Planned amount" msgstr "المبلغ المخطط" +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_percentage_wizard_form +msgid "Please Select Budgetary Positions Percentage" +msgstr "" + #. module: odex25_account_budget #: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__practical_amount #: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form @@ -566,7 +621,13 @@ msgstr "القيمة النظرية" #: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_graph #: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_pivot msgid "Theoretical amount" -msgstr "" +msgstr "القيمة النظرية" + +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/models/account_budget.py:0 +#, python-format +msgid "This Account %s is already exist in another budget." +msgstr "هذا الحساب %s موجود بالفعل في ميزانية أخرى." #. module: odex25_account_budget #: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_search @@ -583,6 +644,11 @@ msgstr "للموافقة علي الموازنة" msgid "Today Activities" msgstr "نشاطات اليوم" +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget_lines__practical_amount +msgid "Total amount of money that has been spent" +msgstr "" + #. module: odex25_account_budget #: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__activity_exception_decoration msgid "Type of the exception activity on record." @@ -618,6 +684,17 @@ msgstr "رسائل الموقع" msgid "Website communication history" msgstr "سجل تواصل الموقع" +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__wizard_id +msgid "Wizard" +msgstr "" + +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/models/account_budget.py:0 +#, python-format +msgid "You cannot delete a budget that is used in a budget line." +msgstr "لا يمكنك حذف الميزانية المستخدمة في بند الميزانية" + #. module: odex25_account_budget #: code:addons/odex25_account_budget/models/account_budget.py:0 #, python-format @@ -627,3 +704,15 @@ msgid "" msgstr "" "يجب أن تُدرج على الأقل موقفًا موازنيًا أو حسابًا تحليلًا واحدًا في بند " "الموازنة." + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_percentage_wizard_form +msgid "or" +msgstr "أو" + +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/models/account_budget.py:0 +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget_lines__analytic_account_id +#, python-format +msgid "الحساب التحليلي المرتبط بالميزانية" +msgstr "" diff --git a/odex25_accounting/odex25_account_budget/i18n/ar_001.po b/odex25_accounting/odex25_account_budget/i18n/ar_001.po new file mode 100644 index 000000000..d9d9ecaf1 --- /dev/null +++ b/odex25_accounting/odex25_account_budget/i18n/ar_001.po @@ -0,0 +1,718 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * odex25_account_budget +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-01 07:42+0000\n" +"PO-Revision-Date: 2024-07-01 07:42+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: odex25_account_budget +#: code:addons/odex25_account_budget/models/account_budget.py:0 +#, python-format +msgid "" +"\"End Date\" of the budget line should be included in the Period of the " +"budget" +msgstr "يجب أن تتضمن فترة الموازنة تاريخ انتهاء بند الموازنة" + +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/models/account_budget.py:0 +#, python-format +msgid "" +"\"Start Date\" of the budget line should be included in the Period of the " +"budget" +msgstr "يجب أن تتضمن فترة الموازنة تاريخ بدء بند الموازنة" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_kanban +msgid "" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__account_ids +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_budget_post_form +msgid "Accounts" +msgstr "الحسابات" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__percentage +msgid "Achievement" +msgstr "نسبة الصرف" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_needaction +msgid "Action Needed" +msgstr "إجراء مطلوب" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__activity_ids +msgid "Activities" +msgstr "الأنشطة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__activity_exception_decoration +msgid "Activity Exception Decoration" +msgstr "زخرفة استثناء النشاط" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__activity_state +msgid "Activity State" +msgstr "حالة النشاط" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__activity_type_icon +msgid "Activity Type Icon" +msgstr "أيقونة نوع النشاط" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget_lines__planned_amount +msgid "" +"Amount you plan to earn/spend. Record a positive amount if it is a revenue " +"and a negative amount if it is a cost." +msgstr "" +"المبلغ الذي تخطط لربحه/إنفاقه. سجله كقيمة موجبة إذا كان ربحًا وسالبة إذا " +"كانت تكلفة." + +#. module: odex25_account_budget +#: model:ir.model,name:odex25_account_budget.model_account_analytic_account +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__analytic_account_id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__analytic_account_id +msgid "Analytic Account" +msgstr "الحساب التحليلي" + +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/wizard/crossovered_budget_percentage_wizard.py:0 +#, python-format +msgid "Analytic Accounts" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__analytic_group_id +msgid "Analytic Group" +msgstr "مجموعة تحليلية" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +msgid "Approve" +msgstr "موافقة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_attachment_count +msgid "Attachment Count" +msgstr "عدد المرفقات" + +#. module: odex25_account_budget +#: model:ir.model,name:odex25_account_budget.model_crossovered_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__crossovered_budget_id +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_tree +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_account_analytic_account_form_inherit_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_search +msgid "Budget" +msgstr "الموازنة" + +#. module: odex25_account_budget +#: model:ir.actions.act_window,name:odex25_account_budget.act_account_analytic_account_cb_lines +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_account_analytic_account_form_inherit_budget +msgid "Budget Items" +msgstr "بنود الموازنة" + +#. module: odex25_account_budget +#: model:ir.model,name:odex25_account_budget.model_crossovered_budget_lines +msgid "Budget Line" +msgstr "بند الموازنة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_analytic_account__crossovered_budget_line +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__crossovered_budget_line +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_form +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_graph +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_pivot +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_search +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_tree +msgid "Budget Lines" +msgstr "خطوط الموازنة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__name +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +msgid "Budget Name" +msgstr "اسم الموازنة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__crossovered_budget_state +msgid "Budget State" +msgstr "حالة الموازنة" + +#. module: odex25_account_budget +#: model:ir.model,name:odex25_account_budget.model_account_budget_post +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__general_budget_id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__budget_post_id +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_budget_post_form +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_budget_post_search +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_budget_post_tree +msgid "Budgetary Position" +msgstr "بند الموازنة" + +#. module: odex25_account_budget +#: model:ir.actions.act_window,name:odex25_account_budget.open_budget_post_form +#: model:ir.ui.menu,name:odex25_account_budget.menu_budget_post_form +msgid "Budgetary Positions" +msgstr "مراكز الموازنة" + +#. module: odex25_account_budget +#: model:ir.actions.act_window,name:odex25_account_budget.act_crossovered_budget_view +#: model:ir.ui.menu,name:odex25_account_budget.menu_act_crossovered_budget_view +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_search +msgid "Budgets" +msgstr "الموازنات" + +#. module: odex25_account_budget +#: model:ir.actions.act_window,name:odex25_account_budget.act_crossovered_budget_lines_view +#: model:ir.ui.menu,name:odex25_account_budget.menu_act_crossovered_budget_lines_view +msgid "Budgets Analysis" +msgstr "تحليل الموازنات" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +msgid "Cancel Budget" +msgstr "إلغاء الموازنة" + +#. module: odex25_account_budget +#: model:ir.model.fields.selection,name:odex25_account_budget.selection__crossovered_budget__state__cancel +msgid "Cancelled" +msgstr "ملغي" + +#. module: odex25_account_budget +#: model_terms:ir.actions.act_window,help:odex25_account_budget.act_crossovered_budget_view +msgid "Click to create a new budget." +msgstr "اضغط لإنشاء موازنة جديدة." + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__company_id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__company_id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__company_id +msgid "Company" +msgstr "شركة" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget_lines__percentage +msgid "" +"Comparison between practical and theoretical amount. This measure tells you " +"if you are below or over budget." +msgstr "" +"المقارنة بين القيمة الفعلية والنظرية. تحدد نسبة الانحراف في الإيرادات أو " +"المصروفات في الموازنة." + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +msgid "Confirm" +msgstr "تأكيد" + +#. module: odex25_account_budget +#: model:ir.model.fields.selection,name:odex25_account_budget.selection__crossovered_budget__state__confirm +msgid "Confirmed" +msgstr "مؤكد" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_percentage_wizard_form +msgid "Copy" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.actions.act_window,name:odex25_account_budget.crossovered_budget_percentage_wizard_action +msgid "Copy Budgetary Positions" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__create_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__create_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__create_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__create_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__create_uid +msgid "Created by" +msgstr "أنشئ بواسطة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__create_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__create_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__create_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__create_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__create_date +msgid "Created on" +msgstr "أنشئ في" + +#. module: odex25_account_budget +#: model:ir.model,name:odex25_account_budget.model_crossovered_budget_percentage_line_wizard +msgid "CrossOvered Budget Percentage Lines Wizard" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model,name:odex25_account_budget.model_crossovered_budget_percentage_wizard +msgid "CrossOvered Budget Percentage Wizard" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__currency_id +msgid "Currency" +msgstr "العملة" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_search +msgid "Date" +msgstr "التاريخ" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_percentage_wizard_form +msgid "Discard" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_analytic_account__display_name +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__display_name +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__display_name +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__display_name +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__display_name +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__display_name +msgid "Display Name" +msgstr "الاسم المعروض" + +#. module: odex25_account_budget +#: model:ir.model.fields.selection,name:odex25_account_budget.selection__crossovered_budget__state__done +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +msgid "Done" +msgstr "الإعتماد النهائي" + +#. module: odex25_account_budget +#: model:ir.model.fields.selection,name:odex25_account_budget.selection__crossovered_budget__state__draft +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_search +msgid "Draft" +msgstr "مسودة" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_search +msgid "Draft Budgets" +msgstr "موازنة مؤقتة" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_account_analytic_account_form_inherit_budget +msgid "Duplicate" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__date_to +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__date_to +msgid "End Date" +msgstr "تاريخ الانتهاء" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +msgid "Entries..." +msgstr "القيود..." + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_follower_ids +msgid "Followers" +msgstr "المتابعون" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_channel_ids +msgid "Followers (Channels)" +msgstr "المتابعون (القنوات)" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_partner_ids +msgid "Followers (Partners)" +msgstr "المتابعون (الشركاء)" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__activity_type_icon +msgid "Font awesome icon e.g. fa-tasks" +msgstr "" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_search +msgid "Future Activities" +msgstr "الأنشطة المستقبلية" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_search +msgid "Group By" +msgstr "تجميع حسب" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_analytic_account__id +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__id +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__id +msgid "ID" +msgstr "المُعرف" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__activity_exception_icon +msgid "Icon" +msgstr "الأيقونة" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__activity_exception_icon +msgid "Icon to indicate an exception activity." +msgstr "الأيقونة للإشارة إلى استثناء النشاط" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__message_needaction +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__message_unread +msgid "If checked, new messages require your attention." +msgstr "إذا كان محددًا، فهناك رسائل جديدة تحتاج لرؤيتها." + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__message_has_error +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__message_has_sms_error +msgid "If checked, some messages have a delivery error." +msgstr "إذا كان محددًا، فقد حدث خطأ في تسليم بعض الرسائل." + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__is_above_budget +msgid "Is Above Budget" +msgstr "يفوق الموازنة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_is_follower +msgid "Is Follower" +msgstr "متابع" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_analytic_account____last_update +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post____last_update +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget____last_update +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines____last_update +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard____last_update +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard____last_update +msgid "Last Modified on" +msgstr "آخر تعديل في" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__write_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__write_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__write_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__write_uid +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__write_uid +msgid "Last Updated by" +msgstr "آخر تحديث بواسطة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__write_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__write_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__write_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__write_date +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__write_date +msgid "Last Updated on" +msgstr "آخر تحديث في" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_search +msgid "Late Activities" +msgstr "الأنشطة المتأخرة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_wizard__line_ids +msgid "Lines" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_main_attachment_id +msgid "Main Attachment" +msgstr "المرفق الرئيسي" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_has_error +msgid "Message Delivery error" +msgstr "خطأ في تسليم الرسائل" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_ids +msgid "Messages" +msgstr "الرسائل" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__my_activity_date_deadline +msgid "My Activity Deadline" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_budget_post__name +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__name +msgid "Name" +msgstr "الاسم" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "الموعد النهائي للنشاط التالي" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__activity_summary +msgid "Next Activity Summary" +msgstr "ملخص النشاط التالي" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__activity_type_id +msgid "Next Activity Type" +msgstr "نوع النشاط التالي" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_search +msgid "Not Cancelled" +msgstr "ليس ملغيًا" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_needaction_counter +msgid "Number of Actions" +msgstr "عدد الإجراءات" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_has_error_counter +msgid "Number of errors" +msgstr "عدد الاخطاء" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__message_needaction_counter +msgid "Number of messages which requires an action" +msgstr "عدد الرسائل التي تتطلب إجراء" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__message_has_error_counter +msgid "Number of messages with delivery error" +msgstr "عدد الرسائل الحادث بها خطأ في التسليم" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__message_unread_counter +msgid "Number of unread messages" +msgstr "عدد الرسائل الجديدة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__paid_date +msgid "Paid Date" +msgstr "تاريخ السداد" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_analytic_account__parent_id +msgid "Parent" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_account_analytic_account__parent_path +msgid "Parent Path" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__percentage +msgid "Percentage" +msgstr "" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +msgid "Period" +msgstr "الفترة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__planned_amount +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +msgid "Planned Amount" +msgstr "المبلغ المخطط" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_graph +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_pivot +msgid "Planned amount" +msgstr "المبلغ المخطط" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_percentage_wizard_form +msgid "Please Select Budgetary Positions Percentage" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__practical_amount +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_account_analytic_account_form_inherit_budget +msgid "Practical Amount" +msgstr "المبلغ الفعلي" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_graph +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_pivot +msgid "Practical amount" +msgstr "المبلغ الفعلي" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +msgid "Reset to Draft" +msgstr "إعادة التعيين لحالة مسودة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__user_id +msgid "Responsible" +msgstr "المسئول" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__activity_user_id +msgid "Responsible User" +msgstr "المستخدم المسؤول" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_has_sms_error +msgid "SMS Delivery error" +msgstr "خطأ في تسليم الرسائل القصيرة" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_search +msgid "Show all records which has next action date is before today" +msgstr "عرض كافة السجلات المُعين لها تاريخ إجراء تالي يسبق تاريخ اليوم الجاري" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__date_from +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__date_from +msgid "Start Date" +msgstr "تاريخ البداية" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__state +msgid "Status" +msgstr "الحالة" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__activity_state +msgid "" +"Status based on activities\n" +"Overdue: Due date is already passed\n" +"Today: Activity date is today\n" +"Planned: Future activities." +msgstr "" +"الحالة على أساس الأنشطة\n" +"المتأخرة: تاريخ الاستحقاق مر\n" +"اليوم: تاريخ النشاط هو اليوم\n" +"المخطط: الأنشطة المستقبلية." + +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/models/account_budget.py:0 +#, python-format +msgid "The budget must have at least one account." +msgstr "يجب أن تحتوي الموازنة على حساب واحد على الأقل." + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_lines__theoritical_amount +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_view_form +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_account_analytic_account_form_inherit_budget +msgid "Theoretical Amount" +msgstr "القيمة النظرية" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_graph +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_line_pivot +msgid "Theoretical amount" +msgstr "القيمة النظرية" + +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/models/account_budget.py:0 +#, python-format +msgid "This Account %s is already exist in another budget." +msgstr "هذا الحساب %s موجود بالفعل في ميزانية أخرى." + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_search +msgid "To Approve" +msgstr "للاعتماد" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_search +msgid "To Approve Budgets" +msgstr "للموافقة علي الموازنة" + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.view_crossovered_budget_search +msgid "Today Activities" +msgstr "نشاطات اليوم" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget_lines__practical_amount +msgid "Total amount of money that has been spent" +msgstr "" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__activity_exception_decoration +msgid "Type of the exception activity on record." +msgstr "نوع النشاط الاستثنائي المسجل." + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_unread +msgid "Unread Messages" +msgstr "الرسائل الجديدة" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__message_unread_counter +msgid "Unread Messages Counter" +msgstr "عدد الرسائل الجديدة" + +#. module: odex25_account_budget +#: model_terms:ir.actions.act_window,help:odex25_account_budget.act_crossovered_budget_view +msgid "Use budgets to compare actual with expected revenues and costs" +msgstr "استخدم موازنات لمقارنة الربح الحقيقي مع الربح المتوقع والتكاليف" + +#. module: odex25_account_budget +#: model:ir.model.fields.selection,name:odex25_account_budget.selection__crossovered_budget__state__validate +msgid "Validated" +msgstr "تم الاعتماد" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget__website_message_ids +msgid "Website Messages" +msgstr "رسائل الموقع" + +#. module: odex25_account_budget +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget__website_message_ids +msgid "Website communication history" +msgstr "سجل تواصل الموقع" + +#. module: odex25_account_budget +#: model:ir.model.fields,field_description:odex25_account_budget.field_crossovered_budget_percentage_line_wizard__wizard_id +msgid "Wizard" +msgstr "" + +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/models/account_budget.py:0 +#, python-format +msgid "You cannot delete a budget that is used in a budget line." +msgstr "لا يمكنك حذف الميزانية المستخدمة في بند الميزانية" + +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/models/account_budget.py:0 +#, python-format +msgid "" +"You have to enter at least a budgetary position or analytic account on a " +"budget line." +msgstr "" +"يجب أن تُدرج على الأقل موقفًا موازنيًا أو حسابًا تحليلًا واحدًا في بند " +"الموازنة." + +#. module: odex25_account_budget +#: model_terms:ir.ui.view,arch_db:odex25_account_budget.crossovered_budget_percentage_wizard_form +msgid "or" +msgstr "أو" + +#. module: odex25_account_budget +#: code:addons/odex25_account_budget/models/account_budget.py:0 +#: model:ir.model.fields,help:odex25_account_budget.field_crossovered_budget_lines__analytic_account_id +#, python-format +msgid "الحساب التحليلي المرتبط بالميزانية" +msgstr "" diff --git a/odex25_accounting/odex25_account_budget/models/__init__.py b/odex25_accounting/odex25_account_budget/models/__init__.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/models/account_analytic_account.py b/odex25_accounting/odex25_account_budget/models/account_analytic_account.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/models/account_budget.py b/odex25_accounting/odex25_account_budget/models/account_budget.py old mode 100644 new mode 100755 index 2b44f6fa4..66b8e972f --- a/odex25_accounting/odex25_account_budget/models/account_budget.py +++ b/odex25_accounting/odex25_account_budget/models/account_budget.py @@ -17,7 +17,7 @@ class AccountBudgetPost(models.Model): name = fields.Char('Name', required=True) account_ids = fields.Many2many('account.account', 'account_budget_rel', 'budget_id', 'account_id', 'Accounts', - domain="[('deprecated', '=', False), ('company_id', '=', company_id)]") + domain="[('deprecated', '=', False), ('company_id', '=', company_id)]",copy=False) company_id = fields.Many2one('res.company', 'Company', required=True, default=lambda self: self.env.company) @@ -38,7 +38,19 @@ class AccountBudgetPost(models.Model): account_ids = self.account_ids if not account_ids: raise ValidationError(_('The budget must have at least one account.')) + def unlink(self): + # raise an error if the budget is used in a crossovered.budget.lines + for budget in self: + if self.env['crossovered.budget.lines'].search_count([('general_budget_id', '=', budget.id)]): + raise ValidationError(_('You cannot delete a budget that is used in a budget line.')) + @api.constrains('account_ids') + def check_account_only_exist_in_one_budget(self): + for budget in self.search([]): + for account in self.account_ids: + if budget.account_ids == account and budget.id != self.id: + raise ValidationError(_('This Account %s is already exist in another budget.', account.name)) + # _('%s (rounding)', biggest_tax_line.name), @api.model def create(self, vals): self._check_account_ids(vals) @@ -57,8 +69,8 @@ class CrossoveredBudget(models.Model): name = fields.Char('Budget Name', required=True, tracking=True) user_id = fields.Many2one('res.users', 'Responsible', default=lambda self: self.env.user, tracking=True) - date_from = fields.Date('Start Date', required=True, tracking=True, copy=True) - date_to = fields.Date('End Date', required=True, tracking=True, copy=True) + date_from = fields.Date('Start Date', required=True, tracking=True) + date_to = fields.Date('End Date', required=True, tracking=True) state = fields.Selection([ ('draft', 'Draft'), ('cancel', 'Cancelled'), @@ -86,10 +98,6 @@ class CrossoveredBudget(models.Model): def action_budget_done(self): self.write({'state': 'done'}) - def copy(self, default=None): - default = dict(default or {}, name=_("%s (copy)") % (self.name)) - return super(CrossoveredBudget, self).copy(default) - class CrossoveredBudgetLines(models.Model): _name = "crossovered.budget.lines" @@ -98,14 +106,12 @@ class CrossoveredBudgetLines(models.Model): name = fields.Char(compute='_compute_line_name') crossovered_budget_id = fields.Many2one('crossovered.budget', 'Budget', ondelete='cascade', index=True, required=True) - analytic_account_id = fields.Many2one('account.analytic.account', 'Analytic Account') + analytic_account_id = fields.Many2one('account.analytic.account', 'Analytic Account',help=_("الحساب التحليلي المرتبط بالميزانية")) analytic_group_id = fields.Many2one('account.analytic.group', 'Analytic Group', related='analytic_account_id.group_id', readonly=True) general_budget_id = fields.Many2one('account.budget.post', 'Budgetary Position') - date_from = fields.Date('Start Date', related='crossovered_budget_id.date_from', readonly=False, - store=True) - date_to = fields.Date('End Date', related='crossovered_budget_id.date_to', readonly=False, - store=True) + date_from = fields.Date('Start Date', required=True ,related='crossovered_budget_id.date_from',readonly=False,store=True,default=fields.Date.today()) + date_to = fields.Date('End Date', required=True , related='crossovered_budget_id.date_to',readonly=False,store=True,default=fields.Date.today()) paid_date = fields.Date('Paid Date') currency_id = fields.Many2one('res.currency', related='company_id.currency_id', readonly=True) planned_amount = fields.Monetary( diff --git a/odex25_accounting/odex25_account_budget/security/account_budget_security.xml b/odex25_accounting/odex25_account_budget/security/account_budget_security.xml old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/security/ir.model.access.csv b/odex25_accounting/odex25_account_budget/security/ir.model.access.csv old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/static/description/icon.png b/odex25_accounting/odex25_account_budget/static/description/icon.png old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/tests/__init__.py b/odex25_accounting/odex25_account_budget/tests/__init__.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/tests/common.py b/odex25_accounting/odex25_account_budget/tests/common.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/tests/test_account_budget.py b/odex25_accounting/odex25_account_budget/tests/test_account_budget.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/tests/test_theoreticalamount.py b/odex25_accounting/odex25_account_budget/tests/test_theoreticalamount.py old mode 100644 new mode 100755 diff --git a/odex25_accounting/odex25_account_budget/views/account_analytic_account_views.xml b/odex25_accounting/odex25_account_budget/views/account_analytic_account_views.xml old mode 100644 new mode 100755 index 0d6f988dc..3f276a1c8 --- a/odex25_accounting/odex25_account_budget/views/account_analytic_account_views.xml +++ b/odex25_accounting/odex25_account_budget/views/account_analytic_account_views.xml @@ -25,7 +25,7 @@ - + diff --git a/odex25_accounting/odex25_account_budget/views/account_budget_views.xml b/odex25_accounting/odex25_account_budget/views/account_budget_views.xml old mode 100644 new mode 100755 index 21db73db8..0491c6857 --- a/odex25_accounting/odex25_account_budget/views/account_budget_views.xml +++ b/odex25_accounting/odex25_account_budget/views/account_budget_views.xml @@ -41,22 +41,22 @@ Budgets account.budget.post - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -75,7 +75,7 @@ Budgets class="oe_highlight"/> - + @@ -86,8 +86,7 @@ Budgets - + @@ -106,14 +105,9 @@ Budgets - - - + + + @@ -121,7 +115,7 @@ Budgets - + @@ -236,12 +230,12 @@ Budgets help="To Approve Budgets"/> + domain="[('activity_ids.date_deadline', '<', context_today().strftime('%Y-%m-%d'))]" + help="Show all records which has next action date is before today"/> + domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/> + domain="[('activity_ids.date_deadline', '>', context_today().strftime('%Y-%m-%d'))]"/> @@ -252,7 +246,7 @@ Budgets tree,kanban,form - + Click to create a new budget. @@ -274,13 +268,11 @@ Budgets - + - + @@ -294,12 +286,12 @@ Budgets - - + + - - - + + + @@ -316,65 +308,29 @@ Budgets - - - - - - + + + + + + - - - - + + + + - - crossovered.budget.line.pivot - crossovered.budget.lines - - - - - - - - - - - - - crossovered.budget.line.graph - crossovered.budget.lines - - - - - - - - - Budgets Analysis crossovered.budget.lines tree,form,pivot,graph - {'search_default_group_crossevered_budgdet_id': True, - 'search_default_filter_not_cancelled':True} - + {'search_default_group_crossevered_budgdet_id': True, 'search_default_filter_not_cancelled':True} Budget Items crossovered.budget.lines - {'search_default_analytic_account_id': [active_id], 'default_analytic_account_id': - active_id} - + {'search_default_analytic_account_id': [active_id], 'default_analytic_account_id': active_id} diff --git a/odex25_accounting/odex25_account_budget/views/res_config_settings_views.xml b/odex25_accounting/odex25_account_budget/views/res_config_settings_views.xml old mode 100644 new mode 100755
Click to create a new budget.