This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
131 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
============================ | ||
Account - Move Change Number | ||
============================ | ||
|
||
That module allows special user to rename account move. | ||
|
||
Usefull if the account move doesn't have the good numeration. | ||
(for exemple if you change account move sequence) | ||
|
||
Technical informations | ||
---------------------- | ||
|
||
* change account move name with next sequence | ||
* add in the field 'narration' the old name | ||
|
||
Contributors | ||
------------ | ||
|
||
* Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
|
||
Funders | ||
------- | ||
|
||
The development of this module has been financially supported by: | ||
|
||
* GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# -*- encoding: utf-8 -*- | ||
from . import model | ||
# coding: utf-8 | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,23 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Account - Move Change Number Module for Odoo | ||
# Copyright (C) 2013-Today GRAP (http://www.grap.coop) | ||
# @author Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
# coding: utf-8 | ||
# Copyright (C) 2013 - Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
{ | ||
'name': 'Account - Move Change Number', | ||
'version': '1.0', | ||
'version': '8.0.1.0.0', | ||
'category': 'Accounting', | ||
'description': """ | ||
Allow special user to rename account move | ||
========================================= | ||
Features | ||
-------- | ||
* Allow special user to rename account move ; | ||
Usefull if the account move doesn't have the good numeration. | ||
(for exemple if you change account move sequence) ; | ||
Technical informations | ||
---------------------- | ||
* change account move name with next sequence ; | ||
* add in the field 'narration' the old name ; | ||
Copyright, Author and Licence | ||
----------------------------- | ||
* Copyright : 2014, Groupement Régional Alimentaire de Proximité; | ||
* Author | ||
* Sylvain LE GAL (https://twitter.com/legalsylvain); | ||
* Licence : AGPL-3 (http://www.gnu.org/licenses/) | ||
""", | ||
'summary': "Allow special user to rename account move", | ||
'author': 'GRAP', | ||
'website': 'http://www.grap.coop', | ||
'license': 'AGPL-3', | ||
'depends': [ | ||
'account', | ||
'account_cancel', | ||
], | ||
'data': [ | ||
'security/res_groups.yml', | ||
'views/account_move_view.xml', | ||
'security/res_groups.xml', | ||
'views/view_account_move.xml', | ||
], | ||
'demo': [ | ||
'demo/res_groups.xml', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) | ||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
--> | ||
<openerp><data> | ||
|
||
<record id="account.group_account_manager" model="res.groups"> | ||
<field name="users" eval="[(4, ref('base.user_root'))]"/> | ||
</record> | ||
|
||
<record id="res_group_account_move_change_number_manager" model="res.groups"> | ||
<field name="users" eval="[(4, ref('base.user_root'))]"/> | ||
</record> | ||
|
||
</data></openerp> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2013 - Today: GRAP (http://www.grap.coop) | ||
@author Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
--> | ||
|
||
<openerp><data> | ||
|
||
<record id="res_group_account_move_change_number_manager" model="res.groups"> | ||
<field name="name">Account Move - Change Number</field> | ||
<field name="category_id" ref="base.module_category_usability" /> | ||
</record> | ||
|
||
</data></openerp> |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# coding: utf-8 | ||
from . import test_module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# coding: utf-8 | ||
# Copyright (C) 2018 - Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from openerp.tests.common import TransactionCase | ||
|
||
|
||
class TestModule(TransactionCase): | ||
|
||
def setUp(self): | ||
super(TestModule, self).setUp() | ||
self.invoice = self.env.ref('account.invoice_1') | ||
self.move = self.invoice.move_id | ||
|
||
def test_01_rename_move(self): | ||
# Allow cancelling entries | ||
self.move.journal_id.update_posted = True | ||
|
||
# Get sequence | ||
sequence = self.move.journal_id.sequence_id | ||
|
||
next_name = ("%s%s") % ( | ||
self.move.name[:-sequence.padding], | ||
str(sequence.number_next_actual).zfill(sequence.padding)) | ||
|
||
self.move.rename_account_move_change_number() | ||
|
||
self.assertEqual( | ||
self.move.name, next_name, | ||
"Rename of accounting entry failed.") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2013 - Today: GRAP (http://www.grap.coop) | ||
@author Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
--> | ||
|
||
<openerp><data> | ||
|
||
<record id="view_account_move_form" model="ir.ui.view"> | ||
<field name="model">account.move</field> | ||
<field name="inherit_id" ref="account.view_move_form" /> | ||
<field name="arch" type="xml"> | ||
<button name="button_cancel" position="after"> | ||
<button name="rename_account_move_change_number" | ||
string="Rename Account Move (change Number)" type="object" states="posted" | ||
groups="account_move_change_number.res_group_account_move_change_number_manager" confirm="Are you sure you want to rename this entry ?"/> | ||
</button> | ||
</field> | ||
</record> | ||
|
||
</data></openerp> |