diff --git a/addons/l10n_gcc_invoice/__init__.py b/addons/l10n_gcc_invoice/__init__.py new file mode 100644 index 00000000000..dc5e6b693d1 --- /dev/null +++ b/addons/l10n_gcc_invoice/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import models diff --git a/addons/l10n_gcc_invoice/__manifest__.py b/addons/l10n_gcc_invoice/__manifest__.py new file mode 100644 index 00000000000..0ac35562f89 --- /dev/null +++ b/addons/l10n_gcc_invoice/__manifest__.py @@ -0,0 +1,16 @@ +# -*- encoding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +{ + 'name': 'G.C.C. - Arabic/English Invoice', + 'version': '1.0.0', + 'author': 'Odoo', + 'category': 'Accounting/Localizations', + 'description': """ + Arabic/English for GCC +""", + 'license': 'LGPL-3', + 'depends': ['account'], + 'data': [ + 'views/report_invoice.xml', + ], +} diff --git a/addons/l10n_gcc_invoice/models/__init__.py b/addons/l10n_gcc_invoice/models/__init__.py new file mode 100644 index 00000000000..c0124efe182 --- /dev/null +++ b/addons/l10n_gcc_invoice/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import account_move diff --git a/addons/l10n_gcc_invoice/models/account_move.py b/addons/l10n_gcc_invoice/models/account_move.py new file mode 100644 index 00000000000..23d0869f884 --- /dev/null +++ b/addons/l10n_gcc_invoice/models/account_move.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import fields, models, api + + +class AccountMove(models.Model): + _inherit = 'account.move' + + narration = fields.Text(translate=True) + + def _get_name_invoice_report(self): + self.ensure_one() + if self.company_id.country_id in self.env.ref('base.gulf_cooperation_council').country_ids: + return 'l10n_gcc_invoice.arabic_english_invoice' + return super()._get_name_invoice_report() + + +class AccountMoveLine(models.Model): + _inherit = 'account.move.line' + + l10n_gcc_invoice_tax_amount = fields.Float(string='Tax Amount', compute='_compute_tax_amount', digits='Product Price') + + @api.depends('price_subtotal', 'price_total') + def _compute_tax_amount(self): + for record in self: + record.l10n_gcc_invoice_tax_amount = record.price_total - record.price_subtotal diff --git a/addons/l10n_gcc_invoice/views/report_invoice.xml b/addons/l10n_gcc_invoice/views/report_invoice.xml new file mode 100644 index 00000000000..88b55b1e7de --- /dev/null +++ b/addons/l10n_gcc_invoice/views/report_invoice.xml @@ -0,0 +1,569 @@ + + + + + + + + + + + + +