Merge lp:~gkliska/storno-accounting/storno-accounting into lp:storno-accounting
- storno-accounting
- Merge into 6.1
Status: | Needs review |
---|---|
Proposed branch: | lp:~gkliska/storno-accounting/storno-accounting |
Merge into: | lp:storno-accounting |
Diff against target: |
886 lines (+842/-0) 8 files modified
account_storno/__init__.py (+30/-0) account_storno/__openerp__.py (+62/-0) account_storno/account.py (+96/-0) account_storno/account_invoice_refund.py (+125/-0) account_storno/account_view.xml (+17/-0) account_storno/i18n/account_storno.pot (+212/-0) account_storno/i18n/hr.po (+212/-0) account_storno/invoice.py (+88/-0) |
To merge this branch: | bzr merge lp:~gkliska/storno-accounting/storno-accounting |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Account Core Editors | Pending | ||
Review via email: mp+158022@code.launchpad.net |
Commit message
Description of the change
Initial commit to start with.
Known issues/dilemmas:
- how to control visible/
- constraint regarding Tax/Base amount maybe belongs to account-constraints project
- account_
Goran Kliska (gkliska) wrote : | # |
Hi Eric,
I think OpenERP application constraints are reliable - under transaction control if orm is used.
_check_
Storno check box at account_move_line would be duplication of data - something we tend to avoid.
SQL constraints across tables are not standard SQL.
IMO Application constraint is best option.
Thanks.
Eric Caudal - www.elico-corp.com (elicoidal) wrote : | # |
Hi Goran,
Having a constraint at SQL centralizes and secures the control (for
additional modules etc) and maintenance is easier.
Duplication of data in aml would allow to avoid cross table SQL
constraint actually. Besides it would log the storno moves inside the
aml (In case at some point a journal is switched on/off storno)
I am not sure as well about performance impacts: I would say the SQL
constraint tends to be much quicker than Python code.
Eric CAUDAL
Eric Caudal
/CEO/
--
*Elico Corporation, Shanghai branch
/OpenERP Premium Certified Training Partner/ *
Cell: + 86 186 2136 1670
Office: + 86 21 6211 8017/27/37
Skype: elico.corp
<email address hidden> <mailto:<email address hidden>>
http://
Elico Corp
On 04/11/2013 12:14 AM, Goran Kliska wrote:
> Hi Eric,
> I think OpenERP application constraints are reliable - under transaction control if orm is used.
> _check_
> Storno check box at account_move_line would be duplication of data - something we tend to avoid.
> SQL constraints across tables are not standard SQL.
> IMO Application constraint is best option.
> Thanks.
Unmerged revisions
- 1. By Slobodni programi
-
Initial commit
Preview Diff
1 | === added directory 'account_storno' | |||
2 | === added file 'account_storno/__init__.py' | |||
3 | --- account_storno/__init__.py 1970-01-01 00:00:00 +0000 | |||
4 | +++ account_storno/__init__.py 2013-04-10 09:33:20 +0000 | |||
5 | @@ -0,0 +1,30 @@ | |||
6 | 1 | # -*- encoding: utf-8 -*- | ||
7 | 2 | ############################################################################## | ||
8 | 3 | # | ||
9 | 4 | # OpenERP, Open Source Management Solution | ||
10 | 5 | # Module: account_storno | ||
11 | 6 | # Author: Goran Kliska | ||
12 | 7 | # mail: gkliskaATgmail.com | ||
13 | 8 | # Copyright (C) 2011- Slobodni programi d.o.o., Zagreb | ||
14 | 9 | # Contributions: | ||
15 | 10 | # | ||
16 | 11 | # This program is free software: you can redistribute it and/or modify | ||
17 | 12 | # it under the terms of the GNU Affero General Public License as | ||
18 | 13 | # published by the Free Software Foundation, either version 3 of the | ||
19 | 14 | # License, or (at your option) any later version. | ||
20 | 15 | # | ||
21 | 16 | # This program is distributed in the hope that it will be useful, | ||
22 | 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | 19 | # GNU Affero General Public License for more details. | ||
25 | 20 | # | ||
26 | 21 | # You should have received a copy of the GNU Affero General Public License | ||
27 | 22 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
28 | 23 | # | ||
29 | 24 | ############################################################################## | ||
30 | 25 | |||
31 | 26 | import account | ||
32 | 27 | import invoice | ||
33 | 28 | import account_invoice_refund | ||
34 | 29 | |||
35 | 30 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
36 | 0 | \ No newline at end of file | 31 | \ No newline at end of file |
37 | 1 | 32 | ||
38 | === added file 'account_storno/__openerp__.py' | |||
39 | --- account_storno/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
40 | +++ account_storno/__openerp__.py 2013-04-10 09:33:20 +0000 | |||
41 | @@ -0,0 +1,62 @@ | |||
42 | 1 | # -*- encoding: utf-8 -*- | ||
43 | 2 | ############################################################################## | ||
44 | 3 | # | ||
45 | 4 | # OpenERP, Open Source Management Solution | ||
46 | 5 | # Module: account_storno | ||
47 | 6 | # Author: Goran Kliska | ||
48 | 7 | # mail: gkliskaATgmail.com | ||
49 | 8 | # Copyright (C) 2011- Slobodni programi d.o.o., Zagreb | ||
50 | 9 | # http://www.slobodni-programi.hr | ||
51 | 10 | # Contributions: | ||
52 | 11 | # | ||
53 | 12 | # This program is free software: you can redistribute it and/or modify | ||
54 | 13 | # it under the terms of the GNU Affero General Public License as | ||
55 | 14 | # published by the Free Software Foundation, either version 3 of the | ||
56 | 15 | # License, or (at your option) any later version. | ||
57 | 16 | # | ||
58 | 17 | # This program is distributed in the hope that it will be useful, | ||
59 | 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
60 | 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
61 | 20 | # GNU Affero General Public License for more details. | ||
62 | 21 | # | ||
63 | 22 | # You should have received a copy of the GNU Affero General Public License | ||
64 | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
65 | 24 | # | ||
66 | 25 | ############################################################################## | ||
67 | 26 | |||
68 | 27 | { | ||
69 | 28 | "name" : "Account storno", | ||
70 | 29 | "description" : """ | ||
71 | 30 | |||
72 | 31 | Author: Goran Kliska @ Slobodni programi d.o.o. | ||
73 | 32 | http://www.slobodni-programi.hr | ||
74 | 33 | Contributions: | ||
75 | 34 | Ivan Vađić @ Slobodni programi d.o.o. | ||
76 | 35 | Tomislav Bošnjaković @ Storm Computers d.o.o.: Bugs report | ||
77 | 36 | |||
78 | 37 | Description: | ||
79 | 38 | Enables Storno Accounting, a business practice commonly used in Eastern European countries. | ||
80 | 39 | Adds new field "Posting policy" with values Storno/Contra on the Journal. | ||
81 | 40 | For Storno Journals refund invoices are (usually) done in the same journal with negative *(-1) quantities. | ||
82 | 41 | |||
83 | 42 | Countries where Storno accounting is mandatory or considered as best practice: | ||
84 | 43 | Czech Republic, Poland, Romania, Russia, China, Slovakia, Slovenia, Ukraine, Croatia, Bosnia and Herzegovina, Serbia, Romania, ... | ||
85 | 44 | |||
86 | 45 | WARNING: | ||
87 | 46 | This module is managing accounting, invoices, and refund wizard. | ||
88 | 47 | Other modules are required for stock, voucher, etc. storno posting. | ||
89 | 48 | |||
90 | 49 | """, | ||
91 | 50 | "version" : "13.1", | ||
92 | 51 | "author" : "Slobodni programi d.o.o.", | ||
93 | 52 | "category" : "Localisation/Croatia", | ||
94 | 53 | "website": "http://www.slobodni-programi.hr", | ||
95 | 54 | 'depends': ['account',], | ||
96 | 55 | 'init_xml': [], | ||
97 | 56 | 'update_xml': [ 'account_view.xml',], | ||
98 | 57 | "demo_xml" : [], | ||
99 | 58 | 'test' : [], | ||
100 | 59 | "active": False, | ||
101 | 60 | "installable": True, | ||
102 | 61 | } | ||
103 | 62 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
104 | 0 | \ No newline at end of file | 63 | \ No newline at end of file |
105 | 1 | 64 | ||
106 | === added file 'account_storno/account.py' | |||
107 | --- account_storno/account.py 1970-01-01 00:00:00 +0000 | |||
108 | +++ account_storno/account.py 2013-04-10 09:33:20 +0000 | |||
109 | @@ -0,0 +1,96 @@ | |||
110 | 1 | # -*- encoding: utf-8 -*- | ||
111 | 2 | ############################################################################## | ||
112 | 3 | # | ||
113 | 4 | # OpenERP, Open Source Management Solution | ||
114 | 5 | # Module: account_storno | ||
115 | 6 | # Author: Goran Kliska | ||
116 | 7 | # mail: gkliskaATgmail.com, | ||
117 | 8 | # Copyright (C) 2011- Slobodni programi d.o.o., Zagreb www.slobodni-programi.hr | ||
118 | 9 | # Contributions: | ||
119 | 10 | # | ||
120 | 11 | # This program is free software: you can redistribute it and/or modify | ||
121 | 12 | # it under the terms of the GNU Affero General Public License as | ||
122 | 13 | # published by the Free Software Foundation, either version 3 of the | ||
123 | 14 | # License, or (at your option) any later version. | ||
124 | 15 | # | ||
125 | 16 | # This program is distributed in the hope that it will be useful, | ||
126 | 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
127 | 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
128 | 19 | # GNU Affero General Public License for more details. | ||
129 | 20 | # | ||
130 | 21 | # You should have received a copy of the GNU Affero General Public License | ||
131 | 22 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
132 | 23 | # | ||
133 | 24 | ############################################################################## | ||
134 | 25 | |||
135 | 26 | from osv import fields, osv, orm | ||
136 | 27 | from openerp.tools import float_compare | ||
137 | 28 | from openerp.tools.translate import _ | ||
138 | 29 | import decimal_precision as dp | ||
139 | 30 | |||
140 | 31 | class account_journal(osv.osv): | ||
141 | 32 | _inherit = "account.journal" | ||
142 | 33 | _columns = { | ||
143 | 34 | 'posting_policy':fields.selection([ | ||
144 | 35 | ('contra', 'Contra (debit<->credit)'), | ||
145 | 36 | ('storno', 'Storno (-)'), | ||
146 | 37 | ], | ||
147 | 38 | 'Storno or Contra', size=16, required=True, | ||
148 | 39 | help="Storno allows minus postings, Refunds are posted on the same joural/account * (-1).\n" | ||
149 | 40 | "Contra doesn't allow negative posting. Refunds are posted by swaping credit and debit side." | ||
150 | 41 | ), | ||
151 | 42 | 'refund_journal_id':fields.many2one('account.journal', 'Refund journal', | ||
152 | 43 | help="Journal for refunds/returns from this journal. Leave empty to use same journal for normal and refund/return postings.", | ||
153 | 44 | ), | ||
154 | 45 | } | ||
155 | 46 | _defaults = {'posting_policy': 'storno', | ||
156 | 47 | } | ||
157 | 48 | |||
158 | 49 | |||
159 | 50 | class account_move_line(osv.osv): | ||
160 | 51 | _inherit = "account.move.line" | ||
161 | 52 | #Original constraints | ||
162 | 53 | #_sql_constraints = [ | ||
163 | 54 | #('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in accounting entry !'), | ||
164 | 55 | #('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in accounting entry !'), | ||
165 | 56 | #] | ||
166 | 57 | # credit_debit1 is valid constraint. Clear message | ||
167 | 58 | # credit_debit2 is replaced with dummy constraint that is always true. | ||
168 | 59 | |||
169 | 60 | _sql_constraints = [ | ||
170 | 61 | ('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in accounting entry! Either credit or debit must be 0.00.'), | ||
171 | 62 | ('credit_debit2', 'CHECK (abs(credit+debit)>=0)', 'Wrong credit or debit value in accounting entry !'), | ||
172 | 63 | ] | ||
173 | 64 | |||
174 | 65 | def _check_contra_minus(self, cr, uid, ids, context=None): | ||
175 | 66 | """ This is to restore credit_debit2 check functionality, for contra journals | ||
176 | 67 | """ | ||
177 | 68 | for l in self.browse(cr, uid, ids, context=context): | ||
178 | 69 | if l.journal_id.posting_policy == 'contra': | ||
179 | 70 | if l.debit + l.credit < 0.0: | ||
180 | 71 | return False | ||
181 | 72 | return True | ||
182 | 73 | |||
183 | 74 | def _check_storno_tax(self, cr, uid, ids, context=None): | ||
184 | 75 | """For Storno accounting Tax/Base amount is always == (debit + credit) | ||
185 | 76 | Still trying to find the case where it is not. | ||
186 | 77 | Maybe for contra check is abs(tax_amount) = abs(debit + credit) ??? | ||
187 | 78 | """ | ||
188 | 79 | for l in self.browse(cr, uid, ids, context=context): | ||
189 | 80 | if l.journal_id.posting_policy == 'storno' and l.tax_code_id: | ||
190 | 81 | if float_compare((l.debit + l.credit), l.tax_amount, precision_digits = 2) != 0: #precision_digits=dp.get_precision('Account')[1]) | ||
191 | 82 | return False | ||
192 | 83 | return True | ||
193 | 84 | |||
194 | 85 | _constraints = [ | ||
195 | 86 | (_check_contra_minus, _('Negative credit or debit amount is not allowed for "contra" journal policy.'), ['journal_id']), | ||
196 | 87 | (_check_storno_tax, _('Invalid tax amount. Tax amount can be 0.00 or equal to (Credit + Debit).'), ['journal_id']), | ||
197 | 88 | ] | ||
198 | 89 | |||
199 | 90 | |||
200 | 91 | class account_model_line(osv.osv): | ||
201 | 92 | _inherit = "account.model.line" | ||
202 | 93 | _sql_constraints = [ | ||
203 | 94 | ('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model! Either credit or debit must be 0.00.'), | ||
204 | 95 | ('credit_debit2', 'CHECK (abs(credit+debit)>=0)', 'Wrong credit or debit value in accounting entry !'), | ||
205 | 96 | ] | ||
206 | 0 | 97 | ||
207 | === added file 'account_storno/account_invoice_refund.py' | |||
208 | --- account_storno/account_invoice_refund.py 1970-01-01 00:00:00 +0000 | |||
209 | +++ account_storno/account_invoice_refund.py 2013-04-10 09:33:20 +0000 | |||
210 | @@ -0,0 +1,125 @@ | |||
211 | 1 | # -*- encoding: utf-8 -*- | ||
212 | 2 | ############################################################################## | ||
213 | 3 | # | ||
214 | 4 | # OpenERP, Open Source Management Solution | ||
215 | 5 | # Module: account_storno | ||
216 | 6 | # Author: Goran Kliska | ||
217 | 7 | # mail: gkliskaATgmail.com | ||
218 | 8 | # Copyright (C) 2011- Slobodni programi d.o.o., Zagreb | ||
219 | 9 | # Contributions: | ||
220 | 10 | # | ||
221 | 11 | # This program is free software: you can redistribute it and/or modify | ||
222 | 12 | # it under the terms of the GNU Affero General Public License as | ||
223 | 13 | # published by the Free Software Foundation, either version 3 of the | ||
224 | 14 | # License, or (at your option) any later version. | ||
225 | 15 | # | ||
226 | 16 | # This program is distributed in the hope that it will be useful, | ||
227 | 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
228 | 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
229 | 19 | # GNU Affero General Public License for more details. | ||
230 | 20 | # | ||
231 | 21 | # You should have received a copy of the GNU Affero General Public License | ||
232 | 22 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
233 | 23 | # | ||
234 | 24 | ############################################################################## | ||
235 | 25 | import time | ||
236 | 26 | from osv import fields, osv | ||
237 | 27 | from tools.translate import _ | ||
238 | 28 | import netsvc | ||
239 | 29 | |||
240 | 30 | class account_invoice(osv.osv): | ||
241 | 31 | """Not knowing legal requirements of all storno countries about journals | ||
242 | 32 | This version is for Croatia, Bih, Serbia... | ||
243 | 33 | Candidate for new module? | ||
244 | 34 | """ | ||
245 | 35 | _inherit = "account.invoice" | ||
246 | 36 | |||
247 | 37 | def _journal_invoice_type_dict(self): | ||
248 | 38 | return {'sale': 'out_invoice', # Customer Invoice | ||
249 | 39 | 'purchase': 'in_invoice', # Customer Refund | ||
250 | 40 | 'sale_refund': 'out_refund', # Supplier Invoice | ||
251 | 41 | 'purchase_refund': 'in_refund', # Supplier Refund | ||
252 | 42 | } | ||
253 | 43 | |||
254 | 44 | def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None): | ||
255 | 45 | #Where is the context, per invoice method? | ||
256 | 46 | #This approach is slow, updating after creating, but maybe better than copy-paste whole method | ||
257 | 47 | res = super(account_invoice, self).refund(cr, uid, ids, date=date, period_id=period_id, description=description, journal_id=journal_id) | ||
258 | 48 | for invoice in self.pool.get('account.invoice').browse(cr, uid, res): | ||
259 | 49 | self.pool.get('account.invoice').write(cr, uid, [invoice.id], | ||
260 | 50 | {'type': self._journal_invoice_type_dict()[invoice.journal_id.type] }) | ||
261 | 51 | if invoice.journal_id.posting_policy == 'storno': | ||
262 | 52 | for inv_line in invoice.invoice_line: | ||
263 | 53 | self.pool.get('account.invoice.line').write(cr, uid, | ||
264 | 54 | [inv_line.id], | ||
265 | 55 | {'quantity': inv_line.quantity * (-1) }) | ||
266 | 56 | for tax_line in invoice.tax_line: | ||
267 | 57 | if tax_line.manual or True: | ||
268 | 58 | self.pool.get('account.invoice.tax').write(cr, uid, | ||
269 | 59 | [tax_line.id], | ||
270 | 60 | {'base': tax_line.base * (-1), | ||
271 | 61 | 'amount': tax_line.amount * (-1), | ||
272 | 62 | 'base_amount': tax_line.base_amount * (-1), | ||
273 | 63 | 'tax_amount': tax_line.tax_amount * (-1), | ||
274 | 64 | }) | ||
275 | 65 | return res | ||
276 | 66 | |||
277 | 67 | |||
278 | 68 | class account_invoice_refund(osv.osv_memory): | ||
279 | 69 | _inherit = "account.invoice.refund" | ||
280 | 70 | |||
281 | 71 | def _get_journal(self, cr, uid, context=None): | ||
282 | 72 | """"in Croatia, for out invoice refunds must go to same journal #TODO for localization | ||
283 | 73 | """ | ||
284 | 74 | #borrowed from Akretion account_journal_sale_refund_link | ||
285 | 75 | #compatibility with crm_claim_rma module | ||
286 | 76 | invoice_id = context.get('invoice_ids', [context['active_id']])[0] | ||
287 | 77 | invoice = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context) | ||
288 | 78 | refund_journal_id = invoice.journal_id.refund_journal_id | ||
289 | 79 | if refund_journal_id: | ||
290 | 80 | return refund_journal_id.id | ||
291 | 81 | elif invoice.journal_id.posting_policy == 'storno': | ||
292 | 82 | return False #meaning: same journal as original | ||
293 | 83 | else: | ||
294 | 84 | return super(account_invoice_refund, self)._get_journal(cr, uid, context) | ||
295 | 85 | |||
296 | 86 | _defaults = { | ||
297 | 87 | 'journal_id': _get_journal, | ||
298 | 88 | 'filter_refund': 'modify', | ||
299 | 89 | } | ||
300 | 90 | |||
301 | 91 | def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): | ||
302 | 92 | journal_obj = self.pool.get('account.journal') | ||
303 | 93 | user_obj = self.pool.get('res.users') | ||
304 | 94 | res = super(account_invoice_refund,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) | ||
305 | 95 | company_id = user_obj.browse(cr, uid, uid, context=context).company_id.id | ||
306 | 96 | #I would love to have invoice.journal_id.posting_policy here | ||
307 | 97 | invoice_type = context.get('type', 'all') | ||
308 | 98 | if invoice_type in ('out_invoice', 'out_refund'): | ||
309 | 99 | journal_types = ('sale','sale_refund') | ||
310 | 100 | elif invoice_type in ('in_invoice', 'in_refund'): | ||
311 | 101 | journal_types = ('purchase','purchase_refund') | ||
312 | 102 | else: | ||
313 | 103 | journal_types = ('sale','sale_refund','purchase','purchase_refund') | ||
314 | 104 | journal_select = journal_obj._name_search(cr, uid, '', [('type', 'in', journal_types), ('company_id','child_of',[company_id])], context=context) | ||
315 | 105 | #original for loop needed??? | ||
316 | 106 | res['fields']['journal_id']['selection'] = journal_select | ||
317 | 107 | return res | ||
318 | 108 | |||
319 | 109 | def compute_refund(self, cr, uid, ids, mode='refund', context=None): | ||
320 | 110 | mod_obj = self.pool.get('ir.model.data') | ||
321 | 111 | act_obj = self.pool.get('ir.actions.act_window') | ||
322 | 112 | res = super(account_invoice_refund,self).compute_refund(cr, uid, ids, mode=mode, context=context) | ||
323 | 113 | last_inv_id = res['domain'][1][2][-1] #yupiii here is last created invoice id, great hook | ||
324 | 114 | inv = self.pool.get('account.invoice').browse(cr, uid, [last_inv_id])[0] | ||
325 | 115 | xml_id = (inv.type == 'out_refund') and 'action_invoice_tree3' or \ | ||
326 | 116 | (inv.type == 'in_refund') and 'action_invoice_tree4' or \ | ||
327 | 117 | (inv.type == 'out_invoice') and 'action_invoice_tree1' or \ | ||
328 | 118 | (inv.type == 'in_invoice') and 'action_invoice_tree2' | ||
329 | 119 | result = mod_obj.get_object_reference(cr, uid, 'account', xml_id) | ||
330 | 120 | id = result and result[1] or False | ||
331 | 121 | result = act_obj.read(cr, uid, id, context=context) | ||
332 | 122 | invoice_domain = eval(result['domain']) | ||
333 | 123 | invoice_domain.append(('id', 'in', res['domain'][1][2] )) | ||
334 | 124 | result['domain'] = invoice_domain | ||
335 | 125 | return result | ||
336 | 0 | 126 | ||
337 | === added file 'account_storno/account_view.xml' | |||
338 | --- account_storno/account_view.xml 1970-01-01 00:00:00 +0000 | |||
339 | +++ account_storno/account_view.xml 2013-04-10 09:33:20 +0000 | |||
340 | @@ -0,0 +1,17 @@ | |||
341 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
342 | 2 | <openerp> | ||
343 | 3 | <data> | ||
344 | 4 | <record id="view_account_journal_form_posting_policy" model="ir.ui.view"> | ||
345 | 5 | <field name="name">account.journal.form.storno</field> | ||
346 | 6 | <field name="model">account.journal</field> | ||
347 | 7 | <field name="type">form</field> | ||
348 | 8 | <field name="inherit_id" ref="account.view_account_journal_form" /> | ||
349 | 9 | <field name="arch" type="xml"> | ||
350 | 10 | <field name="centralisation" position="after"> | ||
351 | 11 | <field name="posting_policy" groups="account.group_account_manager"/> | ||
352 | 12 | <field name="refund_journal_id" groups="account.group_account_manager"/> | ||
353 | 13 | </field> | ||
354 | 14 | </field> | ||
355 | 15 | </record> | ||
356 | 16 | </data> | ||
357 | 17 | </openerp> | ||
358 | 0 | \ No newline at end of file | 18 | \ No newline at end of file |
359 | 1 | 19 | ||
360 | === added directory 'account_storno/i18n' | |||
361 | === added file 'account_storno/i18n/account_storno.pot' | |||
362 | --- account_storno/i18n/account_storno.pot 1970-01-01 00:00:00 +0000 | |||
363 | +++ account_storno/i18n/account_storno.pot 2013-04-10 09:33:20 +0000 | |||
364 | @@ -0,0 +1,212 @@ | |||
365 | 1 | # Translation of OpenERP Server. | ||
366 | 2 | # This file contains the translation of the following modules: | ||
367 | 3 | # * account_storno | ||
368 | 4 | # | ||
369 | 5 | msgid "" | ||
370 | 6 | msgstr "" | ||
371 | 7 | "Project-Id-Version: OpenERP Server 6.1beta\n" | ||
372 | 8 | "Report-Msgid-Bugs-To: \n" | ||
373 | 9 | "POT-Creation-Date: 2012-01-04 12:30+0000\n" | ||
374 | 10 | "PO-Revision-Date: 2012-01-04 12:30+0000\n" | ||
375 | 11 | "Last-Translator: <>\n" | ||
376 | 12 | "Language-Team: \n" | ||
377 | 13 | "MIME-Version: 1.0\n" | ||
378 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
379 | 15 | "Content-Transfer-Encoding: \n" | ||
380 | 16 | "Plural-Forms: \n" | ||
381 | 17 | |||
382 | 18 | #. module: account_storno | ||
383 | 19 | #: code:addons/account_storno/account_invoice_refund.py:212 | ||
384 | 20 | #, python-format | ||
385 | 21 | msgid "Can not %s draft/proforma/cancel invoice." | ||
386 | 22 | msgstr "Can not %s draft/proforma/cancel invoice." | ||
387 | 23 | |||
388 | 24 | #. module: account_storno | ||
389 | 25 | #: constraint:account.move.line:0 | ||
390 | 26 | msgid "Company must be the same for its related account and period." | ||
391 | 27 | msgstr "Company must be the same for its related account and period." | ||
392 | 28 | |||
393 | 29 | #. module: account_storno | ||
394 | 30 | #: code:addons/account_storno/invoice.py:45 | ||
395 | 31 | #, python-format | ||
396 | 32 | msgid "No Invoice Lines !" | ||
397 | 33 | msgstr "No Invoice Lines !" | ||
398 | 34 | |||
399 | 35 | #. module: account_storno | ||
400 | 36 | #: sql_constraint:account.journal:0 | ||
401 | 37 | msgid "The name of the journal must be unique per company !" | ||
402 | 38 | msgstr "The name of the journal must be unique per company !" | ||
403 | 39 | |||
404 | 40 | #. module: account_storno | ||
405 | 41 | #: code:addons/account_storno/invoice.py:62 | ||
406 | 42 | #, python-format | ||
407 | 43 | msgid "Bad total !" | ||
408 | 44 | msgstr "Bad total !" | ||
409 | 45 | |||
410 | 46 | #. module: account_storno | ||
411 | 47 | #: code:addons/account_storno/invoice.py:73 | ||
412 | 48 | #, python-format | ||
413 | 49 | msgid "Can not create the invoice !\n" | ||
414 | 50 | "The related payment term is probably misconfigured as it gives a computed amount greater than the total invoiced amount." | ||
415 | 51 | msgstr "Can not create the invoice !\n" | ||
416 | 52 | "The related payment term is probably misconfigured as it gives a computed amount greater than the total invoiced amount." | ||
417 | 53 | |||
418 | 54 | #. module: account_storno | ||
419 | 55 | #: code:addons/account_storno/invoice.py:45 | ||
420 | 56 | #, python-format | ||
421 | 57 | msgid "Please create some invoice lines." | ||
422 | 58 | msgstr "Please create some invoice lines." | ||
423 | 59 | |||
424 | 60 | #. module: account_storno | ||
425 | 61 | #: sql_constraint:account.model.line:0 | ||
426 | 62 | msgid "Wrong credit or debit value in model, they must be positive!" | ||
427 | 63 | msgstr "Wrong credit or debit value in model, they must be positive!" | ||
428 | 64 | |||
429 | 65 | #. module: account_storno | ||
430 | 66 | #: code:addons/account_storno/account_invoice_refund.py:212 | ||
431 | 67 | #: code:addons/account_storno/account_invoice_refund.py:214 | ||
432 | 68 | #: code:addons/account_storno/invoice.py:43 | ||
433 | 69 | #: code:addons/account_storno/invoice.py:73 | ||
434 | 70 | #, python-format | ||
435 | 71 | msgid "Error !" | ||
436 | 72 | msgstr "Error !" | ||
437 | 73 | |||
438 | 74 | #. module: account_storno | ||
439 | 75 | #: model:ir.model,name:account_storno.model_account_journal | ||
440 | 76 | msgid "Journal" | ||
441 | 77 | msgstr "Journal" | ||
442 | 78 | |||
443 | 79 | #. module: account_storno | ||
444 | 80 | #: selection:account.journal,posting_policy:0 | ||
445 | 81 | msgid "Contra (debit<->credit)" | ||
446 | 82 | msgstr "Contra (debit<->credit)" | ||
447 | 83 | |||
448 | 84 | #. module: account_storno | ||
449 | 85 | #: code:addons/account_storno/invoice.py:43 | ||
450 | 86 | #, python-format | ||
451 | 87 | msgid "Please define sequence on invoice journal" | ||
452 | 88 | msgstr "Please define sequence on invoice journal" | ||
453 | 89 | |||
454 | 90 | #. module: account_storno | ||
455 | 91 | #: field:account.journal,refund_journal_id:0 | ||
456 | 92 | msgid "Invoice refund journal" | ||
457 | 93 | msgstr "Invoice refund journal" | ||
458 | 94 | |||
459 | 95 | #. module: account_storno | ||
460 | 96 | #: selection:account.journal,posting_policy:0 | ||
461 | 97 | msgid "Storno (-)" | ||
462 | 98 | msgstr "Storno (-)" | ||
463 | 99 | |||
464 | 100 | #. module: account_storno | ||
465 | 101 | #: model:ir.model,name:account_storno.model_account_move_line | ||
466 | 102 | msgid "Journal Items" | ||
467 | 103 | msgstr "Journal Items" | ||
468 | 104 | |||
469 | 105 | #. module: account_storno | ||
470 | 106 | #: constraint:account.move.line:0 | ||
471 | 107 | msgid "You can not create journal items on an account of type view." | ||
472 | 108 | msgstr "You can not create journal items on an account of type view." | ||
473 | 109 | |||
474 | 110 | #. module: account_storno | ||
475 | 111 | #: code:addons/account_storno/invoice.py:161 | ||
476 | 112 | #, python-format | ||
477 | 113 | msgid "You cannot create an invoice on a centralised journal. Uncheck the centralised counterpart box in the related journal from the configuration menu." | ||
478 | 114 | msgstr "You cannot create an invoice on a centralised journal. Uncheck the centralised counterpart box in the related journal from the configuration menu." | ||
479 | 115 | |||
480 | 116 | #. module: account_storno | ||
481 | 117 | #: code:addons/account_storno/account_invoice_refund.py:250 | ||
482 | 118 | #, python-format | ||
483 | 119 | msgid "No Period found on Invoice!" | ||
484 | 120 | msgstr "No Period found on Invoice!" | ||
485 | 121 | |||
486 | 122 | #. module: account_storno | ||
487 | 123 | #: sql_constraint:account.model.line:0 | ||
488 | 124 | msgid "Wrong credit or debit value in model (Credit + Debit Must Be greater \"0\")!" | ||
489 | 125 | msgstr "Wrong credit or debit value in model (Credit + Debit Must Be greater \"0\")!" | ||
490 | 126 | |||
491 | 127 | #. module: account_storno | ||
492 | 128 | #: model:ir.model,name:account_storno.model_account_model_line | ||
493 | 129 | msgid "Account Model Entries" | ||
494 | 130 | msgstr "Account Model Entries" | ||
495 | 131 | |||
496 | 132 | #. module: account_storno | ||
497 | 133 | #: constraint:account.move.line:0 | ||
498 | 134 | msgid "You can not create journal items on closed account." | ||
499 | 135 | msgstr "You can not create journal items on closed account." | ||
500 | 136 | |||
501 | 137 | #. module: account_storno | ||
502 | 138 | #: constraint:account.journal:0 | ||
503 | 139 | msgid "Configuration error! The currency chosen should be shared by the default accounts too." | ||
504 | 140 | msgstr "Configuration error! The currency chosen should be shared by the default accounts too." | ||
505 | 141 | |||
506 | 142 | #. module: account_storno | ||
507 | 143 | #: sql_constraint:account.move.line:0 | ||
508 | 144 | msgid "Wrong credit or debit value in accounting entry !" | ||
509 | 145 | msgstr "Wrong credit or debit value in accounting entry !" | ||
510 | 146 | |||
511 | 147 | #. module: account_storno | ||
512 | 148 | #: code:addons/account_storno/invoice.py:160 | ||
513 | 149 | #, python-format | ||
514 | 150 | msgid "UserError" | ||
515 | 151 | msgstr "UserError" | ||
516 | 152 | |||
517 | 153 | #. module: account_storno | ||
518 | 154 | #: sql_constraint:account.invoice:0 | ||
519 | 155 | msgid "Invoice Number must be unique per Company!" | ||
520 | 156 | msgstr "Invoice Number must be unique per Company!" | ||
521 | 157 | |||
522 | 158 | #. module: account_storno | ||
523 | 159 | #: code:addons/account_storno/invoice.py:62 | ||
524 | 160 | #, python-format | ||
525 | 161 | msgid "Please verify the price of the invoice !\n" | ||
526 | 162 | "The real total does not match the computed total." | ||
527 | 163 | msgstr "Please verify the price of the invoice !\n" | ||
528 | 164 | "The real total does not match the computed total." | ||
529 | 165 | |||
530 | 166 | #. module: account_storno | ||
531 | 167 | #: model:ir.model,name:account_storno.model_account_invoice_refund | ||
532 | 168 | msgid "Invoice Refund" | ||
533 | 169 | msgstr "Invoice Refund" | ||
534 | 170 | |||
535 | 171 | #. module: account_storno | ||
536 | 172 | #: code:addons/account_storno/account_invoice_refund.py:249 | ||
537 | 173 | #, python-format | ||
538 | 174 | msgid "Data Insufficient !" | ||
539 | 175 | msgstr "Data Insufficient !" | ||
540 | 176 | |||
541 | 177 | #. module: account_storno | ||
542 | 178 | #: field:account.journal,posting_policy:0 | ||
543 | 179 | msgid "Storno or Contra" | ||
544 | 180 | msgstr "Storno or Contra" | ||
545 | 181 | |||
546 | 182 | #. module: account_storno | ||
547 | 183 | #: constraint:account.move.line:0 | ||
548 | 184 | msgid "The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal." | ||
549 | 185 | msgstr "The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal." | ||
550 | 186 | |||
551 | 187 | #. module: account_storno | ||
552 | 188 | #: constraint:account.move.line:0 | ||
553 | 189 | msgid "The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal." | ||
554 | 190 | msgstr "The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal." | ||
555 | 191 | |||
556 | 192 | #. module: account_storno | ||
557 | 193 | #: code:addons/account_storno/account_invoice_refund.py:214 | ||
558 | 194 | #, python-format | ||
559 | 195 | msgid "Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice" | ||
560 | 196 | msgstr "Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice" | ||
561 | 197 | |||
562 | 198 | #. module: account_storno | ||
563 | 199 | #: sql_constraint:account.journal:0 | ||
564 | 200 | msgid "The code of the journal must be unique per company !" | ||
565 | 201 | msgstr "The code of the journal must be unique per company !" | ||
566 | 202 | |||
567 | 203 | #. module: account_storno | ||
568 | 204 | #: model:ir.model,name:account_storno.model_account_invoice | ||
569 | 205 | msgid "Invoice" | ||
570 | 206 | msgstr "Invoice" | ||
571 | 207 | |||
572 | 208 | #. module: account_storno | ||
573 | 209 | #: help:account.journal,posting_policy:0 | ||
574 | 210 | msgid "Contra doesn't allow negative posting by swaping credit and debit side. Storno allows minus postings." | ||
575 | 211 | msgstr "Contra doesn't allow negative posting by swaping credit and debit side. Storno allows minus postings." | ||
576 | 212 | |||
577 | 0 | 213 | ||
578 | === added file 'account_storno/i18n/hr.po' | |||
579 | --- account_storno/i18n/hr.po 1970-01-01 00:00:00 +0000 | |||
580 | +++ account_storno/i18n/hr.po 2013-04-10 09:33:20 +0000 | |||
581 | @@ -0,0 +1,212 @@ | |||
582 | 1 | # Translation of OpenERP Server. | ||
583 | 2 | # This file contains the translation of the following modules: | ||
584 | 3 | # * account_storno | ||
585 | 4 | # | ||
586 | 5 | msgid "" | ||
587 | 6 | msgstr "" | ||
588 | 7 | "Project-Id-Version: OpenERP Server 6.1beta\n" | ||
589 | 8 | "Report-Msgid-Bugs-To: \n" | ||
590 | 9 | "POT-Creation-Date: 2012-01-04 12:30+0000\n" | ||
591 | 10 | "PO-Revision-Date: 2012-01-04 12:30+0000\n" | ||
592 | 11 | "Last-Translator: <>\n" | ||
593 | 12 | "Language-Team: \n" | ||
594 | 13 | "MIME-Version: 1.0\n" | ||
595 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
596 | 15 | "Content-Transfer-Encoding: \n" | ||
597 | 16 | "Plural-Forms: \n" | ||
598 | 17 | |||
599 | 18 | #. module: account_storno | ||
600 | 19 | #: code:addons/account_storno/account_invoice_refund.py:212 | ||
601 | 20 | #, python-format | ||
602 | 21 | msgid "Can not %s draft/proforma/cancel invoice." | ||
603 | 22 | msgstr "Can not %s draft/proforma/cancel invoice." | ||
604 | 23 | |||
605 | 24 | #. module: account_storno | ||
606 | 25 | #: constraint:account.move.line:0 | ||
607 | 26 | msgid "Company must be the same for its related account and period." | ||
608 | 27 | msgstr "Company must be the same for its related account and period." | ||
609 | 28 | |||
610 | 29 | #. module: account_storno | ||
611 | 30 | #: code:addons/account_storno/invoice.py:45 | ||
612 | 31 | #, python-format | ||
613 | 32 | msgid "No Invoice Lines !" | ||
614 | 33 | msgstr "No Invoice Lines !" | ||
615 | 34 | |||
616 | 35 | #. module: account_storno | ||
617 | 36 | #: sql_constraint:account.journal:0 | ||
618 | 37 | msgid "The name of the journal must be unique per company !" | ||
619 | 38 | msgstr "The name of the journal must be unique per company !" | ||
620 | 39 | |||
621 | 40 | #. module: account_storno | ||
622 | 41 | #: code:addons/account_storno/invoice.py:62 | ||
623 | 42 | #, python-format | ||
624 | 43 | msgid "Bad total !" | ||
625 | 44 | msgstr "Bad total !" | ||
626 | 45 | |||
627 | 46 | #. module: account_storno | ||
628 | 47 | #: code:addons/account_storno/invoice.py:73 | ||
629 | 48 | #, python-format | ||
630 | 49 | msgid "Can not create the invoice !\n" | ||
631 | 50 | "The related payment term is probably misconfigured as it gives a computed amount greater than the total invoiced amount." | ||
632 | 51 | msgstr "Can not create the invoice !\n" | ||
633 | 52 | "The related payment term is probably misconfigured as it gives a computed amount greater than the total invoiced amount." | ||
634 | 53 | |||
635 | 54 | #. module: account_storno | ||
636 | 55 | #: code:addons/account_storno/invoice.py:45 | ||
637 | 56 | #, python-format | ||
638 | 57 | msgid "Please create some invoice lines." | ||
639 | 58 | msgstr "Please create some invoice lines." | ||
640 | 59 | |||
641 | 60 | #. module: account_storno | ||
642 | 61 | #: sql_constraint:account.model.line:0 | ||
643 | 62 | msgid "Wrong credit or debit value in model, they must be positive!" | ||
644 | 63 | msgstr "Wrong credit or debit value in model, they must be positive!" | ||
645 | 64 | |||
646 | 65 | #. module: account_storno | ||
647 | 66 | #: code:addons/account_storno/account_invoice_refund.py:212 | ||
648 | 67 | #: code:addons/account_storno/account_invoice_refund.py:214 | ||
649 | 68 | #: code:addons/account_storno/invoice.py:43 | ||
650 | 69 | #: code:addons/account_storno/invoice.py:73 | ||
651 | 70 | #, python-format | ||
652 | 71 | msgid "Error !" | ||
653 | 72 | msgstr "Error !" | ||
654 | 73 | |||
655 | 74 | #. module: account_storno | ||
656 | 75 | #: model:ir.model,name:account_storno.model_account_journal | ||
657 | 76 | msgid "Journal" | ||
658 | 77 | msgstr "Journal" | ||
659 | 78 | |||
660 | 79 | #. module: account_storno | ||
661 | 80 | #: selection:account.journal,posting_policy:0 | ||
662 | 81 | msgid "Contra (debit<->credit)" | ||
663 | 82 | msgstr "Contra (debit<->credit)" | ||
664 | 83 | |||
665 | 84 | #. module: account_storno | ||
666 | 85 | #: code:addons/account_storno/invoice.py:43 | ||
667 | 86 | #, python-format | ||
668 | 87 | msgid "Please define sequence on invoice journal" | ||
669 | 88 | msgstr "Please define sequence on invoice journal" | ||
670 | 89 | |||
671 | 90 | #. module: account_storno | ||
672 | 91 | #: field:account.journal,refund_journal_id:0 | ||
673 | 92 | msgid "Invoice refund journal" | ||
674 | 93 | msgstr "Invoice refund journal" | ||
675 | 94 | |||
676 | 95 | #. module: account_storno | ||
677 | 96 | #: selection:account.journal,posting_policy:0 | ||
678 | 97 | msgid "Storno (-)" | ||
679 | 98 | msgstr "Storno (-)" | ||
680 | 99 | |||
681 | 100 | #. module: account_storno | ||
682 | 101 | #: model:ir.model,name:account_storno.model_account_move_line | ||
683 | 102 | msgid "Journal Items" | ||
684 | 103 | msgstr "Journal Items" | ||
685 | 104 | |||
686 | 105 | #. module: account_storno | ||
687 | 106 | #: constraint:account.move.line:0 | ||
688 | 107 | msgid "You can not create journal items on an account of type view." | ||
689 | 108 | msgstr "You can not create journal items on an account of type view." | ||
690 | 109 | |||
691 | 110 | #. module: account_storno | ||
692 | 111 | #: code:addons/account_storno/invoice.py:161 | ||
693 | 112 | #, python-format | ||
694 | 113 | msgid "You cannot create an invoice on a centralised journal. Uncheck the centralised counterpart box in the related journal from the configuration menu." | ||
695 | 114 | msgstr "You cannot create an invoice on a centralised journal. Uncheck the centralised counterpart box in the related journal from the configuration menu." | ||
696 | 115 | |||
697 | 116 | #. module: account_storno | ||
698 | 117 | #: code:addons/account_storno/account_invoice_refund.py:250 | ||
699 | 118 | #, python-format | ||
700 | 119 | msgid "No Period found on Invoice!" | ||
701 | 120 | msgstr "No Period found on Invoice!" | ||
702 | 121 | |||
703 | 122 | #. module: account_storno | ||
704 | 123 | #: sql_constraint:account.model.line:0 | ||
705 | 124 | msgid "Wrong credit or debit value in model (Credit + Debit Must Be greater \"0\")!" | ||
706 | 125 | msgstr "Wrong credit or debit value in model (Credit + Debit Must Be greater \"0\")!" | ||
707 | 126 | |||
708 | 127 | #. module: account_storno | ||
709 | 128 | #: model:ir.model,name:account_storno.model_account_model_line | ||
710 | 129 | msgid "Account Model Entries" | ||
711 | 130 | msgstr "Account Model Entries" | ||
712 | 131 | |||
713 | 132 | #. module: account_storno | ||
714 | 133 | #: constraint:account.move.line:0 | ||
715 | 134 | msgid "You can not create journal items on closed account." | ||
716 | 135 | msgstr "You can not create journal items on closed account." | ||
717 | 136 | |||
718 | 137 | #. module: account_storno | ||
719 | 138 | #: constraint:account.journal:0 | ||
720 | 139 | msgid "Configuration error! The currency chosen should be shared by the default accounts too." | ||
721 | 140 | msgstr "Configuration error! The currency chosen should be shared by the default accounts too." | ||
722 | 141 | |||
723 | 142 | #. module: account_storno | ||
724 | 143 | #: sql_constraint:account.move.line:0 | ||
725 | 144 | msgid "Wrong credit or debit value in accounting entry !" | ||
726 | 145 | msgstr "Wrong credit or debit value in accounting entry !" | ||
727 | 146 | |||
728 | 147 | #. module: account_storno | ||
729 | 148 | #: code:addons/account_storno/invoice.py:160 | ||
730 | 149 | #, python-format | ||
731 | 150 | msgid "UserError" | ||
732 | 151 | msgstr "UserError" | ||
733 | 152 | |||
734 | 153 | #. module: account_storno | ||
735 | 154 | #: sql_constraint:account.invoice:0 | ||
736 | 155 | msgid "Invoice Number must be unique per Company!" | ||
737 | 156 | msgstr "Invoice Number must be unique per Company!" | ||
738 | 157 | |||
739 | 158 | #. module: account_storno | ||
740 | 159 | #: code:addons/account_storno/invoice.py:62 | ||
741 | 160 | #, python-format | ||
742 | 161 | msgid "Please verify the price of the invoice !\n" | ||
743 | 162 | "The real total does not match the computed total." | ||
744 | 163 | msgstr "Please verify the price of the invoice !\n" | ||
745 | 164 | "The real total does not match the computed total." | ||
746 | 165 | |||
747 | 166 | #. module: account_storno | ||
748 | 167 | #: model:ir.model,name:account_storno.model_account_invoice_refund | ||
749 | 168 | msgid "Invoice Refund" | ||
750 | 169 | msgstr "Invoice Refund" | ||
751 | 170 | |||
752 | 171 | #. module: account_storno | ||
753 | 172 | #: code:addons/account_storno/account_invoice_refund.py:249 | ||
754 | 173 | #, python-format | ||
755 | 174 | msgid "Data Insufficient !" | ||
756 | 175 | msgstr "Data Insufficient !" | ||
757 | 176 | |||
758 | 177 | #. module: account_storno | ||
759 | 178 | #: field:account.journal,posting_policy:0 | ||
760 | 179 | msgid "Storno or Contra" | ||
761 | 180 | msgstr "Storno or Contra" | ||
762 | 181 | |||
763 | 182 | #. module: account_storno | ||
764 | 183 | #: constraint:account.move.line:0 | ||
765 | 184 | msgid "The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal." | ||
766 | 185 | msgstr "The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal." | ||
767 | 186 | |||
768 | 187 | #. module: account_storno | ||
769 | 188 | #: constraint:account.move.line:0 | ||
770 | 189 | msgid "The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal." | ||
771 | 190 | msgstr "The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal." | ||
772 | 191 | |||
773 | 192 | #. module: account_storno | ||
774 | 193 | #: code:addons/account_storno/account_invoice_refund.py:214 | ||
775 | 194 | #, python-format | ||
776 | 195 | msgid "Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice" | ||
777 | 196 | msgstr "Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice" | ||
778 | 197 | |||
779 | 198 | #. module: account_storno | ||
780 | 199 | #: sql_constraint:account.journal:0 | ||
781 | 200 | msgid "The code of the journal must be unique per company !" | ||
782 | 201 | msgstr "The code of the journal must be unique per company !" | ||
783 | 202 | |||
784 | 203 | #. module: account_storno | ||
785 | 204 | #: model:ir.model,name:account_storno.model_account_invoice | ||
786 | 205 | msgid "Invoice" | ||
787 | 206 | msgstr "Invoice" | ||
788 | 207 | |||
789 | 208 | #. module: account_storno | ||
790 | 209 | #: help:account.journal,posting_policy:0 | ||
791 | 210 | msgid "Contra doesn't allow negative posting by swaping credit and debit side. Storno allows minus postings." | ||
792 | 211 | msgstr "Contra doesn't allow negative posting by swaping credit and debit side. Storno allows minus postings." | ||
793 | 212 | |||
794 | 0 | 213 | ||
795 | === added file 'account_storno/invoice.py' | |||
796 | --- account_storno/invoice.py 1970-01-01 00:00:00 +0000 | |||
797 | +++ account_storno/invoice.py 2013-04-10 09:33:20 +0000 | |||
798 | @@ -0,0 +1,88 @@ | |||
799 | 1 | # -*- encoding: utf-8 -*- | ||
800 | 2 | ############################################################################## | ||
801 | 3 | # | ||
802 | 4 | # OpenERP, Open Source Management Solution | ||
803 | 5 | # Module: account_storno | ||
804 | 6 | # Author: Goran Kliska | ||
805 | 7 | # mail: gkliskaATgmail.com | ||
806 | 8 | # Copyright (C) 2013- Slobodni programi d.o.o., Zagreb | ||
807 | 9 | # Contributions: | ||
808 | 10 | # | ||
809 | 11 | # This program is free software: you can redistribute it and/or modify | ||
810 | 12 | # it under the terms of the GNU Affero General Public License as | ||
811 | 13 | # published by the Free Software Foundation, either version 3 of the | ||
812 | 14 | # License, or (at your option) any later version. | ||
813 | 15 | # | ||
814 | 16 | # This program is distributed in the hope that it will be useful, | ||
815 | 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
816 | 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
817 | 19 | # GNU Affero General Public License for more details. | ||
818 | 20 | # | ||
819 | 21 | # You should have received a copy of the GNU Affero General Public License | ||
820 | 22 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
821 | 23 | # | ||
822 | 24 | ############################################################################## | ||
823 | 25 | |||
824 | 26 | from osv import fields, osv, orm | ||
825 | 27 | import time | ||
826 | 28 | from tools.translate import _ | ||
827 | 29 | |||
828 | 30 | class account_invoice(osv.osv): | ||
829 | 31 | _inherit = "account.invoice" | ||
830 | 32 | |||
831 | 33 | def action_move_create(self, cr, uid, ids, context=None): | ||
832 | 34 | """Creates invoice related analytics and financial move lines | ||
833 | 35 | We have to go one by one to inject invoice to line_get_convert | ||
834 | 36 | """ | ||
835 | 37 | if context is None: | ||
836 | 38 | context = {} | ||
837 | 39 | for inv in self.browse(cr, uid, ids, context=context): | ||
838 | 40 | context.update({'brw_invoice': inv}) | ||
839 | 41 | super(account_invoice,self).action_move_create(cr, uid, [inv.id], context=context) | ||
840 | 42 | return True | ||
841 | 43 | |||
842 | 44 | def line_get_convert(self, cr, uid, x, part, date, context=None): | ||
843 | 45 | res =super(account_invoice,self).line_get_convert(cr, uid, x, part, date, context=context) | ||
844 | 46 | if context is None: | ||
845 | 47 | context = {} | ||
846 | 48 | invoice = context.get('brw_invoice',False) | ||
847 | 49 | if invoice and invoice.journal_id.posting_policy=='storno': | ||
848 | 50 | credit = debit = 0.0 | ||
849 | 51 | if invoice.type in ('out_invoice', 'out_refund'): | ||
850 | 52 | if x.get('type','src') in ('dest'): | ||
851 | 53 | debit = x['price'] # for OUT_invoice dest (tot. amount goes to debit) | ||
852 | 54 | else: # in('src','tax') | ||
853 | 55 | credit = x['price'] * (-1) | ||
854 | 56 | else: #in ('in_invoice', 'in_refund') | ||
855 | 57 | if x.get('type','src') in ('dest'): | ||
856 | 58 | credit = x['price'] * (-1) | ||
857 | 59 | else: | ||
858 | 60 | debit = x['price'] | ||
859 | 61 | res['debit'] = debit | ||
860 | 62 | res['credit'] = credit | ||
861 | 63 | return res | ||
862 | 64 | |||
863 | 65 | def group_lines(self, cr, uid, iml, line, inv): | ||
864 | 66 | """Merge account move lines (and hence analytic lines) if invoice line hashcodes are equals""" | ||
865 | 67 | if inv.journal_id.group_invoice_lines: | ||
866 | 68 | if inv.journal_id.posting_policy == 'contra': | ||
867 | 69 | return super(account_invoice,self).group_lines(cr, uid, iml, line, inv) | ||
868 | 70 | if inv.journal_id.posting_policy == 'storno': | ||
869 | 71 | line2 = {} | ||
870 | 72 | for x, y, l in line: | ||
871 | 73 | hash = self.inv_line_characteristic_hashcode(inv, l) | ||
872 | 74 | side = l['debit'] > 0 and 'debit' or 'credit' | ||
873 | 75 | tmp = '-'.join((hash,side)) | ||
874 | 76 | if tmp in line2: | ||
875 | 77 | line2[tmp]['debit'] += l['debit'] or 0.0 | ||
876 | 78 | line2[tmp]['credit'] += l['credit'] or 0.00 | ||
877 | 79 | line2[tmp]['tax_amount'] += l['tax_amount'] | ||
878 | 80 | line2[tmp]['analytic_lines'] += l['analytic_lines'] | ||
879 | 81 | line2[tmp]['amount_currency'] += l['amount_currency'] | ||
880 | 82 | line2[tmp]['quantity'] += l['quantity'] | ||
881 | 83 | else: | ||
882 | 84 | line2[tmp] = l | ||
883 | 85 | line = [] | ||
884 | 86 | for key, val in line2.items(): | ||
885 | 87 | line.append((0,0,val)) | ||
886 | 88 | return line |
Hi Goran, debit)> =0 AND storno))" (Syntax to be confirmed)
I am not sure about this and take out the database constraints.
Here is what we could do: create a storno check box at account_move_line
level, invisible that would be check any time a "storno" company uses a
journal in "storno mode". we just need to change the SQL constraint to
something similar to "CHECK (((credit+debit>=0) AND NOT storno) OR
(abs(credit+
In this case no need to implement complex methods and it could be
compatible with both method at the same time.
your thoughts?
Eric CAUDAL
Eric Caudal www.elico- corp.com
/CEO/
--
*Elico Corporation, Shanghai branch
/OpenERP Premium Certified Training Partner/ *
Cell: + 86 186 2136 1670
Office: + 86 21 6211 8017/27/37
Skype: elico.corp
<email address hidden> <mailto:<email address hidden>>
http://
Elico Corp core-editors) /code.launchpad .net/~gkliska/ storno- accounting/ storno- accounting/ +merge/ 158022 readonly/ mandatory/ selection_ choices for account_ journal. posting_ policy from (future) res_company. posting_ policy. Dummy field.function() or field.related(), but then we will need lot of them? invoice_ refund really needs refactoring in core IMO, here attempt to be compatible with Akretion account_ journal_ sale_refund_ link module using same account_ journal. refund_ journal_ id fieldname
On 04/10/2013 05:34 PM, Goran Kliska wrote:
> Goran Kliska has proposed merging lp:~gkliska/storno-accounting/storno-accounting into lp:storno-accounting.
>
> Requested reviews:
> Account Core Editors (account-
>
> For more details, see:
> https:/
>
> Initial commit to start with.
> Known issues/dilemmas:
> - how to control visible/
> - constraint regarding Tax/Base amount maybe belongs to account-constraints project
> - account_
>