diff --git a/account_move_line_partner_country/__init__.py b/account_move_line_partner_country/__init__.py new file mode 100644 index 000000000..31660d6a9 --- /dev/null +++ b/account_move_line_partner_country/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models diff --git a/account_move_line_partner_country/__manifest__.py b/account_move_line_partner_country/__manifest__.py new file mode 100644 index 000000000..71fda9361 --- /dev/null +++ b/account_move_line_partner_country/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2021 CorporateHub (https://corporatehub.eu) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Accounting: Account Move Line Partner's Country", + "summary": "Show Partner's Country on Account Move Line.", + "version": "12.0.1.0.0", + "category": "Accounting", + "website": "https://github.com/OCA/account-financial-tools", + "author": "CorporateHub, Odoo Community Association (OCA)", + "maintainers": ["alexey-pelykh"], + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": [ + "account", + ], + "data": [ + "views/account_move_line.xml", + ], +} diff --git a/account_move_line_partner_country/models/__init__.py b/account_move_line_partner_country/models/__init__.py new file mode 100644 index 000000000..bc7621f75 --- /dev/null +++ b/account_move_line_partner_country/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import account_move_line diff --git a/account_move_line_partner_country/models/account_move_line.py b/account_move_line_partner_country/models/account_move_line.py new file mode 100644 index 000000000..e627668ac --- /dev/null +++ b/account_move_line_partner_country/models/account_move_line.py @@ -0,0 +1,15 @@ +# Copyright 2021 CorporateHub (https://corporatehub.eu) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + partner_country_id = fields.Many2one( + comodel_name="res.country", + string="Partner's Country", + related="partner_id.country_id", + store=True, + ) diff --git a/account_move_line_partner_country/readme/CONTRIBUTORS.rst b/account_move_line_partner_country/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..724bc1d03 --- /dev/null +++ b/account_move_line_partner_country/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `CorporateHub `__ + + * Alexey Pelykh diff --git a/account_move_line_partner_country/readme/DESCRIPTION.rst b/account_move_line_partner_country/readme/DESCRIPTION.rst new file mode 100644 index 000000000..9db5d6dde --- /dev/null +++ b/account_move_line_partner_country/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows viewing Partner's Country on Account Move Line. diff --git a/account_move_line_partner_country/tests/__init__.py b/account_move_line_partner_country/tests/__init__.py new file mode 100644 index 000000000..ef5ae3587 --- /dev/null +++ b/account_move_line_partner_country/tests/__init__.py @@ -0,0 +1 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). diff --git a/account_move_line_partner_country/views/account_move_line.xml b/account_move_line_partner_country/views/account_move_line.xml new file mode 100644 index 000000000..3ff9132a4 --- /dev/null +++ b/account_move_line_partner_country/views/account_move_line.xml @@ -0,0 +1,33 @@ + + + + + + account.move.line.form + account.move.line + + + + + + + + + + account.move.line.filter + account.move.line + + + + + + + + + + + +