From fd5e6203738dd704e77b49f5ccd0c82fecdbe5ec Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 5 Aug 2022 12:47:47 +0000 Subject: [PATCH] Add module account_move_label_copy --- account_move_label_copy/__init__.py | 1 + account_move_label_copy/__manifest__.py | 29 +++++++++++++++++++ account_move_label_copy/models/__init__.py | 1 + .../models/account_move.py | 13 +++++++++ .../views/account_move.xml | 23 +++++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 account_move_label_copy/__init__.py create mode 100644 account_move_label_copy/__manifest__.py create mode 100644 account_move_label_copy/models/__init__.py create mode 100644 account_move_label_copy/models/account_move.py create mode 100644 account_move_label_copy/views/account_move.xml diff --git a/account_move_label_copy/__init__.py b/account_move_label_copy/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/account_move_label_copy/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_move_label_copy/__manifest__.py b/account_move_label_copy/__manifest__.py new file mode 100644 index 0000000..367ff19 --- /dev/null +++ b/account_move_label_copy/__manifest__.py @@ -0,0 +1,29 @@ +# Copyright 2022 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Account Move Label Copy', + 'version': '14.0.1.0.0', + 'category': 'Accounting & Finance', + 'license': 'AGPL-3', + 'summary': 'When creating a Journal Entry manually, copy label from line to line', + 'description': """ +Account Move Label Copy +======================= + +This module is ONLY for users who don't accept to use the 'Reference' (ref) to store the description of the journal entry (the recommended method), but want to use the label on the lines for that purpose (name field of account.move.line). With this module, the label of the first line will be copied by default to the other lines upon creation of each line. + +I don't recommend the use of this module. +""", + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': [ + 'account', + 'base_view_inheritance_extension', + ], + 'data': [ + 'views/account_move.xml', + ], + 'installable': True, +} diff --git a/account_move_label_copy/models/__init__.py b/account_move_label_copy/models/__init__.py new file mode 100644 index 0000000..9c0a421 --- /dev/null +++ b/account_move_label_copy/models/__init__.py @@ -0,0 +1 @@ +from . import account_move diff --git a/account_move_label_copy/models/account_move.py b/account_move_label_copy/models/account_move.py new file mode 100644 index 0000000..0350fff --- /dev/null +++ b/account_move_label_copy/models/account_move.py @@ -0,0 +1,13 @@ +# Copyright 2022 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + default_move_line_name = fields.Char( + related='line_ids.name', + string='Default Journal Item Label') diff --git a/account_move_label_copy/views/account_move.xml b/account_move_label_copy/views/account_move.xml new file mode 100644 index 0000000..91f32b4 --- /dev/null +++ b/account_move_label_copy/views/account_move.xml @@ -0,0 +1,23 @@ + + + + + + + account.move + + + + + + + default_move_line_name + + + + +