Merge lp:~sandi-dirntis/openerpsl/internal_20140310_1 into lp:openerpsl/mentis-internal

Proposed by Aleksander Dirntiš
Status: Merged
Merged at revision: 45
Proposed branch: lp:~sandi-dirntis/openerpsl/internal_20140310_1
Merge into: lp:openerpsl/mentis-internal
Diff against target: 110 lines (+95/-0)
3 files modified
account_voucher_exchange_rate_error/__init__.py (+23/-0)
account_voucher_exchange_rate_error/__openerp__.py (+38/-0)
account_voucher_exchange_rate_error/account_voucher.py (+34/-0)
To merge this branch: bzr merge lp:~sandi-dirntis/openerpsl/internal_20140310_1
Reviewer Review Type Date Requested Status
Mentis Pending
Review via email: mp+210200@code.launchpad.net

Description of the change

[ADD] Warning when trying to reconcile already closed invoice

To post a comment you must log in.
45. By Aleksander Dirntiš

[ADD] Warning when trying to reconcile already closed invoice

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_voucher_exchange_rate_error'
2=== added file 'account_voucher_exchange_rate_error/__init__.py'
3--- account_voucher_exchange_rate_error/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_voucher_exchange_rate_error/__init__.py 2014-03-10 13:05:14 +0000
5@@ -0,0 +1,23 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Copyright (C) 2004-TODAY OpenERP s.a. (<http://www.openerp.com>).
11+# Copyright (C) 2012-TODAY Mentis d.o.o. (<http://www.mentis.si>)
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as
15+# published by the Free Software Foundation, either version 3 of the
16+# License, or (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Affero General Public License for more details.
22+#
23+# You should have received a copy of the GNU Affero General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+##############################################################################
27+
28+import account_voucher
29
30=== added file 'account_voucher_exchange_rate_error/__openerp__.py'
31--- account_voucher_exchange_rate_error/__openerp__.py 1970-01-01 00:00:00 +0000
32+++ account_voucher_exchange_rate_error/__openerp__.py 2014-03-10 13:05:14 +0000
33@@ -0,0 +1,38 @@
34+# -*- coding: utf-8 -*-
35+##############################################################################
36+#
37+# OpenERP, Open Source Management Solution
38+# Copyright (C) 2004-TODAY OpenERP s.a. (<http://www.openerp.com>).
39+# Copyright (C) 2012-TODAY Mentis d.o.o. (<http://www.mentis.si>)
40+#
41+# This program is free software: you can redistribute it and/or modify
42+# it under the terms of the GNU Affero General Public License as
43+# published by the Free Software Foundation, either version 3 of the
44+# License, or (at your option) any later version.
45+#
46+# This program is distributed in the hope that it will be useful,
47+# but WITHOUT ANY WARRANTY; without even the implied warranty of
48+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49+# GNU Affero General Public License for more details.
50+#
51+# You should have received a copy of the GNU Affero General Public License
52+# along with this program. If not, see <http://www.gnu.org/licenses/>.
53+#
54+##############################################################################
55+
56+
57+{
58+ 'name': 'Account Voucher Exchange Rate Error',
59+ 'version': '1.0',
60+ 'category': 'Accounting',
61+ 'description': """
62+ Override exchange rate error when paying already reconciled entry
63+ """,
64+ 'author': 'Mentis d.o.o.',
65+ 'depends': ['account_voucher'],
66+ 'data': [
67+ ],
68+ 'installable': True,
69+ 'active': False,
70+}
71+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
72
73=== added file 'account_voucher_exchange_rate_error/account_voucher.py'
74--- account_voucher_exchange_rate_error/account_voucher.py 1970-01-01 00:00:00 +0000
75+++ account_voucher_exchange_rate_error/account_voucher.py 2014-03-10 13:05:14 +0000
76@@ -0,0 +1,34 @@
77+# -*- coding: utf-8 -*-
78+##############################################################################
79+#
80+# OpenERP, Open Source Management Solution
81+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
82+#
83+# This program is free software: you can redistribute it and/or modify
84+# it under the terms of the GNU Affero General Public License as
85+# published by the Free Software Foundation, either version 3 of the
86+# License, or (at your option) any later version.
87+#
88+# This program is distributed in the hope that it will be useful,
89+# but WITHOUT ANY WARRANTY; without even the implied warranty of
90+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91+# GNU Affero General Public License for more details.
92+#
93+# You should have received a copy of the GNU Affero General Public License
94+# along with this program. If not, see <http://www.gnu.org/licenses/>.
95+#
96+##############################################################################
97+
98+from openerp.osv import fields, osv
99+from tools.translate import _
100+
101+class account_voucher(osv.Model):
102+ _inherit = "account.voucher"
103+
104+ def _get_exchange_lines(self, cr, uid, line, move_id, amount_residual, company_currency, current_currency, context=None):
105+ if company_currency == current_currency:
106+ _text = line.name + ' - ' + line.partner_id.name
107+ raise osv.except_osv(_('Error!'),_('You are trying to pay already reconciled entry! \n' + _text))
108+ return False
109+ else:
110+ return super(account_voucher, self)._get_exchange_lines(cr, uid, line, move_id, amount_residual, company_currency, current_currency, context)

Subscribers

People subscribed via source and target branches

to all changes: