Merge lp:~openobject-italia-core-devs/openobject-italia/riba into lp:~openobject-italia-core-devs/openobject-italia/italian-addons

Proposed by Eliumara Lopez
Status: Merged
Merged at revision: 159
Proposed branch: lp:~openobject-italia-core-devs/openobject-italia/riba
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons
Diff against target: 3292 lines (+3163/-0)
25 files modified
l10n_it_ri_ba/AUTHORS.txt (+2/-0)
l10n_it_ri_ba/__init__.py (+34/-0)
l10n_it_ri_ba/__openerp__.py (+57/-0)
l10n_it_ri_ba/account_invoice.py (+68/-0)
l10n_it_ri_ba/account_invoice_view.xml (+46/-0)
l10n_it_ri_ba/account_move_line.py (+153/-0)
l10n_it_ri_ba/account_riba_workflow.xml (+63/-0)
l10n_it_ri_ba/i18n/it.po (+545/-0)
l10n_it_ri_ba/i18n/riba_issue.pot (+545/-0)
l10n_it_ri_ba/report/__init__.py (+25/-0)
l10n_it_ri_ba/report/order.mako (+49/-0)
l10n_it_ri_ba/report/riba_order.py (+46/-0)
l10n_it_ri_ba/riba_issue.py (+522/-0)
l10n_it_ri_ba/riba_issue_view.xml (+365/-0)
l10n_it_ri_ba/riba_report.xml (+7/-0)
l10n_it_ri_ba/riba_sequence.xml (+29/-0)
l10n_it_ri_ba/security/ir.model.access.csv (+11/-0)
l10n_it_ri_ba/security/riba_issue_security.xml (+31/-0)
l10n_it_ri_ba/wizard/__init__.py (+28/-0)
l10n_it_ri_ba/wizard/riba_file_export.py (+247/-0)
l10n_it_ri_ba/wizard/riba_file_export.xml (+33/-0)
l10n_it_ri_ba/wizard/riba_issue_order.py (+131/-0)
l10n_it_ri_ba/wizard/riba_issue_order_view.xml (+51/-0)
l10n_it_ri_ba/wizard/riba_issue_pay.py (+42/-0)
l10n_it_ri_ba/wizard/riba_issue_pay_view.xml (+33/-0)
To merge this branch: bzr merge lp:~openobject-italia-core-devs/openobject-italia/riba
Reviewer Review Type Date Requested Status
Lorenzo Battistini Needs Fixing
Review via email: mp+79931@code.launchpad.net
To post a comment you must log in.
111. By Eliumara Lopez

[FIX] version

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Bisognerebbe rinominare il modulo in l10n_it_ri_ba.
Ho spostato la vecchia versione del modulo nel seguente branch
https://code.launchpad.net/~openobject-italia-core-devs/openobject-italia/l10n_it_ri_ba_old

Eliumara, se vuoi mettere ~openobject-italia-core-devs come proprietario del tuo branch ( https://code.launchpad.net/~lopez.eliumara/openobject-italia/riba ), posso fare anch'io queste modifiche

review: Needs Fixing
Revision history for this message
Eliumara Lopez (lopez.eliumara) wrote :

ok faccio io le modifiche!...Ma solo una cosa, come metto ~openobject-italia-core-devs propietario del branch?

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Se le fai te, prima di rinominare il tuo modulo devi recuperare gli aggiornamenti da lp:openobject-italia con un merge.
Per cambiare l'owner del tuo branch, vai qui https://code.launchpad.net/~lopez.eliumara/openobject-italia/riba e fai 'Change branch details'

112. By Lorenzo Battistini

[MERGE] parent

113. By Lorenzo Battistini

[FIX] module renamed

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Ho rinominato il modulo. Nei prossimi giorni sistemo altri dettagli.
Nel frattempo, chiunque voglia testarlo è ben accetto :-)

review: Needs Fixing
114. By Lorenzo Battistini

[FIX] copyright

Revision history for this message
Eliumara Lopez (lopez.eliumara) wrote :

Assolutamente si, vi invito a provare le Riba!... Abbiamo cercato di migliorare ed adeguare tutte le caratteristiche del codice esistente, nonché di raggruppare tutte le loro funzionalità in un unico modulo. Nel caso vorresti proporre idee, miglioramenti o vostre impressioni sulla funzionalità del programma, saremo sicuramente lieti di ricevere i vostri riscontri e osservazioni.

115. By Eliumara Lopez

[FIX] account_invoice_view

Revision history for this message
bruno bottacini (bruno-bottacini) wrote :

bisognerebbe aggiungere la dipendenza a l10n_it_account.
inoltre ci sono dei bug nel file: l10n_it_ri_ba/wizard/riba_file_export.py

24c24
< *****************************************************************************************
---
> **********************************2011/002*******************************************************
92a93
> import pdb; pdb.set_trace()
171c172
< order_obj.company_id.partner_id.vat[2:] or order_obj.company_id.partner_id.fiscalcode,
---
> order_obj.company_id.partner_id.vat and order_obj.company_id.partner_id.vat[2:] or order_obj.company_id.partner_id.fiscalcode,
203c204
< line.partner_id.vat[2:] or line.partner_id.fiscalcode,
---
> line.partner_id.vat and line.partner_id.vat[2:] or line.partner_id.fiscalcode,

Revision history for this message
bruno bottacini (bruno-bottacini) wrote :

nel file l10n_it_ri_ba/account_move_line.py

131c131
< line2iban[line.id] = line.invoice.partner_bank_id.id.iban
---
> line2iban[line.id] = line.invoice.partner_bank_id.iban
138c138
< line2iban[line.id] = bank.id.iban
---
> line2iban[line.id] = bank.iban

116. By Lorenzo Battistini

[FIX] copyright

117. By Lorenzo Battistini

[FIX] exception when VAT not present

118. By Lorenzo Battistini

[FIX] iban wrongly retrieved

119. By Lorenzo Battistini

[FIX] dependency

120. By Lorenzo Battistini

[FIX] dependency

Revision history for this message
Lorenzo Battistini (elbati) wrote :
121. By Eliumara Lopez

[FIX] lp:882958

122. By Eliumara Lopez

[FIX]&[IMP]

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Ciao Eliumara, se anche il bug 882996 è stato risolto, puoi impostarlo come 'fix committed'? Grazie

123. By Eliumara Lopez

[FIX] dipendenza report_webkit

Revision history for this message
Eliumara Lopez (lopez.eliumara) wrote :
124. By Lorenzo Battistini

[FIX] string

125. By Eliumara Lopez

[FIX] riba_file_export.py

126. By Eliumara Lopez

[FIX] riba_file_export.py: street creditor specified or not

127. By Lorenzo Battistini

[FIX] quando apro una fattura cliente (dal sottomenu riba) viene usato il form per le fatture fornitori

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'l10n_it_ri_ba'
2=== added file 'l10n_it_ri_ba/AUTHORS.txt'
3--- l10n_it_ri_ba/AUTHORS.txt 1970-01-01 00:00:00 +0000
4+++ l10n_it_ri_ba/AUTHORS.txt 2012-01-03 08:07:26 +0000
5@@ -0,0 +1,2 @@
6+Eliumara Lopez <lopez@cecchi.info> Programmer
7+Piero Cecchi <piero@cecchi.com> Accounting Analyst
8
9=== added file 'l10n_it_ri_ba/__init__.py'
10--- l10n_it_ri_ba/__init__.py 1970-01-01 00:00:00 +0000
11+++ l10n_it_ri_ba/__init__.py 2012-01-03 08:07:26 +0000
12@@ -0,0 +1,34 @@
13+# -*- coding: utf-8 -*-
14+##############################################################################
15+#
16+# Copyright (C) 2011 Associazione OpenERP Italia
17+# (<http://www.openerp-italia.org>).
18+# All Rights Reserved
19+# Thanks to Cecchi s.r.l http://www.cecchi.com/
20+#
21+# This program is free software: you can redistribute it and/or modify
22+# it under the terms of the GNU Affero General Public License as published by
23+# the Free Software Foundation, either version 3 of the License, or
24+# (at your option) any later version.
25+#
26+# This program is distributed in the hope that it will be useful,
27+# but WITHOUT ANY WARRANTY; without even the implied warranty of
28+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29+# GNU General Public License for more details.
30+#
31+# You should have received a copy of the GNU Affero General Public License
32+# along with this program. If not, see <http://www.gnu.org/licenses/>.
33+#
34+##############################################################################
35+
36+#----------------------------------------------------------
37+# Init RiBa
38+#----------------------------------------------------------
39+
40+import riba_issue
41+import wizard
42+import account_move_line
43+import account_invoice
44+import report
45+
46+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
47
48=== added file 'l10n_it_ri_ba/__openerp__.py'
49--- l10n_it_ri_ba/__openerp__.py 1970-01-01 00:00:00 +0000
50+++ l10n_it_ri_ba/__openerp__.py 2012-01-03 08:07:26 +0000
51@@ -0,0 +1,57 @@
52+# -*- coding: utf-8 -*-
53+##############################################################################
54+#
55+# Copyright (C) 2011 Associazione OpenERP Italia
56+# (<http://www.openerp-italia.org>).
57+# All Rights Reserved
58+# Thanks to Cecchi s.r.l http://www.cecchi.com/
59+#
60+# This program is free software: you can redistribute it and/or modify
61+# it under the terms of the GNU Affero General Public License as published by
62+# the Free Software Foundation, either version 3 of the License, or
63+# (at your option) any later version.
64+#
65+# This program is distributed in the hope that it will be useful,
66+# but WITHOUT ANY WARRANTY; without even the implied warranty of
67+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
68+# GNU General Public License for more details.
69+#
70+# You should have received a copy of the GNU Affero General Public License
71+# along with this program. If not, see <http://www.gnu.org/licenses/>.
72+#
73+##############################################################################
74+{
75+ "name": "RiBa Issue",
76+ "version": "1.0",
77+ "author": "OpenERP Italian Community",
78+ "category": "Localisation/Italy",
79+ "website": "http://www.openerp-italia.org",
80+ "description": """Module to manage RiBa issue.
81+=================================
82+
83+This module provides :
84+----------------------
85+* a more efficient way to manage RiBa issue.
86+* a basic mechanism to easily plug various automated issue.
87+ """,
88+ 'images': [],
89+ 'depends': ['account','account_voucher', 'l10n_it_account', 'report_webkit'],
90+ 'init_xml': [],
91+ 'update_xml': [
92+ 'security/riba_issue_security.xml',
93+ 'security/ir.model.access.csv',
94+ 'wizard/riba_issue_pay_view.xml',
95+ 'wizard/riba_issue_order_view.xml',
96+ 'wizard/riba_file_export.xml',
97+ 'account_invoice_view.xml',
98+ 'riba_issue_view.xml',
99+ 'riba_report.xml',
100+ 'riba_sequence.xml',
101+ 'account_riba_workflow.xml'
102+ ],
103+ 'demo_xml': [],
104+ 'test': [],
105+ 'installable': True,
106+ 'active': False,
107+}
108+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
109
110=== added file 'l10n_it_ri_ba/account_invoice.py'
111--- l10n_it_ri_ba/account_invoice.py 1970-01-01 00:00:00 +0000
112+++ l10n_it_ri_ba/account_invoice.py 2012-01-03 08:07:26 +0000
113@@ -0,0 +1,68 @@
114+# -*- coding: utf-8 -*-
115+##############################################################################
116+#
117+# Copyright (C) 2011 Associazione OpenERP Italia
118+# (<http://www.openerp-italia.org>).
119+# All Rights Reserved
120+# Thanks to Cecchi s.r.l http://www.cecchi.com/
121+#
122+# This program is free software: you can redistribute it and/or modify
123+# it under the terms of the GNU Affero General Public License as published by
124+# the Free Software Foundation, either version 3 of the License, or
125+# (at your option) any later version.
126+#
127+# This program is distributed in the hope that it will be useful,
128+# but WITHOUT ANY WARRANTY; without even the implied warranty of
129+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
130+# GNU General Public License for more details.
131+#
132+# You should have received a copy of the GNU Affero General Public License
133+# along with this program. If not, see <http://www.gnu.org/licenses/>.
134+#
135+##############################################################################
136+
137+from datetime import datetime
138+
139+from osv import fields, osv
140+from tools.translate import _
141+
142+class Invoice(osv.osv):
143+ _inherit = 'account.invoice'
144+
145+ def search_move_id_riba(self, cr, uid, ids, context):
146+ """Invoices on Payments_Term Riba True"""
147+ cr.execute(""" SELECT ai.move_id
148+ FROM account_invoice ai
149+ INNER JOIN account_payment_term pt ON (ai.payment_term = pt.id)
150+ WHERE pt.riba = 'True'""")
151+ return [x[0] for x in cr.fetchall()]
152+
153+
154+ def action_process_riba(self, cr, uid, ids, context=None):
155+ if not ids: return []
156+ inv = self.browse(cr, uid, ids[0], context=context)
157+ if inv.payment_term.riba is True:
158+ return {
159+ 'name':_("Pay Invoice"),
160+ 'view_mode': 'form',
161+ 'view_id': False,
162+ 'view_type': 'form',
163+ 'res_model': 'account.voucher',
164+ 'type': 'ir.actions.act_window',
165+ 'nodestroy': True,
166+ 'target': 'current',
167+ 'domain': '[]',
168+ 'context': {
169+ 'default_partner_id': inv.partner_id.id,
170+ 'default_amount': inv.residual,
171+ 'default_name':inv.internal_number,
172+ 'close_after_process': True,
173+ 'invoice_type':inv.type,
174+ 'invoice_id':inv.id,
175+ 'default_type': inv.type in ('out_invoice') and 'receipt' or 'payment'
176+ }
177+ }
178+
179+Invoice()
180+
181+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
182
183=== added file 'l10n_it_ri_ba/account_invoice_view.xml'
184--- l10n_it_ri_ba/account_invoice_view.xml 1970-01-01 00:00:00 +0000
185+++ l10n_it_ri_ba/account_invoice_view.xml 2012-01-03 08:07:26 +0000
186@@ -0,0 +1,46 @@
187+<?xml version="1.0" encoding="utf-8"?>
188+<openerp>
189+ <data>
190+
191+ <!--
192+ Customers Invoices
193+ -->
194+ <record id="riba_invoice_tree" model="ir.ui.view">
195+ <field name="name">account.riba.invoice.tree</field>
196+ <field name="model">account.invoice</field>
197+ <field name="type">tree</field>
198+ <field name="inherit_id" ref="account.invoice_tree"/>
199+ <field name="arch" type="xml">
200+ <field name="state" position="after">
201+ <button name="action_process_riba" states="open" string="Process" type="object" icon="gtk-go-forward"/>
202+ </field>
203+ </field>
204+ </record>
205+
206+ <record id="action_riba_invoice_customer_tree1" model="ir.actions.act_window">
207+ <field name="name">Customer Invoices</field>
208+ <field name="res_model">account.invoice</field>
209+ <field name="view_type">form</field>
210+ <field name="view_mode">tree,form,calendar,graph</field>
211+ <field eval="False" name="view_id"/>
212+ <field name="domain">[('type','=','out_invoice'),('payment_term.riba', '=', 'True')]</field>
213+ <field name="context">{'type':'out_invoice', 'journal_type': 'sale'}</field>
214+ <field name="search_view_id" ref="account.view_account_invoice_filter"/>
215+ <field name="help">With Customer Invoices with RiBa term you can create and manage sales invoices issued to your customers.</field>
216+ </record>
217+
218+ <record id="action_riba_invoice_customer_tree1_view1" model="ir.actions.act_window.view">
219+ <field eval="1" name="sequence"/>
220+ <field name="view_mode">tree</field>
221+ <field name="act_window_id" ref="action_riba_invoice_customer_tree1"/>
222+ </record>
223+
224+ <record id="action_riba_invoice_customer_tree1_view2" model="ir.actions.act_window.view">
225+ <field eval="2" name="sequence"/>
226+ <field name="view_mode">form</field>
227+ <field name="view_id" ref="account.invoice_form"/>
228+ <field name="act_window_id" ref="action_riba_invoice_customer_tree1"/>
229+ </record>
230+
231+ </data>
232+</openerp>
233
234=== added file 'l10n_it_ri_ba/account_move_line.py'
235--- l10n_it_ri_ba/account_move_line.py 1970-01-01 00:00:00 +0000
236+++ l10n_it_ri_ba/account_move_line.py 2012-01-03 08:07:26 +0000
237@@ -0,0 +1,153 @@
238+# -*- coding: utf-8 -*-
239+##############################################################################
240+#
241+# Copyright (C) 2011 Associazione OpenERP Italia
242+# (<http://www.openerp-italia.org>).
243+# All Rights Reserved
244+# Thanks to Cecchi s.r.l http://www.cecchi.com/
245+#
246+# This program is free software: you can redistribute it and/or modify
247+# it under the terms of the GNU Affero General Public License as published by
248+# the Free Software Foundation, either version 3 of the License, or
249+# (at your option) any later version.
250+#
251+# This program is distributed in the hope that it will be useful,
252+# but WITHOUT ANY WARRANTY; without even the implied warranty of
253+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
254+# GNU General Public License for more details.
255+#
256+# You should have received a copy of the GNU Affero General Public License
257+# along with this program. If not, see <http://www.gnu.org/licenses/>.
258+#
259+##############################################################################
260+
261+from operator import itemgetter
262+from osv import fields, osv
263+from tools.translate import _
264+
265+class account_move_line(osv.osv):
266+ _inherit = "account.move.line"
267+
268+ def riba_amount_to_pay(self, cr, uid, ids, name, arg={}, context=None):
269+ """ Return the amount still to pay regarding all the riba orders
270+ (excepting cancelled orders)"""
271+ if not ids:
272+ return {}
273+ cr.execute("""SELECT ml.id,
274+ CASE WHEN ml.amount_currency < 0
275+ THEN - ml.amount_currency
276+ ELSE ml.debit
277+ END -
278+ (SELECT coalesce(sum(amount_currency),0)
279+ FROM riba_line rl
280+ INNER JOIN riba_order ro
281+ ON (rl.order_id = ro.id)
282+ WHERE move_line_id = ml.id
283+ AND ro.state != 'cancel') AS amount
284+ FROM account_move_line ml
285+ WHERE id IN %s""", (tuple(ids),))
286+ r = dict(cr.fetchall())
287+ return r
288+
289+ def riba_to_pay_search(self, cr, uid, obj, name, args, context=None):
290+ if not args:
291+ return []
292+ line_obj = self.pool.get('account.move.line')
293+ query = line_obj._query_get(cr, uid, context={})
294+ where = ' and '.join(map(lambda x: '''(SELECT
295+ CASE WHEN l.amount_currency < 0
296+ THEN - l.amount_currency
297+ ELSE l.debit
298+ END - coalesce(sum(rl.amount_currency), 0)
299+ FROM riba_line rl
300+ INNER JOIN riba_order ro ON (rl.order_id = ro.id)
301+ WHERE move_line_id = l.id
302+ AND ro.state != 'cancel'
303+ ) %(operator)s %%s ''' % {'operator': x[1]}, args))
304+ sql_args = tuple(map(itemgetter(2), args))
305+
306+ cr.execute(('''SELECT id
307+ FROM account_move_line l
308+ WHERE account_id IN (select id
309+ FROM account_account
310+ WHERE type=%s AND active)
311+ AND reconcile_id IS NOT NULL
312+ AND debit > 0
313+ AND ''' + where + ' and ' + query), ('receivable',)+sql_args )
314+ res = cr.fetchall()
315+ if not res:
316+ return [('id', '=', '0')]
317+ return [('id', 'in', map(lambda x:x[0], res))]
318+
319+ def line_2_bank(self, cr, uid, ids, payment_type=None, context=None):
320+ """
321+ Try to return for each Ledger Posting line a corresponding bank
322+ account according to the payment type. This work using one of
323+ the bank of the partner defined on the invoice eventually
324+ associated to the line.
325+ Return the last suitable bank for the corresponding partner.
326+ """
327+ riba_line_obj = self.pool.get('riba.line')
328+ line2bank = {}
329+ if not ids:
330+ return {}
331+ bank_type = riba_line_obj.s_bank_types(cr, uid, payment_type,
332+ context=context)
333+ for line in self.browse(cr, uid, ids, context=context):
334+ line2bank[line.id] = False
335+ if line.invoice and line.invoice.partner_bank_id:
336+ line2bank[line.id] = line.invoice.partner_bank_id.id
337+ elif line.partner_id:
338+ if not line.partner_id.bank_ids:
339+ line2bank[line.id] = False
340+ else:
341+ for bank in line.partner_id.bank_ids:
342+ if bank.state in bank_type:
343+ line2bank[line.id] = bank.id
344+ break
345+ if not line2bank[line.id] and line.partner_id.bank_ids:
346+ line2bank[line.id] = line.partner_id.bank_ids[-1].id
347+ else:
348+ raise osv.except_osv(_('Error !'), _('No partner defined on entry line'))
349+ return line2bank
350+
351+ def line_2_iban(self, cr, uid, ids, payment_type=None, context=None):
352+ """
353+ Try to return for each Ledger Posting line a corresponding code
354+ iban to the payment type. This work using one of
355+ the bank of the partner defined on the invoice eventually
356+ associated to the line.
357+ Return the last suitable bank for the corresponding partner.
358+ """
359+ riba_line_obj = self.pool.get('riba.line')
360+ line2iban = {}
361+ if not ids:
362+ return {}
363+ bank_type = riba_line_obj.s_bank_types(cr, uid, payment_type,
364+ context=context)
365+ for line in self.browse(cr, uid, ids, context=context):
366+ line2iban[line.id] = False
367+ if line.invoice and line.invoice.partner_bank_id:
368+ line2iban[line.id] = line.invoice.partner_bank_id.iban
369+ elif line.partner_id:
370+ if not line.partner_id.bank_ids:
371+ line2iban[line.id] = False
372+ else:
373+ for bank in line.partner_id.bank_ids:
374+ if bank.state in bank_type:
375+ line2iban[line.id] = bank.iban
376+ break
377+ if not line2iban[line.id] and line.partner_id.bank_ids:
378+ line2iban[line.id] = line.partner_id.bank_ids[-1].iban
379+ else:
380+ raise osv.except_osv(_('Error !'), _('No partner defined on entry line'))
381+ return line2iban
382+
383+ _columns = {
384+ 'riba_amount_to_pay': fields.function(riba_amount_to_pay, method=True,
385+ type='float', string='Amount to pay', fnct_search= riba_to_pay_search),
386+ }
387+
388+account_move_line()
389+
390+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
391
392=== added file 'l10n_it_ri_ba/account_riba_workflow.xml'
393--- l10n_it_ri_ba/account_riba_workflow.xml 1970-01-01 00:00:00 +0000
394+++ l10n_it_ri_ba/account_riba_workflow.xml 2012-01-03 08:07:26 +0000
395@@ -0,0 +1,63 @@
396+<?xml version="1.0" encoding="utf-8"?>
397+<openerp>
398+ <data>
399+ <record id="wkf_riba_order" model="workflow">
400+ <field name="name">RiBa Order Workflow</field>
401+ <field name="osv">riba.order</field>
402+ <field name="on_create">True</field>
403+ </record>
404+ <!--Activity -->
405+ <record id="act_draft" model="workflow.activity">
406+ <field name="name">draft</field>
407+ <field name="wkf_id" ref="wkf_riba_order"/>
408+ <field name="flow_start">True</field>
409+ <field name="action">write({'state':'draft'})</field>
410+ <field name="kind">function</field>
411+ </record>
412+ <record id="act_open" model="workflow.activity">
413+ <field name="name">open</field>
414+ <field name="wkf_id" ref="wkf_riba_order"/>
415+ <field name="action">action_open()
416+write({'state':'open'})</field>
417+ <field name="kind">function</field>
418+ </record>
419+ <record id="act_done" model="workflow.activity">
420+ <field name="name">done</field>
421+ <field name="wkf_id" ref="wkf_riba_order"/>
422+ <field name="action">write({'state':'done'})</field>
423+ <field name="kind">function</field>
424+ <field name="flow_stop">True</field>
425+ </record>
426+ <record id="act_cancel" model="workflow.activity">
427+ <field name="name">cancel</field>
428+ <field name="wkf_id" ref="wkf_riba_order"/>
429+ <field name="action">write({'state':'cancel'})</field>
430+ <field name="kind">function</field>
431+ <field name="flow_stop">True</field>
432+ </record>
433+
434+ <!-- Transition -->
435+ <record id="trans_draft_open" model="workflow.transition">
436+ <field name="act_from" ref="act_draft"/>
437+ <field name="act_to" ref="act_open"/>
438+ <field name="signal">open</field>
439+ </record>
440+
441+ <record id="trans_open_done" model="workflow.transition">
442+ <field name="act_from" ref="act_open"/>
443+ <field name="act_to" ref="act_done"/>
444+ <field name="signal">done</field>
445+ </record>
446+ <record id="trans_draft_cancel" model="workflow.transition">
447+ <field name="act_from" ref="act_draft"/>
448+ <field name="act_to" ref="act_cancel"/>
449+ <field name="signal">cancel</field>
450+ </record>
451+ <record id="trans_open_cancel" model="workflow.transition">
452+ <field name="act_from" ref="act_open"/>
453+ <field name="act_to" ref="act_cancel"/>
454+ <field name="signal">cancel</field>
455+ </record>
456+
457+ </data>
458+</openerp>
459
460=== added directory 'l10n_it_ri_ba/i18n'
461=== added file 'l10n_it_ri_ba/i18n/it.po'
462--- l10n_it_ri_ba/i18n/it.po 1970-01-01 00:00:00 +0000
463+++ l10n_it_ri_ba/i18n/it.po 2012-01-03 08:07:26 +0000
464@@ -0,0 +1,545 @@
465+# Translation of OpenERP Server.
466+# This file contains the translation of the following modules:
467+# * riba_issue
468+#
469+msgid ""
470+msgstr ""
471+"Project-Id-Version: OpenERP Server 6.0.0-rc2\n"
472+"Report-Msgid-Bugs-To: support@openerp.com\n"
473+"POT-Creation-Date: 2011-01-11 11:14:33+0000\n"
474+"PO-Revision-Date: 2011-01-11 11:14:33+0000\n"
475+"Last-Translator: <>\n"
476+"Language-Team: \n"
477+"MIME-Version: 1.0\n"
478+"Content-Type: text/plain; charset=UTF-8\n"
479+"Content-Transfer-Encoding: \n"
480+"Plural-Forms: \n"
481+
482+#. module: riba_issue
483+#: field:riba.order,date_scheduled:0
484+msgid "Scheduled date if fixed"
485+msgstr ""
486+
487+#. module: riba_issue
488+#: field:riba.line,currency:0
489+msgid "Partner Currency"
490+msgstr ""
491+
492+#. module: riba_issue
493+#: help:riba.order,mode:0
494+msgid "Select the Riba Mode to be applied."
495+msgstr ""
496+
497+#. module: riba_issue
498+#: view:riba.mode:0
499+#: view:riba.order:0
500+msgid "Group By..."
501+msgstr ""
502+
503+#. module: riba_issue
504+#: field:riba.order,line_ids:0
505+msgid "Riba lines"
506+msgstr ""
507+
508+#. module: riba_issue
509+#: view:riba.line:0
510+#: field:riba.line,info_owner:0
511+#: view:riba.order:0
512+msgid "Owner Account"
513+msgstr ""
514+
515+#. module: riba_issue
516+#: help:riba.order,state:0
517+msgid "When an order is placed the state is 'Draft'.\n"
518+" Once the bank is confirmed the state is set to 'Confirmed'.\n"
519+" Then the order is paid the state is 'Done'."
520+msgstr ""
521+
522+#. module: riba_issue
523+#: field:riba.mode,company_id:0
524+msgid "Company"
525+msgstr ""
526+
527+#. module: riba_issue
528+#: field:riba.order,date_prefered:0
529+msgid "Preferred date"
530+msgstr ""
531+
532+#. module: riba_issue
533+#: selection:riba.line,state:0
534+msgid "Free"
535+msgstr ""
536+
537+#. module: riba_issue
538+#: field:riba.order.create,entries:0
539+msgid "Entries"
540+msgstr ""
541+
542+#. module: riba_issue
543+#: field:riba.line,ml_maturity_date:0
544+#: field:riba.order.create,duedate:0
545+msgid "Due Date"
546+msgstr ""
547+
548+
549+#. module: riba_issue
550+#: view:riba.order.create:0
551+msgid "_Add to Riba Order"
552+msgstr ""
553+
554+#. module: riba_issue
555+#: report:riba.order:0
556+#: view:riba.order:0
557+msgid "Amount"
558+msgstr ""
559+
560+#. module: riba_issue
561+#: view:riba.order:0
562+msgid "Total in Company Currency"
563+msgstr ""
564+
565+#. module: riba_issue
566+#: selection:riba.order,state:0
567+msgid "Cancelled"
568+msgstr ""
569+
570+#. module: riba_issue
571+#: model:ir.actions.act_window,name:riba_issue.action_riba_order_tree_new
572+msgid "New Riba Order"
573+msgstr ""
574+
575+#. module: riba_issue
576+#: report:riba.order:0
577+#: field:riba.order,reference:0
578+msgid "Reference"
579+msgstr ""
580+
581+#. module: riba_issue
582+#: sql_constraint:riba.line:0
583+msgid "The riba line name must be unique!"
584+msgstr ""
585+
586+#. module: riba_issue
587+#: model:ir.actions.act_window,name:riba_issue.action_riba_order_tree
588+#: model:ir.ui.menu,name:riba_issue.menu_action_riba_order_form
589+msgid "Riba Orders"
590+msgstr ""
591+
592+#. module: riba_issue
593+#: selection:riba.order,date_prefered:0
594+msgid "Directly"
595+msgstr ""
596+
597+#. module: riba_issue
598+#: model:ir.actions.act_window,name:riba_issue.action_riba_line_form
599+#: model:ir.model,name:riba_issue.model_riba_line
600+#: view:riba.line:0
601+#: view:riba.order:0
602+msgid "Riba Line"
603+msgstr ""
604+
605+#. module: riba_issue
606+#: view:riba.line:0
607+msgid "Amount Total"
608+msgstr ""
609+
610+#. module: riba_issue
611+#: view:riba.order:0
612+#: selection:riba.order,state:0
613+msgid "Confirmed"
614+msgstr ""
615+
616+#. module: riba_issue
617+#: help:riba.line,ml_date_created:0
618+msgid "Invoice Effective Date"
619+msgstr ""
620+
621+#. module: riba_issue
622+#: report:riba.order:0
623+msgid "Execution Type"
624+msgstr ""
625+
626+#. module: riba_issue
627+#: selection:riba.line,state:0
628+msgid "Structured"
629+msgstr ""
630+
631+#. module: riba_issue
632+#: view:riba.order:0
633+#: field:riba.order,state:0
634+msgid "State"
635+msgstr ""
636+
637+#. module: riba_issue
638+#: view:riba.line:0
639+#: view:riba.order:0
640+msgid "Transaction Information"
641+msgstr ""
642+
643+#. module: riba_issue
644+#: model:ir.actions.act_window,name:riba_issue.action_riba_mode_form
645+#: model:ir.model,name:riba_issue.riba_mode
646+#: model:ir.ui.menu,name:riba_issue.menu_action_riba_mode_form
647+#: view:riba.mode:0
648+#: view:riba.order:0
649+msgid "Riba Mode"
650+msgstr ""
651+
652+#. module: riba_issue
653+#: field:riba.line,ml_date_created:0
654+msgid "Effective Date"
655+msgstr ""
656+
657+#. module: riba_issue
658+#: field:riba.line,ml_inv_ref:0
659+msgid "Invoice Ref."
660+msgstr ""
661+
662+#. module: riba_issue
663+#: help:riba.order,date_prefered:0
664+msgid "Choose an option for the Riba Order:'Fixed' stands for a date specified by you.'Directly' stands for the direct execution.'Due date' stands for the scheduled date of execution."
665+msgstr ""
666+
667+#. module: riba_issue
668+#: code:addons/riba_issue/account_move_line.py:110
669+#, python-format
670+msgid "Error !"
671+msgstr ""
672+
673+#. module: riba_issue
674+#: field:riba.order,date_done:0
675+msgid "Execution date"
676+msgstr ""
677+
678+#. module: riba_issue
679+#: help:riba.mode,journal:0
680+msgid "Bank Journal for the Mode RiBa"
681+msgstr ""
682+
683+#. module: riba_issue
684+#: selection:riba.order,date_prefered:0
685+msgid "Fixed date"
686+msgstr ""
687+
688+#. module: riba_issue
689+#: field:riba.line,info_partner:0
690+#: view:riba.order:0
691+msgid "Destination Account"
692+msgstr ""
693+
694+#. module: riba_issue
695+#: view:riba.line:0
696+msgid "Destination Account"
697+msgstr ""
698+
699+#. module: riba_issue
700+#: view:riba.order:0
701+msgid "Search Riba Orders"
702+msgstr ""
703+
704+#. module: riba_issue
705+#: field:riba.line,create_date:0
706+msgid "Created"
707+msgstr ""
708+
709+#. module: riba_issue
710+#: view:riba.line:0
711+msgid "Currency Amount Total"
712+msgstr ""
713+
714+#. module: riba_issue
715+#: view:riba.order:0
716+msgid "Make Issue"
717+msgstr ""
718+
719+#. module: riba_issue
720+#: field:riba.line,state:0
721+msgid "Communication Type"
722+msgstr ""
723+
724+#. module: riba_issue
725+#: selection:riba.order,date_prefered:0
726+msgid "Due date"
727+msgstr ""
728+
729+#. module: riba_issue
730+#: report:riba.order:0
731+msgid "Currency"
732+msgstr ""
733+
734+#. module: riba_issue
735+#: view:riba.issue.make.payment:0
736+msgid "Yes"
737+msgstr ""
738+
739+#. module: riba_issue
740+#: help:riba.line,info_owner:0
741+msgid "Address of the Main Partner"
742+msgstr ""
743+
744+#. module: riba_issue
745+#: help:riba.line,date:0
746+msgid "If no payment date is specified, the bank will treat this riba line directly"
747+msgstr ""
748+
749+#. module: riba_issue
750+#: help:riba.mode,name:0
751+msgid "Bank of Presentacion"
752+msgstr ""
753+
754+#. module: riba_issue
755+#: report:riba.order:0
756+msgid "Value Date"
757+msgstr ""
758+
759+
760+#. module: riba_issue
761+#: help:riba.line,amount_currency:0
762+msgid "Payment amount in the partner currency"
763+msgstr ""
764+
765+#. module: riba_issue
766+#: view:riba.order:0
767+#: selection:riba.order,state:0
768+msgid "Draft"
769+msgstr ""
770+
771+#. module: riba_issue
772+#: help:riba.line,communication2:0
773+msgid "The successor message of Communication."
774+msgstr ""
775+
776+#. module: riba_issue
777+#: help:riba.line,info_partner:0
778+msgid "Address of the Customer."
779+msgstr ""
780+
781+#. module: riba_issue
782+#: help:riba.order,date_scheduled:0
783+msgid "Select a date if you have chosen Preferred Date to be fixed."
784+msgstr ""
785+
786+#. module: riba_issue
787+#: field:riba.order,user_id:0
788+msgid "User"
789+msgstr ""
790+
791+#. module: riba_issue
792+#: model:ir.model,name:riba_issue.model_account_move_line
793+msgid "Journal Items"
794+msgstr ""
795+
796+#. module: riba_issue
797+#: constraint:account.move.line:0
798+msgid "Company must be same for its related account and period."
799+msgstr ""
800+
801+#. module: riba_issue
802+#: help:riba.line,move_line_id:0
803+msgid "This Entry Line will be referred for the information of the ordering customer."
804+msgstr ""
805+
806+#. module: riba_issue
807+#: view:riba.order.create:0
808+msgid "Search"
809+msgstr ""
810+
811+#. module: riba_issue
812+#: model:ir.actions.report.xml,name:riba_issue.riba_order1
813+#: model:ir.model,name:riba_issue.riba_order
814+msgid "Riba Order"
815+msgstr ""
816+
817+#. module: riba_issue
818+#: field:riba.line,date:0
819+msgid "Date"
820+msgstr ""
821+
822+#. module: riba_issue
823+#: report:riba.order:0
824+msgid "Total:"
825+msgstr ""
826+
827+#. module: riba_issue
828+#: field:riba.order,date_created:0
829+msgid "Creation date"
830+msgstr ""
831+
832+#. module: riba_issue
833+#: field:riba.line,amount:0
834+msgid "Amount in Company Currency"
835+msgstr ""
836+
837+#. module: riba_issue
838+#: help:riba.line,partner_id:0
839+msgid "The Ordering Customer"
840+msgstr ""
841+
842+#. module: riba_issue
843+#: report:riba.order:0
844+msgid "Invoice Ref"
845+msgstr ""
846+
847+#. module: riba_issue
848+#: field:riba.line,name:0
849+msgid "Your Reference"
850+msgstr ""
851+
852+#. module: riba_issue
853+#: field:riba.order,mode:0
854+msgid "riba mode"
855+msgstr ""
856+
857+#. module: riba_issue
858+#: view:riba.order:0
859+msgid "riba order"
860+msgstr ""
861+
862+#. module: riba_issue
863+#: view:riba.line:0
864+#: view:riba.order:0
865+msgid "General Information"
866+msgstr ""
867+
868+#. module: riba_issue
869+#: view:riba.order:0
870+#: selection:riba.order,state:0
871+msgid "Done"
872+msgstr ""
873+
874+#. module: riba_issue
875+#: model:ir.model,name:riba_issue.account_invoice
876+msgid "Invoice"
877+msgstr ""
878+
879+#. module: riba_issue
880+#: field:riba.line,communication:0
881+msgid "Communication"
882+msgstr ""
883+
884+#. module: riba_issue
885+#: view:riba.issue.make.payment:0
886+#: view:riba.order:0
887+#: view:riba.order.create:0
888+msgid "Cancel"
889+msgstr ""
890+
891+#. module: riba_issue
892+#: view:riba.line:0
893+#: view:riba.order:0
894+msgid "Information"
895+msgstr ""
896+
897+#. module: riba_issue
898+#: model:ir.actions.act_window,help:riba_issue.action_riba_order_tree
899+msgid "A riba order is a issue request from your company to pay a custumer invoice or a customer debit note. Here you can register all riba orders that should be done, keep track of all riba orders and mention the invoice reference and the partner the riba should be done for."
900+msgstr ""
901+
902+#. module: riba_issue
903+#: help:riba.line,amount:0
904+msgid "riba amount in the company currency"
905+msgstr ""
906+
907+#. module: riba_issue
908+#: view:riba.order.create:0
909+msgid "Search riba lines"
910+msgstr ""
911+
912+#. module: riba_issue
913+#: field:riba.line,amount_currency:0
914+msgid "Amount in Partner Currency"
915+msgstr ""
916+
917+#. module: riba_issue
918+#: field:riba.line,communication2:0
919+msgid "Communication 2"
920+msgstr ""
921+
922+#. module: riba_issue
923+#: field:riba.line,bank_id:0
924+msgid "Debitor Bank"
925+msgstr ""
926+
927+#. module: riba_issue
928+#: view:account.riba.make.riba:0
929+msgid "Are you sure you want to make Issue RiBa?"
930+msgstr ""
931+
932+#. module: riba_issue
933+#: view:riba.mode:0
934+#: field:riba.mode,journal:0
935+msgid "Journal"
936+msgstr ""
937+
938+#. module: riba_issue
939+#: field:riba.mode,bank_id:0
940+msgid "Bank account"
941+msgstr ""
942+
943+#. module: riba_issue
944+#: view:riba.order:0
945+msgid "Confirm Issue"
946+msgstr ""
947+
948+#. module: riba_issue
949+#: field:riba.line,company_currency:0
950+#: report:riba.order:0
951+msgid "Company Currency"
952+msgstr ""
953+
954+#. module: riba_issue
955+#: field:riba.line,move_line_id:0
956+msgid "Entry line"
957+msgstr ""
958+
959+#. module: riba_issue
960+#: help:riba.line,communication:0
961+msgid "Used as the message between ordering customer and current company. Depicts 'What do you want to say to the recipient about this order?'"
962+msgstr ""
963+
964+#. module: riba_issue
965+#: field:riba.mode,name:0
966+msgid "Name"
967+msgstr ""
968+
969+#. module: riba_issue
970+#: report:riba.order:0
971+msgid "Bank Account"
972+msgstr ""
973+
974+#. module: riba_issue
975+#: view:riba.line:0
976+#: view:riba.order:0
977+msgid "Entry Information"
978+msgstr ""
979+
980+#. module: riba_issue
981+#: model:ir.model,name:riba_issue.model_riba_order_create
982+msgid "riba.order.create"
983+msgstr ""
984+
985+#. module: riba_issue
986+#: field:riba.line,order_id:0
987+msgid "Order"
988+msgstr ""
989+
990+#. module: riba_issue
991+#: field:riba.order,total:0
992+msgid "Total"
993+msgstr ""
994+
995+#. module: riba_issue
996+#: field:riba.line,partner_id:0
997+#: report:riba.order:0
998+msgid "Partner"
999+msgstr ""
1000+
1001+#. module: riba_issue
1002+#: model:ir.actions.act_window,name:riba_issue.action_create_riba_order
1003+msgid "Populate RiBa"
1004+msgstr ""
1005+
1006+#. module: riba_issue
1007+#: help:riba.mode,bank_id:0
1008+msgid "Bank Account for the Riba Mode"
1009+msgstr ""
1010
1011=== added file 'l10n_it_ri_ba/i18n/riba_issue.pot'
1012--- l10n_it_ri_ba/i18n/riba_issue.pot 1970-01-01 00:00:00 +0000
1013+++ l10n_it_ri_ba/i18n/riba_issue.pot 2012-01-03 08:07:26 +0000
1014@@ -0,0 +1,545 @@
1015+# Translation of OpenERP Server.
1016+# This file contains the translation of the following modules:
1017+# * riba_issue
1018+#
1019+msgid ""
1020+msgstr ""
1021+"Project-Id-Version: OpenERP Server 6.0.0-rc2\n"
1022+"Report-Msgid-Bugs-To: support@openerp.com\n"
1023+"POT-Creation-Date: 2011-01-11 11:14:33+0000\n"
1024+"PO-Revision-Date: 2011-01-11 11:14:33+0000\n"
1025+"Last-Translator: <>\n"
1026+"Language-Team: \n"
1027+"MIME-Version: 1.0\n"
1028+"Content-Type: text/plain; charset=UTF-8\n"
1029+"Content-Transfer-Encoding: \n"
1030+"Plural-Forms: \n"
1031+
1032+#. module: riba_issue
1033+#: field:riba.order,date_scheduled:0
1034+msgid "Scheduled date if fixed"
1035+msgstr ""
1036+
1037+#. module: riba_issue
1038+#: field:riba.line,currency:0
1039+msgid "Partner Currency"
1040+msgstr ""
1041+
1042+#. module: riba_issue
1043+#: help:riba.order,mode:0
1044+msgid "Select the Riba Mode to be applied."
1045+msgstr ""
1046+
1047+#. module: riba_issue
1048+#: view:riba.mode:0
1049+#: view:riba.order:0
1050+msgid "Group By..."
1051+msgstr ""
1052+
1053+#. module: riba_issue
1054+#: field:riba.order,line_ids:0
1055+msgid "Riba lines"
1056+msgstr ""
1057+
1058+#. module: riba_issue
1059+#: view:riba.line:0
1060+#: field:riba.line,info_owner:0
1061+#: view:riba.order:0
1062+msgid "Owner Account"
1063+msgstr ""
1064+
1065+#. module: riba_issue
1066+#: help:riba.order,state:0
1067+msgid "When an order is placed the state is 'Draft'.\n"
1068+" Once the bank is confirmed the state is set to 'Confirmed'.\n"
1069+" Then the order is paid the state is 'Done'."
1070+msgstr ""
1071+
1072+#. module: riba_issue
1073+#: field:riba.mode,company_id:0
1074+msgid "Company"
1075+msgstr ""
1076+
1077+#. module: riba_issue
1078+#: field:riba.order,date_prefered:0
1079+msgid "Preferred date"
1080+msgstr ""
1081+
1082+#. module: riba_issue
1083+#: selection:riba.line,state:0
1084+msgid "Free"
1085+msgstr ""
1086+
1087+#. module: riba_issue
1088+#: field:riba.order.create,entries:0
1089+msgid "Entries"
1090+msgstr ""
1091+
1092+#. module: riba_issue
1093+#: field:riba.line,ml_maturity_date:0
1094+#: field:riba.order.create,duedate:0
1095+msgid "Due Date"
1096+msgstr ""
1097+
1098+
1099+#. module: riba_issue
1100+#: view:riba.order.create:0
1101+msgid "_Add to Riba Order"
1102+msgstr ""
1103+
1104+#. module: riba_issue
1105+#: report:riba.order:0
1106+#: view:riba.order:0
1107+msgid "Amount"
1108+msgstr ""
1109+
1110+#. module: riba_issue
1111+#: view:riba.order:0
1112+msgid "Total in Company Currency"
1113+msgstr ""
1114+
1115+#. module: riba_issue
1116+#: selection:riba.order,state:0
1117+msgid "Cancelled"
1118+msgstr ""
1119+
1120+#. module: riba_issue
1121+#: model:ir.actions.act_window,name:riba_issue.action_riba_order_tree_new
1122+msgid "New Riba Order"
1123+msgstr ""
1124+
1125+#. module: riba_issue
1126+#: report:riba.order:0
1127+#: field:riba.order,reference:0
1128+msgid "Reference"
1129+msgstr ""
1130+
1131+#. module: riba_issue
1132+#: sql_constraint:riba.line:0
1133+msgid "The riba line name must be unique!"
1134+msgstr ""
1135+
1136+#. module: riba_issue
1137+#: model:ir.actions.act_window,name:riba_issue.action_riba_order_tree
1138+#: model:ir.ui.menu,name:riba_issue.menu_action_riba_order_form
1139+msgid "Riba Orders"
1140+msgstr ""
1141+
1142+#. module: riba_issue
1143+#: selection:riba.order,date_prefered:0
1144+msgid "Directly"
1145+msgstr ""
1146+
1147+#. module: riba_issue
1148+#: model:ir.actions.act_window,name:riba_issue.action_riba_line_form
1149+#: model:ir.model,name:riba_issue.model_riba_line
1150+#: view:riba.line:0
1151+#: view:riba.order:0
1152+msgid "Riba Line"
1153+msgstr ""
1154+
1155+#. module: riba_issue
1156+#: view:riba.line:0
1157+msgid "Amount Total"
1158+msgstr ""
1159+
1160+#. module: riba_issue
1161+#: view:riba.order:0
1162+#: selection:riba.order,state:0
1163+msgid "Confirmed"
1164+msgstr ""
1165+
1166+#. module: riba_issue
1167+#: help:riba.line,ml_date_created:0
1168+msgid "Invoice Effective Date"
1169+msgstr ""
1170+
1171+#. module: riba_issue
1172+#: report:riba.order:0
1173+msgid "Execution Type"
1174+msgstr ""
1175+
1176+#. module: riba_issue
1177+#: selection:riba.line,state:0
1178+msgid "Structured"
1179+msgstr ""
1180+
1181+#. module: riba_issue
1182+#: view:riba.order:0
1183+#: field:riba.order,state:0
1184+msgid "State"
1185+msgstr ""
1186+
1187+#. module: riba_issue
1188+#: view:riba.line:0
1189+#: view:riba.order:0
1190+msgid "Transaction Information"
1191+msgstr ""
1192+
1193+#. module: riba_issue
1194+#: model:ir.actions.act_window,name:riba_issue.action_riba_mode_form
1195+#: model:ir.model,name:riba_issue.riba_mode
1196+#: model:ir.ui.menu,name:riba_issue.menu_action_riba_mode_form
1197+#: view:riba.mode:0
1198+#: view:riba.order:0
1199+msgid "Riba Mode"
1200+msgstr ""
1201+
1202+#. module: riba_issue
1203+#: field:riba.line,ml_date_created:0
1204+msgid "Effective Date"
1205+msgstr ""
1206+
1207+#. module: riba_issue
1208+#: field:riba.line,ml_inv_ref:0
1209+msgid "Invoice Ref."
1210+msgstr ""
1211+
1212+#. module: riba_issue
1213+#: help:riba.order,date_prefered:0
1214+msgid "Choose an option for the Riba Order:'Fixed' stands for a date specified by you.'Directly' stands for the direct execution.'Due date' stands for the scheduled date of execution."
1215+msgstr ""
1216+
1217+#. module: riba_issue
1218+#: code:addons/riba_issue/account_move_line.py:110
1219+#, python-format
1220+msgid "Error !"
1221+msgstr ""
1222+
1223+#. module: riba_issue
1224+#: field:riba.order,date_done:0
1225+msgid "Execution date"
1226+msgstr ""
1227+
1228+#. module: riba_issue
1229+#: help:riba.mode,journal:0
1230+msgid "Bank Journal for the Mode RiBa"
1231+msgstr ""
1232+
1233+#. module: riba_issue
1234+#: selection:riba.order,date_prefered:0
1235+msgid "Fixed date"
1236+msgstr ""
1237+
1238+#. module: riba_issue
1239+#: field:riba.line,info_partner:0
1240+#: view:riba.order:0
1241+msgid "Destination Account"
1242+msgstr ""
1243+
1244+#. module: riba_issue
1245+#: view:riba.line:0
1246+msgid "Destination Account"
1247+msgstr ""
1248+
1249+#. module: riba_issue
1250+#: view:riba.order:0
1251+msgid "Search Riba Orders"
1252+msgstr ""
1253+
1254+#. module: riba_issue
1255+#: field:riba.line,create_date:0
1256+msgid "Created"
1257+msgstr ""
1258+
1259+#. module: riba_issue
1260+#: view:riba.line:0
1261+msgid "Currency Amount Total"
1262+msgstr ""
1263+
1264+#. module: riba_issue
1265+#: view:riba.order:0
1266+msgid "Make Issue"
1267+msgstr ""
1268+
1269+#. module: riba_issue
1270+#: field:riba.line,state:0
1271+msgid "Communication Type"
1272+msgstr ""
1273+
1274+#. module: riba_issue
1275+#: selection:riba.order,date_prefered:0
1276+msgid "Due date"
1277+msgstr ""
1278+
1279+#. module: riba_issue
1280+#: report:riba.order:0
1281+msgid "Currency"
1282+msgstr ""
1283+
1284+#. module: riba_issue
1285+#: view:riba.issue.make.payment:0
1286+msgid "Yes"
1287+msgstr ""
1288+
1289+#. module: riba_issue
1290+#: help:riba.line,info_owner:0
1291+msgid "Address of the Main Partner"
1292+msgstr ""
1293+
1294+#. module: riba_issue
1295+#: help:riba.line,date:0
1296+msgid "If no payment date is specified, the bank will treat this riba line directly"
1297+msgstr ""
1298+
1299+#. module: riba_issue
1300+#: help:riba.mode,name:0
1301+msgid "Bank of Presentacion"
1302+msgstr ""
1303+
1304+#. module: riba_issue
1305+#: report:riba.order:0
1306+msgid "Value Date"
1307+msgstr ""
1308+
1309+
1310+#. module: riba_issue
1311+#: help:riba.line,amount_currency:0
1312+msgid "Payment amount in the partner currency"
1313+msgstr ""
1314+
1315+#. module: riba_issue
1316+#: view:riba.order:0
1317+#: selection:riba.order,state:0
1318+msgid "Draft"
1319+msgstr ""
1320+
1321+#. module: riba_issue
1322+#: help:riba.line,communication2:0
1323+msgid "The successor message of Communication."
1324+msgstr ""
1325+
1326+#. module: riba_issue
1327+#: help:riba.line,info_partner:0
1328+msgid "Address of the Customer."
1329+msgstr ""
1330+
1331+#. module: riba_issue
1332+#: help:riba.order,date_scheduled:0
1333+msgid "Select a date if you have chosen Preferred Date to be fixed."
1334+msgstr ""
1335+
1336+#. module: riba_issue
1337+#: field:riba.order,user_id:0
1338+msgid "User"
1339+msgstr ""
1340+
1341+#. module: riba_issue
1342+#: model:ir.model,name:riba_issue.model_account_move_line
1343+msgid "Journal Items"
1344+msgstr ""
1345+
1346+#. module: riba_issue
1347+#: constraint:account.move.line:0
1348+msgid "Company must be same for its related account and period."
1349+msgstr ""
1350+
1351+#. module: riba_issue
1352+#: help:riba.line,move_line_id:0
1353+msgid "This Entry Line will be referred for the information of the ordering customer."
1354+msgstr ""
1355+
1356+#. module: riba_issue
1357+#: view:riba.order.create:0
1358+msgid "Search"
1359+msgstr ""
1360+
1361+#. module: riba_issue
1362+#: model:ir.actions.report.xml,name:riba_issue.riba_order1
1363+#: model:ir.model,name:riba_issue.riba_order
1364+msgid "Riba Order"
1365+msgstr ""
1366+
1367+#. module: riba_issue
1368+#: field:riba.line,date:0
1369+msgid "Date"
1370+msgstr ""
1371+
1372+#. module: riba_issue
1373+#: report:riba.order:0
1374+msgid "Total:"
1375+msgstr ""
1376+
1377+#. module: riba_issue
1378+#: field:riba.order,date_created:0
1379+msgid "Creation date"
1380+msgstr ""
1381+
1382+#. module: riba_issue
1383+#: field:riba.line,amount:0
1384+msgid "Amount in Company Currency"
1385+msgstr ""
1386+
1387+#. module: riba_issue
1388+#: help:riba.line,partner_id:0
1389+msgid "The Ordering Customer"
1390+msgstr ""
1391+
1392+#. module: riba_issue
1393+#: report:riba.order:0
1394+msgid "Invoice Ref"
1395+msgstr ""
1396+
1397+#. module: riba_issue
1398+#: field:riba.line,name:0
1399+msgid "Your Reference"
1400+msgstr ""
1401+
1402+#. module: riba_issue
1403+#: field:riba.order,mode:0
1404+msgid "riba mode"
1405+msgstr ""
1406+
1407+#. module: riba_issue
1408+#: view:riba.order:0
1409+msgid "riba order"
1410+msgstr ""
1411+
1412+#. module: riba_issue
1413+#: view:riba.line:0
1414+#: view:riba.order:0
1415+msgid "General Information"
1416+msgstr ""
1417+
1418+#. module: riba_issue
1419+#: view:riba.order:0
1420+#: selection:riba.order,state:0
1421+msgid "Done"
1422+msgstr ""
1423+
1424+#. module: riba_issue
1425+#: model:ir.model,name:riba_issue.account_invoice
1426+msgid "Invoice"
1427+msgstr ""
1428+
1429+#. module: riba_issue
1430+#: field:riba.line,communication:0
1431+msgid "Communication"
1432+msgstr ""
1433+
1434+#. module: riba_issue
1435+#: view:riba.issue.make.payment:0
1436+#: view:riba.order:0
1437+#: view:riba.order.create:0
1438+msgid "Cancel"
1439+msgstr ""
1440+
1441+#. module: riba_issue
1442+#: view:riba.line:0
1443+#: view:riba.order:0
1444+msgid "Information"
1445+msgstr ""
1446+
1447+#. module: riba_issue
1448+#: model:ir.actions.act_window,help:riba_issue.action_riba_order_tree
1449+msgid "A riba order is a issue request from your company to pay a custumer invoice or a customer debit note. Here you can register all riba orders that should be done, keep track of all riba orders and mention the invoice reference and the partner the riba should be done for."
1450+msgstr ""
1451+
1452+#. module: riba_issue
1453+#: help:riba.line,amount:0
1454+msgid "riba amount in the company currency"
1455+msgstr ""
1456+
1457+#. module: riba_issue
1458+#: view:riba.order.create:0
1459+msgid "Search riba lines"
1460+msgstr ""
1461+
1462+#. module: riba_issue
1463+#: field:riba.line,amount_currency:0
1464+msgid "Amount in Partner Currency"
1465+msgstr ""
1466+
1467+#. module: riba_issue
1468+#: field:riba.line,communication2:0
1469+msgid "Communication 2"
1470+msgstr ""
1471+
1472+#. module: riba_issue
1473+#: field:riba.line,bank_id:0
1474+msgid "Debitor Bank"
1475+msgstr ""
1476+
1477+#. module: riba_issue
1478+#: view:account.riba.make.riba:0
1479+msgid "Are you sure you want to make Issue RiBa?"
1480+msgstr ""
1481+
1482+#. module: riba_issue
1483+#: view:riba.mode:0
1484+#: field:riba.mode,journal:0
1485+msgid "Journal"
1486+msgstr ""
1487+
1488+#. module: riba_issue
1489+#: field:riba.mode,bank_id:0
1490+msgid "Bank account"
1491+msgstr ""
1492+
1493+#. module: riba_issue
1494+#: view:riba.order:0
1495+msgid "Confirm Issue"
1496+msgstr ""
1497+
1498+#. module: riba_issue
1499+#: field:riba.line,company_currency:0
1500+#: report:riba.order:0
1501+msgid "Company Currency"
1502+msgstr ""
1503+
1504+#. module: riba_issue
1505+#: field:riba.line,move_line_id:0
1506+msgid "Entry line"
1507+msgstr ""
1508+
1509+#. module: riba_issue
1510+#: help:riba.line,communication:0
1511+msgid "Used as the message between ordering customer and current company. Depicts 'What do you want to say to the recipient about this order?'"
1512+msgstr ""
1513+
1514+#. module: riba_issue
1515+#: field:riba.mode,name:0
1516+msgid "Name"
1517+msgstr ""
1518+
1519+#. module: riba_issue
1520+#: report:riba.order:0
1521+msgid "Bank Account"
1522+msgstr ""
1523+
1524+#. module: riba_issue
1525+#: view:riba.line:0
1526+#: view:riba.order:0
1527+msgid "Entry Information"
1528+msgstr ""
1529+
1530+#. module: riba_issue
1531+#: model:ir.model,name:riba_issue.model_riba_order_create
1532+msgid "riba.order.create"
1533+msgstr ""
1534+
1535+#. module: riba_issue
1536+#: field:riba.line,order_id:0
1537+msgid "Order"
1538+msgstr ""
1539+
1540+#. module: riba_issue
1541+#: field:riba.order,total:0
1542+msgid "Total"
1543+msgstr ""
1544+
1545+#. module: riba_issue
1546+#: field:riba.line,partner_id:0
1547+#: report:riba.order:0
1548+msgid "Partner"
1549+msgstr ""
1550+
1551+#. module: riba_issue
1552+#: model:ir.actions.act_window,name:riba_issue.action_create_riba_order
1553+msgid "Populate RiBa"
1554+msgstr ""
1555+
1556+#. module: riba_issue
1557+#: help:riba.mode,bank_id:0
1558+msgid "Bank Account for the Riba Mode"
1559+msgstr ""
1560
1561=== added directory 'l10n_it_ri_ba/report'
1562=== added file 'l10n_it_ri_ba/report/__init__.py'
1563--- l10n_it_ri_ba/report/__init__.py 1970-01-01 00:00:00 +0000
1564+++ l10n_it_ri_ba/report/__init__.py 2012-01-03 08:07:26 +0000
1565@@ -0,0 +1,25 @@
1566+# -*- coding: utf-8 -*-
1567+##############################################################################
1568+#
1569+# Copyright (C) 2011 Associazione OpenERP Italia
1570+# (<http://www.openerp-italia.org>).
1571+# All Rights Reserved
1572+# Thanks to Cecchi s.r.l http://www.cecchi.com/
1573+#
1574+# This program is free software: you can redistribute it and/or modify
1575+# it under the terms of the GNU Affero General Public License as published by
1576+# the Free Software Foundation, either version 3 of the License, or
1577+# (at your option) any later version.
1578+#
1579+# This program is distributed in the hope that it will be useful,
1580+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1581+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1582+# GNU General Public License for more details.
1583+#
1584+# You should have received a copy of the GNU Affero General Public License
1585+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1586+#
1587+##############################################################################
1588+
1589+import riba_order
1590+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1591
1592=== added file 'l10n_it_ri_ba/report/order.mako'
1593--- l10n_it_ri_ba/report/order.mako 1970-01-01 00:00:00 +0000
1594+++ l10n_it_ri_ba/report/order.mako 2012-01-03 08:07:26 +0000
1595@@ -0,0 +1,49 @@
1596+<html>
1597+<head>
1598+ <style type="text/css">
1599+ ${css}
1600+ </style>
1601+</head>
1602+<body>
1603+ %for ord in objects:
1604+ <% setLang(ord.company_id.partner_id.lang) %>
1605+ <table class="dest_address">
1606+ <tr>
1607+ <td>
1608+ <p align="right">
1609+ ${_("Distinta incassi Ricevute bancarie ")}${_("Num: ")} ${ord.reference or ''}</br>
1610+ ${_("Presentata il: ")}${formatLang(ord.date_created, date=True)}</br>
1611+ ${_("a: ")}&#160;<b>${ord.mode.bank_id.bank.name or ''}</b></br>
1612+ </p>
1613+ </td>
1614+ </tr>
1615+ </table>
1616+ <table class="basic_collapse" width="100%">
1617+ <tr class="basic_top"><th>${_("N.Eff. Cliente/Debitore")}</th><th>${_("Domicilio")}</th><th>${_("Num e Data Doc")}</th><th>${_("Scadenza")}</th><th>${_("Valuta")}</th><th>${_("Importo")}</th></tr>
1618+ <% abi_text = '' %>
1619+ <% cab_text = '' %>
1620+ %for line in ord.line_ids:
1621+ %if line.bank_id.iban is None:
1622+ <%
1623+ abi_text = 'ABI'
1624+ cab_text = 'CAB'
1625+ %>
1626+ %else:
1627+ <%
1628+ abi_text = 'ABI ' + line.bank_id.iban[5:10]
1629+ cab_text = 'CAB ' + line.bank_id.iban[10:15]
1630+ %>
1631+ %endif
1632+ <tr class="basic_top"><td>${line.name or ''}&#160;&#160; ${line.partner_id.name or ''}</td><td>${abi_text or ''}&#160;&#160;${cab_text or ''}</td><td>${line.move_line_id.move_id.name or ''}&#160;&#160;${formatLang(line.move_line_id.move_id.date, date=True) or ''}</td><td>${formatLang(line.date, date=True) or ''}</td><td>${line.company_id.currency_id.name or ''}</td><td style="text-align:right">${formatLang(line.amount_currency) or ''}</td></tr>
1633+
1634+ %endfor
1635+ <tr class="basic_bottom"><td colspan="5"></td></tr>
1636+
1637+ <tbody>
1638+ <tr><td colspan="5">${_("Distinta incassi Ricevute bancarie")}&#160;&#160;${_("Num: ")} ${ord.reference or ''}</td><td style="text-align:right;">${formatLang(ord.total or '')}</td></tr>
1639+ </tbody>
1640+ </table>
1641+ <p style="page-break-after:always"></p>
1642+ %endfor
1643+</body>
1644+</html>
1645
1646=== added file 'l10n_it_ri_ba/report/riba_order.py'
1647--- l10n_it_ri_ba/report/riba_order.py 1970-01-01 00:00:00 +0000
1648+++ l10n_it_ri_ba/report/riba_order.py 2012-01-03 08:07:26 +0000
1649@@ -0,0 +1,46 @@
1650+# -*- coding: utf-8 -*-
1651+##############################################################################
1652+#
1653+# Copyright (C) 2011 Associazione OpenERP Italia
1654+# (<http://www.openerp-italia.org>).
1655+# All Rights Reserved
1656+# Thanks to Cecchi s.r.l http://www.cecchi.com/
1657+#
1658+# This program is free software: you can redistribute it and/or modify
1659+# it under the terms of the GNU Affero General Public License as published by
1660+# the Free Software Foundation, either version 3 of the License, or
1661+# (at your option) any later version.
1662+#
1663+# This program is distributed in the hope that it will be useful,
1664+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1665+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1666+# GNU General Public License for more details.
1667+#
1668+# You should have received a copy of the GNU Affero General Public License
1669+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1670+#
1671+##############################################################################
1672+
1673+import time
1674+from report import report_sxw
1675+from osv import osv
1676+from tools.translate import _
1677+from decimal import *
1678+
1679+
1680+class riba_order(report_sxw.rml_parse):
1681+
1682+
1683+ def __init__(self, cr, uid, name, context):
1684+ super(riba_order, self).__init__(cr, uid, name, context=context)
1685+ self.localcontext.update({
1686+ 'time': time,
1687+ 'cr': cr,
1688+ 'uid': uid,
1689+
1690+ })
1691+
1692+
1693+report_sxw.report_sxw('report.riba.order', 'riba.order', 'addons/l10n_it_ri_ba/report/order.mako', parser=riba_order)
1694+
1695+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1696
1697=== added file 'l10n_it_ri_ba/riba_issue.py'
1698--- l10n_it_ri_ba/riba_issue.py 1970-01-01 00:00:00 +0000
1699+++ l10n_it_ri_ba/riba_issue.py 2012-01-03 08:07:26 +0000
1700@@ -0,0 +1,522 @@
1701+# -*- coding: utf-8 -*-
1702+##############################################################################
1703+#
1704+# Copyright (C) 2011 Associazione OpenERP Italia
1705+# (<http://www.openerp-italia.org>).
1706+# All Rights Reserved
1707+# Thanks to Cecchi s.r.l http://www.cecchi.com/
1708+#
1709+# This program is free software: you can redistribute it and/or modify
1710+# it under the terms of the GNU Affero General Public License as published by
1711+# the Free Software Foundation, either version 3 of the License, or
1712+# (at your option) any later version.
1713+#
1714+# This program is distributed in the hope that it will be useful,
1715+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1716+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1717+# GNU General Public License for more details.
1718+#
1719+# You should have received a copy of the GNU Affero General Public License
1720+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1721+#
1722+##############################################################################
1723+
1724+import time
1725+
1726+from osv import osv, fields
1727+import netsvc
1728+from tools.translate import _
1729+import datetime
1730+
1731+
1732+
1733+class riba_mode(osv.osv):
1734+ _name= 'riba.mode'
1735+ _description= 'Presentacion Bank'
1736+ _columns = {
1737+ 'name': fields.char('Bank of Presentacion', size=64, required=True, help='Banca di Presentazione'),
1738+ 'bank_id': fields.many2one('res.partner.bank', "Bank Account for the Riba Mode",
1739+ required=True,help='Presentacion bank account for the RiBa'),
1740+ 'journal': fields.many2one('account.journal', 'Journal', required=True,
1741+ domain=[('type', '=', 'bank')], help='Bank Journal for the Mode RiBa'),
1742+ 'company_id': fields.many2one('res.company', 'Company',required=True),
1743+ 'partner_id':fields.related('company_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True,),
1744+
1745+ }
1746+ _defaults = {
1747+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id
1748+ }
1749+
1750+ def suitable_bank_types(self, cr, uid, payment_code=None, context=None):
1751+ """Return the codes of the bank type that are suitable
1752+ for the given payment type code"""
1753+ """ID's Creditor Banks"""
1754+ if not payment_code:
1755+ return []
1756+ cr.execute(""" SELECT pb.state
1757+ FROM res_partner_bank pb
1758+ JOIN riba_mode rm ON (rm.bank_id = pb.id)
1759+ WHERE rm.id = %s """, [payment_code])
1760+ return [x[0] for x in cr.fetchall()]
1761+
1762+ def onchange_company_id (self, cr, uid, ids, company_id=False, context=None):
1763+ result = {}
1764+ if company_id:
1765+ partner_id = self.pool.get('res.company').browse(cr, uid, company_id, context=context).partner_id.id
1766+ result['partner_id'] = partner_id
1767+ return {'value': result}
1768+
1769+
1770+riba_mode()
1771+
1772+class riba_order(osv.osv):
1773+ _name = 'riba.order'
1774+ _description = 'Riba Order'
1775+ _rec_name = 'reference'
1776+
1777+ def get_wizard(self, type):
1778+ logger = netsvc.Logger()
1779+ logger.notifyChannel("warning", netsvc.LOG_WARNING,
1780+ "No wizard found for the RiBa type '%s'." % type)
1781+ return None
1782+
1783+ def _total(self, cursor, user, ids, name, args, context=None):
1784+ if not ids:
1785+ return {}
1786+ res = {}
1787+ for order in self.browse(cursor, user, ids, context=context):
1788+ if order.line_ids:
1789+ res[order.id] = reduce(lambda x, y: x + y.amount, order.line_ids, 0.0)
1790+ else:
1791+ res[order.id] = 0.0
1792+ return res
1793+
1794+ _columns = {
1795+ 'date_scheduled': fields.date('Scheduled date if fixed', states={'done':[('readonly', True)]}, help='Select a date if you have chosen Preferred Date to be fixed.'),
1796+ 'reference': fields.char('Reference', size=128, required=1, states={'done': [('readonly', True)]}),
1797+ 'mode': fields.many2one('riba.mode', 'Riba mode', select=True, required=1, states={'done': [('readonly', True)]}, help='Select the Riba Mode to be applied.'),
1798+ 'state': fields.selection([
1799+ ('draft', 'Draft'),
1800+ ('open', 'Confirmed'),
1801+ ('cancel', 'Cancelled'),
1802+ ('done', 'Done')], 'State', select=True,
1803+ help='When an order is placed the state is \'Draft\'.\n Once the bank is confirmed the state is set to \'Confirmed\'.\n Then the order is paid the state is \'Done\'.'),
1804+ 'line_ids': fields.one2many('riba.line', 'order_id', 'Riba lines', states={'done': [('readonly', True)]}),
1805+ 'total': fields.function(_total, string="Total", method=True, type='float'),
1806+ 'user_id': fields.many2one('res.users', 'User', required=True, states={'done': [('readonly', True)]}),
1807+ 'date_prefered': fields.selection([
1808+ ('now', 'Directly'),
1809+ ('due', 'Due date'),
1810+ ('fixed', 'Fixed date')
1811+ ], "Preferred date", change_default=True, required=True, states={'done': [('readonly', True)]}, help="Choose an option for the Riba Order:'Fixed' stands for a date specified by you.'Directly' stands for the direct execution.'Due date' stands for the scheduled date of execution."),
1812+ 'date_created': fields.date('Creation date', readonly=True),
1813+ 'date_done': fields.date('Execution date', readonly=True),
1814+ 'company_id': fields.related('mode', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
1815+ }
1816+
1817+ _defaults = {
1818+ 'user_id': lambda self,cr,uid,context: uid,
1819+ 'state': 'draft',
1820+ 'date_prefered': 'due',
1821+ 'date_created': lambda *a: time.strftime('%Y-%m-%d'),
1822+ 'reference': lambda self,cr,uid,context: self.pool.get('ir.sequence').get(cr, uid, 'riba.order'),
1823+ }
1824+
1825+ def set_to_draft(self, cr, uid, ids, *args):
1826+ self.write(cr, uid, ids, {'state': 'draft'})
1827+ wf_service = netsvc.LocalService("workflow")
1828+ for id in ids:
1829+ wf_service.trg_create(uid, 'riba.order', id, cr)
1830+ return True
1831+
1832+ def action_open(self, cr, uid, ids, *args):
1833+ ir_seq_obj = self.pool.get('ir.sequence')
1834+
1835+ for order in self.read(cr, uid, ids, ['reference']):
1836+ if not order['reference']:
1837+ reference = ir_seq_obj.get(cr, uid, 'riba.order')
1838+ self.write(cr, uid, order['id'], {'reference':reference})
1839+ return True
1840+
1841+ def set_done(self, cr, uid, ids, *args):
1842+ wf_service = netsvc.LocalService("workflow")
1843+ self.write(cr, uid, ids, {'date_done': time.strftime('%Y-%m-%d')})
1844+ wf_service.trg_validate(uid, 'riba.order', ids[0], 'done', cr)
1845+ return True
1846+
1847+ def copy(self, cr, uid, id, default={}, context=None):
1848+ default.update({
1849+ 'state': 'draft',
1850+ 'line_ids': [],
1851+ 'reference': self.pool.get('ir.sequence').get(cr, uid, 'riba.order')
1852+ })
1853+ return super(riba_order, self).copy(cr, uid, id, default, context=context)
1854+
1855+ def write(self, cr, uid, ids, vals, context=None):
1856+ if context is None:
1857+ context = {}
1858+ riba_line_obj = self.pool.get('riba.line')
1859+ riba_line_ids = []
1860+
1861+ if (vals.get('date_prefered', False) == 'fixed' and not vals.get('date_scheduled', False)) or vals.get('date_scheduled', False):
1862+ for order in self.browse(cr, uid, ids, context=context):
1863+ for line in order.line_ids:
1864+ riba_line_ids.append(line.id)
1865+ riba_line_obj.write(cr, uid, riba_line_ids, {'date': vals.get('date_scheduled', False)}, context=context)
1866+ elif vals.get('date_prefered', False) == 'due':
1867+ vals.update({'date_scheduled': False})
1868+ for order in self.browse(cr, uid, ids, context=context):
1869+ for line in order.line_ids:
1870+ riba_line_obj.write(cr, uid, [line.id], {'date': line.ml_maturity_date}, context=context)
1871+ elif vals.get('date_prefered', False) == 'now':
1872+ vals.update({'date_scheduled': False})
1873+ for order in self.browse(cr, uid, ids, context=context):
1874+ for line in order.line_ids:
1875+ riba_line_ids.append(line.id)
1876+ riba_line_obj.write(cr, uid, riba_line_ids, {'date': False}, context=context)
1877+ return super(riba_order, self).write(cr, uid, ids, vals, context=context)
1878+
1879+riba_order()
1880+
1881+class riba_line(osv.osv):
1882+ _name = 'riba.line'
1883+ _description = 'Riba Line'
1884+
1885+ def translate(self, orig):
1886+ return {
1887+ "due_date": "date_maturity",
1888+ "reference": "ref"}.get(orig, orig)
1889+
1890+ def info_owner(self, cr, uid, ids, name=None, args=None, context=None):
1891+ if not ids: return {}
1892+ partner_address_obj = self.pool.get('res.partner.address')
1893+
1894+ result = {}
1895+ info=''
1896+ for line in self.browse(cr, uid, ids, context=context):
1897+ owner = line.order_id.mode.bank_id.partner_id
1898+ result[line.id] = False
1899+ if owner.address:
1900+ for ads in owner.address:
1901+ if ads.type == 'default':
1902+ st = ads.street and ads.street or ''
1903+ st1 = ads.street2 and ads.street2 or ''
1904+ if 'zip_id' in ads:
1905+ zip_city = ads.zip_id and partner_address_obj.name_get(cr, uid, [ads.zip_id.id])[0][1] or ''
1906+ else:
1907+ zip = ads.zip and ads.zip or ''
1908+ city = ads.city and ads.city or ''
1909+ zip_city = zip + ' ' + city
1910+ cntry = ads.country_id and ads.country_id.name or ''
1911+ info = owner.name + "\n" + st + " " + st1 + "\n" + zip_city + "\n" +cntry
1912+ result[line.id] = info
1913+ break
1914+ return result
1915+
1916+ def info_partner(self, cr, uid, ids, name=None, args=None, context=None):
1917+ if not ids: return {}
1918+ partner_address_obj = self.pool.get('res.partner.address')
1919+ result = {}
1920+ info = ''
1921+
1922+ for line in self.browse(cr, uid, ids, context=context):
1923+ result[line.id] = False
1924+ if not line.partner_id:
1925+ break
1926+ partner = line.partner_id.name or ''
1927+ if line.partner_id.address:
1928+ for ads in line.partner_id.address:
1929+ if ads.type == 'default':
1930+ st = ads.street and ads.street or ''
1931+ st1 = ads.street2 and ads.street2 or ''
1932+ if 'zip_id' in ads:
1933+ zip_city = ads.zip_id and partner_address_obj.name_get(cr, uid, [ads.zip_id.id])[0][1] or ''
1934+ else:
1935+ zip = ads.zip and ads.zip or ''
1936+ city = ads.city and ads.city or ''
1937+ zip_city = zip + ' ' + city
1938+ cntry = ads.country_id and ads.country_id.name or ''
1939+ info = partner + "\n" + st + " " + st1 + "\n" + zip_city + "\n" +cntry
1940+ result[line.id] = info
1941+ break
1942+ return result
1943+
1944+
1945+ def s_bank_types(self, cr, uid, payment_code=None, context=None):
1946+ """Return the codes of the bank type that are suitable
1947+ for the given bank payment of riba line"""
1948+ """ID's Debitor's Banks"""
1949+ if not payment_code:
1950+ return []
1951+ cr.execute(""" SELECT pb.name
1952+ FROM res_partner_bank pb
1953+ JOIN riba_line rl ON (rl.bank_id = pb.id)
1954+ WHERE rl.id = %s """, [payment_code])
1955+ return [x[0] for x in cr.fetchall()]
1956+
1957+ def select_by_name(self, cr, uid, ids, name, args, context=None):
1958+ if not ids: return {}
1959+ partner_obj = self.pool.get('res.partner')
1960+
1961+ cr.execute("""SELECT rl.id, ml.%s
1962+ FROM account_move_line ml
1963+ INNER JOIN riba_line rl
1964+ ON (ml.id = rl.move_line_id)
1965+ WHERE rl.id IN %%s"""% self.translate(name),
1966+ (tuple(ids),))
1967+ res = dict(cr.fetchall())
1968+
1969+ if name == 'partner_id':
1970+ partner_name = {}
1971+ for p_id, p_name in partner_obj.name_get(cr, uid,
1972+ filter(lambda x:x and x != 0,res.values()), context=context):
1973+ partner_name[p_id] = p_name
1974+
1975+ for id in ids:
1976+ if id in res and partner_name:
1977+ res[id] = (res[id],partner_name[res[id]])
1978+ else:
1979+ res[id] = (False,False)
1980+ else:
1981+ for id in ids:
1982+ res.setdefault(id, (False, ""))
1983+ return res
1984+
1985+ def _amount(self, cursor, user, ids, name, args, context=None):
1986+ if not ids:
1987+ return {}
1988+ currency_obj = self.pool.get('res.currency')
1989+ if context is None:
1990+ context = {}
1991+ res = {}
1992+
1993+ for line in self.browse(cursor, user, ids, context=context):
1994+ ctx = context.copy()
1995+ ctx['date'] = line.order_id.date_done or time.strftime('%Y-%m-%d')
1996+ res[line.id] = currency_obj.compute(cursor, user, line.currency.id,
1997+ line.company_currency.id,
1998+ line.amount_currency, context=ctx)
1999+ return res
2000+
2001+ def _get_currency(self, cr, uid, context=None):
2002+ user_obj = self.pool.get('res.users')
2003+ currency_obj = self.pool.get('res.currency')
2004+ user = user_obj.browse(cr, uid, uid, context=context)
2005+
2006+ if user.company_id:
2007+ return user.company_id.currency_id.id
2008+ else:
2009+ return currency_obj.search(cr, uid, [('rate', '=', 1.0)])[0]
2010+
2011+ def _get_date(self, cr, uid, context=None):
2012+ if context is None:
2013+ context = {}
2014+ riba_order_obj = self.pool.get('riba.order')
2015+ date = False
2016+
2017+ if context.get('order_id') and context['order_id']:
2018+ order = riba_order_obj.browse(cr, uid, context['order_id'], context=context)
2019+ if order.date_prefered == 'fixed':
2020+ date = order.date_scheduled
2021+ else:
2022+ date = time.strftime('%Y-%m-%d')
2023+ return date
2024+
2025+ def _get_ml_inv_ref(self, cr, uid, ids, *a):
2026+ res = {}
2027+ for id in self.browse(cr, uid, ids):
2028+ res[id.id] = False
2029+ if id.move_line_id:
2030+ if id.move_line_id.invoice:
2031+ res[id.id] = id.move_line_id.invoice.id
2032+ return res
2033+
2034+ def _get_ml_maturity_date(self, cr, uid, ids, *a):
2035+ res = {}
2036+ for id in self.browse(cr, uid, ids):
2037+ if id.move_line_id:
2038+ res[id.id] = id.move_line_id.date_maturity
2039+ else:
2040+ res[id.id] = False
2041+ return res
2042+
2043+ def _get_ml_created_date(self, cr, uid, ids, *a):
2044+ res = {}
2045+ for id in self.browse(cr, uid, ids):
2046+ if id.move_line_id:
2047+ res[id.id] = id.move_line_id.date_created
2048+ else:
2049+ res[id.id] = False
2050+ return res
2051+
2052+ _columns = {
2053+ 'name': fields.char('Your Reference', size=64),
2054+ 'communication': fields.char('Communication', size=64, required=True, help="Used as the message between ordering customer and current company. Depicts 'What do you want to say to the recipient about this order?'"),
2055+ 'communication2': fields.char('Communication 2', size=64, help='The successor message of Communication.'),
2056+ 'move_line_id': fields.many2one('account.move.line', 'Entry line', domain=[('account_id.type', '=', 'receivable'), ('account_id.type', '=', 'receivable')], help='This Entry Line will be referred for the information of the ordering customer.'),
2057+ 'amount_currency': fields.float('Amount in Partner Currency', digits=(16, 2),
2058+ required=True, help='Payment amount in the partner currency'),
2059+ 'currency': fields.many2one('res.currency','Partner Currency'),
2060+ 'company_currency': fields.many2one('res.currency', 'Company Currency', readonly=True),
2061+ 'bank_id': fields.many2one('res.partner.bank', 'Debitor Bank'),
2062+ 'order_id': fields.many2one('riba.order', 'Order', required=True,
2063+ ondelete='cascade', select=True),
2064+ 'partner_id': fields.many2one('res.partner', string="Partner", required=True, help='The Ordering Customer'),
2065+ 'amount': fields.function(_amount, string='Amount in Company Currency',
2066+ method=True, type='float',
2067+ help='Payment amount in the company currency'),
2068+ 'ml_date_created': fields.function(_get_ml_created_date, string="Effective Date",
2069+ method=True, type='date', help="Invoice Effective Date"),
2070+ 'ml_maturity_date': fields.function(_get_ml_maturity_date, method=True, type='date', string='Due Date'),
2071+ 'ml_inv_ref': fields.function(_get_ml_inv_ref, method=True, type='many2one', relation='account.invoice', string='Invoice Ref.'),
2072+ 'info_owner': fields.function(info_owner, string="Owner Account", method=True, type="text", help='Address of the Main Partner'),
2073+ 'info_partner': fields.function(info_partner, string="Destination Account", method=True, type="text", help='Address of the Customer.'),
2074+ 'date': fields.date('Payment Date', help="If no payment date is specified, the bank will treat this riba line directly"),
2075+ 'create_date': fields.datetime('Created', readonly=True),
2076+ 'state': fields.selection([('normal','Free'), ('structured','Structured')], 'Communication Type', required=True),
2077+ 'company_id': fields.related('order_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
2078+ }
2079+ _defaults = {
2080+ 'name': lambda obj, cursor, user, context: obj.pool.get('ir.sequence'
2081+ ).get(cursor, user, 'riba.line'),
2082+ 'state': 'normal',
2083+ 'currency': _get_currency,
2084+ 'company_currency': _get_currency,
2085+ 'date': _get_date,
2086+ }
2087+ _sql_constraints = [
2088+ ('name_uniq', 'UNIQUE(name)', 'The riba line name must be unique!'),
2089+ ]
2090+
2091+ def onchange_move_line(self, cr, uid, ids, move_line_id, payment_type, date_prefered, date_scheduled, currency=False, company_currency=False, context=None):
2092+ data = {}
2093+ move_line_obj = self.pool.get('account.move.line')
2094+
2095+ data['amount_currency'] = data['communication'] = data['partner_id'] = data['reference'] = data['date_created'] = data['bank_id'] = data['amount'] = False
2096+
2097+ if move_line_id:
2098+ line = move_line_obj.browse(cr, uid, move_line_id, context=context)
2099+ data['amount_currency'] = line.riba_amount_to_pay
2100+
2101+ res = self.onchange_amount(cr, uid, ids, data['amount_currency'], currency,
2102+ company_currency, context)
2103+ if res:
2104+ data['amount'] = res['value']['amount']
2105+ data['partner_id'] = line.partner_id.id
2106+ temp = line.currency_id and line.currency_id.id or False
2107+ if not temp:
2108+ if line.invoice:
2109+ data['currency'] = line.invoice.currency_id.id
2110+ else:
2111+ data['currency'] = temp
2112+
2113+ # calling onchange of partner and updating data dictionary
2114+ temp_dict = self.onchange_partner(cr, uid, ids, line.partner_id.id, payment_type)
2115+ data.update(temp_dict['value'])
2116+
2117+ data['reference'] = line.ref
2118+ data['date_created'] = line.date_created
2119+ data['communication'] = line.ref
2120+
2121+ if date_prefered == 'now':
2122+ #no payment date => immediate payment
2123+ data['date'] = False
2124+ elif date_prefered == 'due':
2125+ data['date'] = line.date_maturity
2126+ elif date_prefered == 'fixed':
2127+ data['date'] = date_scheduled
2128+ return {'value': data}
2129+
2130+ def onchange_amount(self, cr, uid, ids, amount, currency, cmpny_currency, context=None):
2131+ if (not amount) or (not cmpny_currency):
2132+ return {'value': {'amount': False}}
2133+ res = {}
2134+ currency_obj = self.pool.get('res.currency')
2135+ company_amount = currency_obj.compute(cr, uid, currency, cmpny_currency, amount)
2136+ res['amount'] = company_amount
2137+ return {'value': res}
2138+
2139+ def onchange_partner(self, cr, uid, ids, partner_id, payment_type, context=None):
2140+ data = {}
2141+ partner_address_obj = self.pool.get('res.partner.address')
2142+ partner_obj = self.pool.get('res.partner')
2143+ data['info_partner'] = data['bank_id'] = False
2144+
2145+ if partner_id:
2146+ part_obj = partner_obj.browse(cr, uid, partner_id, context=context)
2147+ partner = part_obj.name or ''
2148+
2149+ if part_obj.address:
2150+ for ads in part_obj.address:
2151+ if ads.type == 'default':
2152+ st = ads.street and ads.street or ''
2153+ st1 = ads.street2 and ads.street2 or ''
2154+
2155+ if 'zip_id' in ads:
2156+ zip_city = ads.zip_id and partner_address_obj.name_get(cr, uid, [ads.zip_id.id])[0][1] or ''
2157+ else:
2158+ zip = ads.zip and ads.zip or ''
2159+ city = ads.city and ads.city or ''
2160+ zip_city = zip + ' ' + city
2161+
2162+ cntry = ads.country_id and ads.country_id.name or ''
2163+ info = partner + "\n" + st + " " + st1 + "\n" + zip_city + "\n" +cntry
2164+
2165+ data['info_partner'] = info
2166+
2167+ if part_obj.bank_ids and payment_type:
2168+ bank_type = self.s_bank_types(cr, uid, payment_type, context=context)
2169+ for bank in part_obj.bank_ids:
2170+ if bank.state in bank_type:
2171+ data['bank_id'] = bank.id
2172+ break
2173+ return {'value': data}
2174+
2175+ def fields_get(self, cr, uid, fields=None, context=None):
2176+ res = super(riba_line, self).fields_get(cr, uid, fields, context)
2177+ if 'communication2' in res:
2178+ res['communication2'].setdefault('states', {})
2179+ res['communication2']['states']['structured'] = [('readonly', True)]
2180+ res['communication2']['states']['normal'] = [('readonly', False)]
2181+ return res
2182+
2183+riba_line()
2184+
2185+class account_payment_term(osv.osv):
2186+ # This OpenERP object inherits from account_payment_term
2187+ # to add a new boolean field
2188+ _inherit = 'account.payment.term'
2189+ _columns = {
2190+ 'riba' : fields.boolean('Riba'),
2191+ }
2192+ _defaults = {
2193+ 'riba': 0,
2194+ }
2195+# create an instance of account_payment_term_
2196+# to migrate the objects in the system
2197+account_payment_term()
2198+
2199+class res_bank_add_field(osv.osv):
2200+ # This OpenERP object inherits from account_payment_term
2201+ # to add a new boolean field
2202+ _inherit = 'res.bank'
2203+ _columns = {
2204+ 'banca_estera' : fields.boolean('Banca Estera'),
2205+ }
2206+# create an instance of account_payment_term_
2207+# to migrate the objects in the system
2208+res_bank_add_field()
2209+
2210+class res_partner_bank_add(osv.osv):
2211+ # This OpenERP object inherits from account_payment_term
2212+ # to add a new boolean field
2213+ _inherit = "res.partner.bank"
2214+ _columns = {
2215+ 'codice_sia' : fields.char('Codice SIA', size=5, help="Identification Code of the Company in the System Interbank")
2216+ }
2217+
2218+# create an instance of account_payment_term_
2219+# to migrate the objects in the system
2220+res_partner_bank_add()
2221+
2222+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2223
2224=== added file 'l10n_it_ri_ba/riba_issue_view.xml'
2225--- l10n_it_ri_ba/riba_issue_view.xml 1970-01-01 00:00:00 +0000
2226+++ l10n_it_ri_ba/riba_issue_view.xml 2012-01-03 08:07:26 +0000
2227@@ -0,0 +1,365 @@
2228+<?xml version="1.0" encoding="utf-8"?>
2229+<openerp>
2230+ <data>
2231+
2232+ <!--
2233+ Create a new field based on account.view_payment_term_from
2234+ base is the module which contains the code of the account view form
2235+ view_payment_term_from is the xml ID of the view in addons/account/account_view.xml
2236+ -->
2237+ <record id="view_riba_add_text_field" model="ir.ui.view">
2238+ <field name="name">account.riba.add.text.field</field>
2239+ <field name="model">account.payment.term</field>
2240+ <field name="inherit_id" ref="account.view_payment_term_form"/>
2241+ <field name="type">form</field>
2242+ <field name="arch" type="xml">
2243+ <field name="active" position="after">
2244+ <field name="riba"/>
2245+ </field>
2246+ </field>
2247+ </record>
2248+ <!--
2249+ Create a new field based on base.view_parter_from
2250+ base is the module which contains the code of the account view form
2251+ view_parter_form is the xml ID of the view in addons/base/res/bank_view.xml
2252+ -->
2253+ <record id="view_res_bank_add_text_field" model="ir.ui.view">
2254+ <field name="name">res.bank.add.text.field</field>
2255+ <field name="model">res.bank</field>
2256+ <field name="inherit_id" ref="base.view_res_bank_form"/>
2257+ <field name="type">form</field>
2258+ <field name="arch" type="xml">
2259+ <field name="bic" position="after">
2260+ <field name="banca_estera"/>
2261+ </field>
2262+ </field>
2263+ </record>
2264+
2265+ <!-- view for res.partner for SIA Code-->
2266+ <record id="view_partner_sia_form" model="ir.ui.view">
2267+ <field name="name">res.partner.form.sia.inherit</field>
2268+ <field name="model">res.partner</field>
2269+ <field name="inherit_id" ref="base.view_partner_form"/>
2270+ <field name="type">form</field>
2271+ <field name="arch" type="xml">
2272+ <field name="acc_number" position="after">
2273+ <newline/>
2274+ <field name="codice_sia"/>
2275+ <newline/>
2276+ </field>
2277+ </field>
2278+ </record>
2279+
2280+ <!-- View used in the wizard -->
2281+ <record id="view_riba_move_line_form" model="ir.ui.view">
2282+ <field name="name">account.riba.move.line.form.inherit</field>
2283+ <field name="model">account.move.line</field>
2284+ <field name="type">form</field>
2285+ <field name="inherit_id" ref="account.view_move_line_form"/>
2286+ <field name="arch" type="xml">
2287+ <field name="reconcile_partial_id" position="after">
2288+ <field name="riba_amount_to_pay"/>
2289+ </field>
2290+ </field>
2291+ </record>
2292+
2293+ <record model="ir.ui.view" id="view_riba_move_line_tree">
2294+ <field name="name">account.riba.move.line.tree</field>
2295+ <field name="model">account.move.line</field>
2296+ <field name="type">tree</field>
2297+ <field name="priority" eval="1"/>
2298+ <field name="arch" type="xml">
2299+ <tree string="RiBa Entry Line">
2300+ <field name="partner_id"/>
2301+ <field name="ref"/>
2302+ <field name="name"/>
2303+ <field name="journal_id"/>
2304+ <field name="account_id"/>
2305+ <field name="date_maturity"/>
2306+ <field name="date"/>
2307+ <field name="debit" sum="Total debit"/>
2308+ <field name="credit" sum="Total credit"/>
2309+ <field name="riba_amount_to_pay"/>
2310+ <field name="amount_currency"/>
2311+ <field name="currency_id"/>
2312+ <field name="period_id" invisible="1"/>
2313+ </tree>
2314+ </field>
2315+ </record>
2316+
2317+ <!-- Icon Menu Principale -->
2318+ <menuitem name="RiBa" parent="account.menu_finance" id="menu_riba" icon="terp-folder-green" sequence="8"/>
2319+
2320+ <!-- Vista RiBa Mode (Banca Aziendale di Presentazione Pagamenti Riba) -->
2321+
2322+ <record id="view_riba_mode_search" model="ir.ui.view">
2323+ <field name="name">riba.mode.search</field>
2324+ <field name="model">riba.mode</field>
2325+ <field name="type">search</field>
2326+ <field name="arch" type="xml">
2327+ <form string="Riba Mode">
2328+ <field name="name"/>
2329+ <field name="journal" widget='selection'/>
2330+ <field name="company_id" widget='selection' groups="base.group_multi_company"/>
2331+ <newline/>
2332+ <group expand="0" string="Group By...">
2333+ <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal'}"/>
2334+ </group>
2335+ </form>
2336+ </field>
2337+ </record>
2338+
2339+ <record id="view_riba_mode_tree" model="ir.ui.view">
2340+ <field name="name">riba.mode.tree</field>
2341+ <field name="model">riba.mode</field>
2342+ <field name="type">tree</field>
2343+ <field name="arch" type="xml">
2344+ <tree string="Riba Mode">
2345+ <field name="name"/>
2346+ <field name="journal"/>
2347+ <field name="company_id" groups="base.group_multi_company"/>
2348+ </tree>
2349+ </field>
2350+ </record>
2351+
2352+ <record id="view_riba_mode_form" model="ir.ui.view">
2353+ <field name="name">riba.mode.form</field>
2354+ <field name="model">riba.mode</field>
2355+ <field name="type">form</field>
2356+ <field name="arch" type="xml">
2357+ <form string="Riba Mode">
2358+ <field name="name" select="1"/>
2359+ <field name="journal" select="1"/>
2360+ <field name="bank_id" domain="[('partner_id','=',partner_id)]"/>
2361+ <field name="company_id" select="1" widget='selection' groups="base.group_multi_company" on_change="onchange_company_id(company_id)"/>
2362+ <field name="partner_id" select="1" widget='selection' invisible="1"/>
2363+ </form>
2364+ </field>
2365+ </record>
2366+ <record id="action_riba_mode_form" model="ir.actions.act_window">
2367+ <field name="name">Riba Mode</field>
2368+ <field name="res_model">riba.mode</field>
2369+ <field name="view_type">form</field>
2370+ <field name="view_mode">tree,form</field>
2371+ <field name="search_view_id" ref="view_riba_mode_search"/>
2372+ </record>
2373+
2374+ <menuitem action="action_riba_mode_form" id="menu_action_riba_mode_form" parent="account.menu_configuration_misc"/>
2375+
2376+
2377+ <!-- Vista RiBa Order (Raggrupamento Pagamenti Riba Lines) -->
2378+
2379+<record id="view_riba_order_form" model="ir.ui.view">
2380+ <field name="name">riba.order.form</field>
2381+ <field name="model">riba.order</field>
2382+ <field name="type">form</field>
2383+ <field name="arch" type="xml">
2384+ <form string="Riba Order">
2385+ <group col="6" colspan="4">
2386+ <field name="reference"/>
2387+ <field name="mode" widget='selection'/>
2388+ <button colspan="2" name="%(action_riba_order_create)d" string="Select Riba to Issue" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>
2389+ </group>
2390+ <field name="line_ids" colspan="4" widget="one2many_list" nolabel="1" default_get="{'order_id': active_id or False}" >
2391+ <form string="Riba Line">
2392+ <notebook>
2393+ <page string="Riba">
2394+ <field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode,parent.date_prefered,parent.date_scheduled,currency,company_currency)" select="1" domain="[('debit', '>',0),('riba_amount_to_pay','>',0)]"/>
2395+ <separator colspan="4" string="Transaction Information"/>
2396+ <field name="date"/>
2397+ <group colspan="2">
2398+ <field name="amount_currency" on_change="onchange_amount(amount_currency,currency,company_currency)"/>
2399+ <field name="currency" nolabel="1"/>
2400+ </group>
2401+ <field name="partner_id" on_change="onchange_partner(partner_id,parent.mode)" select="1"/>
2402+ <field domain="[('partner_id','=',partner_id)]" name="bank_id"/>
2403+ <separator colspan="2" string="Owner Account"/>
2404+ <separator colspan="2" string="Destination Account"/>
2405+ <field colspan="2" name="info_owner" nolabel="1"/>
2406+ <field colspan="2" name="info_partner" nolabel="1"/>
2407+ <field colspan="4" name="communication"/>
2408+ <field colspan="4" name="communication2"/>
2409+ <field name="name"/>
2410+ <field name="state"/>
2411+ <field name="company_id" widget='selection' groups="base.group_multi_company"/>
2412+ </page>
2413+ <page string="Information">
2414+
2415+ <separator colspan="4" string="General Information"/>
2416+ <group colspan="2">
2417+ <field name="amount"/>
2418+ <field name="company_currency" nolabel="1"/>
2419+ </group>
2420+ <separator colspan="4" string="Entry Information"/>
2421+ <field name="create_date" readonly="1"/>
2422+ <field name="ml_maturity_date"/>
2423+ <field name="ml_inv_ref"/>
2424+ </page>
2425+ </notebook>
2426+ </form>
2427+ <tree string="riba Line">
2428+ <field name="ml_inv_ref" />
2429+ <field name="partner_id" select="1"/>
2430+ <field name="bank_id" domain="[('partner_id', '=', partner_id)]"/>
2431+ <field name="ml_date_created"/>
2432+ <field name="date"/>
2433+ <field name="amount_currency" string="Amount"/>
2434+ <field name="currency"/>
2435+ <field name="name"/>
2436+ <field name="amount" sum="Total Riba Order: " invisible="1"/>
2437+ </tree>
2438+ </field>
2439+ <field name="date_created"/>
2440+ <field name="date_done"/>
2441+ <field name="state" readonly="1" select="1"/>
2442+ <group col="4" colspan="2">
2443+ <button name="cancel" states="draft,open" string="Cancel" icon="gtk-cancel"/>
2444+ <button name="open" states="draft" string="Confirm Issue" icon="gtk-apply"/>
2445+ <button name="set_done" states="open" string="Make Issue" type="object" icon="gtk-execute"/>
2446+ <button name="set_to_draft" states="cancel" string="Set to draft" type="object" icon="gtk-convert"/>
2447+ </group>
2448+ </form>
2449+ </field>
2450+ </record> -->
2451+
2452+ <record id="view_riba_order_tree" model="ir.ui.view">
2453+ <field name="name">riba.order.tree</field>
2454+ <field name="model">riba.order</field>
2455+ <field name="type">tree</field>
2456+ <field eval="4" name="priority"/>
2457+ <field name="arch" type="xml">
2458+ <tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open')" string="Riba Order">
2459+ <field name="reference"/>
2460+ <field name="mode"/>
2461+ <field name="user_id"/>
2462+ <field name="company_id" groups="base.group_multi_company"/>
2463+ <field name="date_created"/>
2464+ <field name="date_done"/>
2465+ <field name="total"/>
2466+ <field name="state"/>
2467+ <button name="cancel" states="draft,open" string="Cancel" icon="gtk-cancel"/>
2468+ <button name="open" states="draft" string="Confirm Issue" icon="gtk-apply"/>
2469+ <button name="set_done" states="open" string="Make Issue" type ="object" icon="gtk-execute"/>
2470+ </tree>
2471+ </field>
2472+ </record>
2473+
2474+ <record id="view_riba_order_search" model="ir.ui.view">
2475+ <field name="name">riba.order.tree.search</field>
2476+ <field name="model">riba.order</field>
2477+ <field name="type">search</field>
2478+ <field name="arch" type="xml">
2479+ <search string="Search Riba Orders">
2480+ <group col="8" colspan="4">
2481+ <filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
2482+ <filter string="Confirmed" domain="[('state','=','open')]" icon="terp-camera_test"/>
2483+ <filter string="Done" domain="[('state','=','done')]" icon="terp-dialog-close"/>
2484+ <separator orientation="vertical"/>
2485+ <field name="reference"/>
2486+ <field name="mode" widget='selection'/>
2487+ <field name="date_done"/>
2488+ <field name="state"/>
2489+ </group>
2490+ <newline/>
2491+ <group expand="0" string="Group By...">
2492+ <filter string="Riba Mode" context="{'group_by': 'mode'}" icon="terp-dolar"/>
2493+ <filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
2494+ </group>
2495+ </search>
2496+ </field>
2497+ </record>
2498+
2499+ <record id="action_riba_order_tree" model="ir.actions.act_window">
2500+ <field name="name">RiBa Order</field>
2501+ <field name="res_model">riba.order</field>
2502+ <field name="view_type">form</field>
2503+ <field name="view_mode">tree,form</field>
2504+ <field name="search_view_id" ref="view_riba_order_search"/>
2505+ <field name="help">A riba order is a issue request from your company to pay a custumer invoice or a customer debit note. Here you can register all riba orders that should be done, keep track of all riba orders and mention the invoice reference and the partner the riba should be done for.</field>
2506+ </record>
2507+
2508+ <menuitem name="RiBa Issue" action="action_riba_order_tree" id="menu_action_riba_order_form" parent="menu_riba" sequence="3"/>
2509+ <menuitem action="action_riba_invoice_customer_tree1" id="menu_action_riba_invoice_customer_tree1" parent="menu_riba" sequence="2"/>
2510+
2511+ <record id="action_riba_order_tree_new" model="ir.actions.act_window">
2512+ <field name="name">New Riba Order</field>
2513+ <field name="res_model">riba.order</field>
2514+ <field name="view_type">form</field>
2515+ <field name="view_mode">form,tree</field>
2516+ </record>
2517+
2518+ <!-- Vista RiBa Lines (Riga Pagamento Riba) -->
2519+ <record id="view_riba_line_form" model="ir.ui.view">
2520+ <field name="name">Riba Line</field>
2521+ <field name="model">riba.line</field>
2522+ <field name="type">form</field>
2523+ <field name="arch" type="xml">
2524+ <form string="Riba Line">
2525+ <notebook>
2526+ <page string="Riba">
2527+ <field name="order_id" select="1"/>
2528+ <field name="move_line_id" on_change="onchange_move_line(move_line_id, False, currency, company_currency)" select="1" domain="[('debit', '>',0),('riba_amount_to_pay','>',0)] "/>
2529+ <separator colspan="4" string="Transaction Information"/>
2530+ <field name="date"/>
2531+ <group colspan="2">
2532+ <field name="amount_currency" on_change="onchange_amount(amount_currency,currency,company_currency)"/>
2533+ <field name="currency" nolabel="1"/>
2534+ </group>
2535+ <field name="partner_id" on_change="onchange_partner(partner_id, False)" select="1"/>
2536+ <field domain="[('partner_id','=',partner_id)]" name="bank_id"/>
2537+ <separator colspan="2" string="Owner Account"/>
2538+ <separator colspan="2" string="Destination Account"/>
2539+ <field colspan="2" name="info_owner" nolabel="1"/>
2540+ <field colspan="2" name="info_partner" nolabel="1"/>
2541+
2542+ <field colspan="4" name="communication"/>
2543+ <field colspan="4" name="communication2"/>
2544+ <field name="name"/>
2545+ <field name="state"/>
2546+ </page>
2547+ <page string="Information">
2548+ <separator colspan="4" string="General Information"/>
2549+ <group colspan="2">
2550+ <field name="amount" select="1"/>
2551+ <field name="company_currency" nolabel="1"/>
2552+ </group>
2553+ <separator colspan="4" string="Entry Information"/>
2554+ <field name="create_date"/>
2555+ <field name="ml_maturity_date"/>
2556+ <field name="ml_inv_ref"/>
2557+ </page>
2558+ </notebook>
2559+ </form>
2560+ </field>
2561+ </record>
2562+ <record id="view_riba_line_tree" model="ir.ui.view">
2563+ <field name="name">Riba Lines</field>
2564+ <field name="model">riba.line</field>
2565+ <field name="type">tree</field>
2566+ <field eval="4" name="priority"/>
2567+ <field name="arch" type="xml">
2568+ <tree string="Riba Line">
2569+ <field name="order_id"/>
2570+ <field name="ml_inv_ref" />
2571+ <field name ="ml_date_created" />
2572+ <field name="ml_maturity_date"/>
2573+ <field name="partner_id" select="1"/>
2574+ <field name="amount" sum="Amount Total"/>
2575+ <field name="amount_currency" sum="Currency Amount Total"/>
2576+ <field name="currency"/>
2577+ <field name="bank_id" domain="[('partner_id', '=', partner_id)]"/>
2578+ <field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode)"/>
2579+ <field name="create_date"/>
2580+ <field name="name"/>
2581+ </tree>
2582+ </field>
2583+ </record>
2584+ <record id="action_riba_line_form" model="ir.actions.act_window">
2585+ <field name="name">Riba Line</field>
2586+ <field name="res_model">riba.line</field>
2587+ <field name="view_type">tree</field>
2588+ <field name="view_mode">form,tree</field>
2589+ </record>
2590+
2591+ </data>
2592+</openerp>
2593
2594=== added file 'l10n_it_ri_ba/riba_report.xml'
2595--- l10n_it_ri_ba/riba_report.xml 1970-01-01 00:00:00 +0000
2596+++ l10n_it_ri_ba/riba_report.xml 2012-01-03 08:07:26 +0000
2597@@ -0,0 +1,7 @@
2598+<?xml version="1.0" encoding="utf-8"?>
2599+<openerp>
2600+ <data>
2601+ <report auto="False" id="riba_order_view" model="riba.order" name="riba.order" file="l10n_it_ri_ba/report/order.mako" string="RiBa Order" report_type="webkit" />
2602+ </data>
2603+</openerp>
2604+
2605
2606=== added file 'l10n_it_ri_ba/riba_sequence.xml'
2607--- l10n_it_ri_ba/riba_sequence.xml 1970-01-01 00:00:00 +0000
2608+++ l10n_it_ri_ba/riba_sequence.xml 2012-01-03 08:07:26 +0000
2609@@ -0,0 +1,29 @@
2610+<?xml version="1.0" encoding="utf-8"?>
2611+<openerp>
2612+ <data noupdate="1">
2613+ <record forcecreate="1" id="seq_type_riba_order" model="ir.sequence.type">
2614+ <field name="name">RiBa order</field>
2615+ <field name="code">riba.order</field>
2616+ </record>
2617+
2618+ <record forcecreate="1" id="seq_riba_order" model="ir.sequence">
2619+ <field name="name">RiBa order</field>
2620+ <field name="code">riba.order</field>
2621+ <field eval="3" name="padding"/>
2622+ <field name="prefix">%(year)s/</field>
2623+ </record>
2624+
2625+ <record forcecreate="1" id="seq_type_riba_line" model="ir.sequence.type">
2626+ <field name="name">RiBa Line</field>
2627+ <field name="code">riba.line</field>
2628+ </record>
2629+
2630+ <record forcecreate="1" id="seq_riba_line" model="ir.sequence">
2631+ <field name="name">RiBa Line</field>
2632+ <field name="code">riba.line</field>
2633+ <field name="prefix"/>
2634+ <field name="padding">3</field>
2635+ </record>
2636+
2637+ </data>
2638+</openerp>
2639
2640=== added directory 'l10n_it_ri_ba/security'
2641=== added file 'l10n_it_ri_ba/security/ir.model.access.csv'
2642--- l10n_it_ri_ba/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
2643+++ l10n_it_ri_ba/security/ir.model.access.csv 2012-01-03 08:07:26 +0000
2644@@ -0,0 +1,11 @@
2645+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
2646+"access_riba_mode","riba.mode","model_riba_mode","group_payment_riba",1,1,1,1
2647+"access_riba_order","riba.order","model_riba_order","group_payment_riba",1,1,1,1
2648+"access_riba_line","riba.line","model_riba_line","group_payment_riba",1,1,1,1
2649+"access_account_journal_riba","account.journal riba","account.model_account_journal","group_payment_riba",1,0,0,0
2650+"access_account_invoice_riba","account.invoice riba","account.model_account_invoice","group_payment_riba",1,0,0,0
2651+"access_account_move_line_riba","account.move.line payment","account.model_account_move_line","group_payment_riba",1,0,0,0
2652+"access_riba_order_accountant","riba.order accountant","model_riba_order","account.group_account_user",1,1,1,1
2653+"access_riba_order_manager","riba.order manager","model_riba_order","account.group_account_manager",1,0,0,0
2654+"access_riba_order_invoice","riba.order invoice","model_riba_order","account.group_account_invoice",1,1,1,1
2655+"access_riba_line_invoice","riba.line invoice","model_riba_line","account.group_account_invoice",1,1,1,1
2656
2657=== added file 'l10n_it_ri_ba/security/riba_issue_security.xml'
2658--- l10n_it_ri_ba/security/riba_issue_security.xml 1970-01-01 00:00:00 +0000
2659+++ l10n_it_ri_ba/security/riba_issue_security.xml 2012-01-03 08:07:26 +0000
2660@@ -0,0 +1,31 @@
2661+<?xml version="1.0" encoding="utf-8"?>
2662+<openerp>
2663+<data noupdate="1">
2664+
2665+ <record id="group_payment_riba" model="res.groups">
2666+ <field name="name">Accounting / RiBa</field>
2667+ </record>
2668+
2669+ <record id="riba_mode_comp_rule" model="ir.rule">
2670+ <field name="name">RiBa Mode company rule</field>
2671+ <field model="ir.model" name="model_id" ref="model_riba_mode"/>
2672+ <field eval="True" name="global"/>
2673+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
2674+ </record>
2675+
2676+ <record id="riba_order_comp_rule" model="ir.rule">
2677+ <field name="name">RiBa order multi company rule</field>
2678+ <field model="ir.model" name="model_id" ref="model_riba_order"/>
2679+ <field eval="True" name="global"/>
2680+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
2681+ </record>
2682+
2683+ <record id="riba_line_comp_rule" model="ir.rule">
2684+ <field name="name">RiBa line multi company rule</field>
2685+ <field model="ir.model" name="model_id" ref="model_riba_line"/>
2686+ <field eval="True" name="global"/>
2687+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
2688+ </record>
2689+
2690+</data>
2691+</openerp>
2692
2693=== added directory 'l10n_it_ri_ba/wizard'
2694=== added file 'l10n_it_ri_ba/wizard/__init__.py'
2695--- l10n_it_ri_ba/wizard/__init__.py 1970-01-01 00:00:00 +0000
2696+++ l10n_it_ri_ba/wizard/__init__.py 2012-01-03 08:07:26 +0000
2697@@ -0,0 +1,28 @@
2698+# -*- coding: utf-8 -*-
2699+##############################################################################
2700+#
2701+# Copyright (C) 2011 Associazione OpenERP Italia
2702+# (<http://www.openerp-italia.org>).
2703+# All Rights Reserved
2704+# Thanks to Cecchi s.r.l http://www.cecchi.com/
2705+#
2706+# This program is free software: you can redistribute it and/or modify
2707+# it under the terms of the GNU Affero General Public License as published by
2708+# the Free Software Foundation, either version 3 of the License, or
2709+# (at your option) any later version.
2710+#
2711+# This program is distributed in the hope that it will be useful,
2712+# but WITHOUT ANY WARRANTY; without even the implied warranty of
2713+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2714+# GNU General Public License for more details.
2715+#
2716+# You should have received a copy of the GNU Affero General Public License
2717+# along with this program. If not, see <http://www.gnu.org/licenses/>.
2718+#
2719+##############################################################################
2720+
2721+import riba_issue_order
2722+import riba_issue_pay
2723+import riba_file_export
2724+
2725+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2726
2727=== added file 'l10n_it_ri_ba/wizard/riba_file_export.py'
2728--- l10n_it_ri_ba/wizard/riba_file_export.py 1970-01-01 00:00:00 +0000
2729+++ l10n_it_ri_ba/wizard/riba_file_export.py 2012-01-03 08:07:26 +0000
2730@@ -0,0 +1,247 @@
2731+# -*- coding: utf-8 -*-
2732+##############################################################################
2733+#
2734+# Copyright (C) 2011 OpenERP Italian Community (<http://www.openerp-italia.org>).
2735+# All Rights Reserved
2736+# Thanks to Antonio de Vincentiis http://www.devincentiis.it/ ,
2737+# GAzie http://gazie.sourceforge.net/
2738+# and Cecchi s.r.l http://www.cecchi.com/
2739+#
2740+# This program is free software: you can redistribute it and/or modify
2741+# it under the terms of the GNU Affero General Public License as published by
2742+# the Free Software Foundation, either version 3 of the License, or
2743+# (at your option) any later version.
2744+#
2745+# This program is distributed in the hope that it will be useful,
2746+# but WITHOUT ANY WARRANTY; without even the implied warranty of
2747+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2748+# GNU General Public License for more details.
2749+#
2750+# You should have received a copy of the GNU General Public License
2751+# along with this program. If not, see <http://www.gnu.org/licenses/>.
2752+#
2753+##############################################################################
2754+
2755+'''
2756+*****************************************************************************************
2757+ Questa classe genera il file RiBa standard ABI-CBI passando alla funzione "creaFile" i due array di seguito specificati:
2758+$intestazione = array monodimensionale con i seguenti index:
2759+ [0] = credit_sia variabile lunghezza 5 alfanumerico
2760+ [1] = credit_abi assuntrice variabile lunghezza 5 numerico
2761+ [2] = credit_cab assuntrice variabile lunghezza 5 numerico
2762+ [3] = credit_conto conto variabile lunghezza 10 alfanumerico
2763+ [4] = data_creazione variabile lunghezza 6 numerico formato GGMMAA
2764+ [5] = nome_supporto variabile lunghezza 20 alfanumerico
2765+ [6] = codice_divisa variabile lunghezza 1 alfanumerico opzionale default "E"
2766+ [7] = name_company nome ragione sociale creditore variabile lunghezza 24 alfanumerico
2767+ [8] = indirizzo_creditore variabile lunghezza 24 alfanumerico
2768+ [9] = cap_citta_creditore variabile lunghezza 24 alfanumerico
2769+ [10] = ref (definizione attivita) creditore
2770+ [11] = codice fiscale/partita iva creditore alfanumerico opzionale
2771+
2772+$ricevute_bancarie = array bidimensionale con i seguenti index:
2773+ [0] = numero ricevuta lunghezza 10 numerico
2774+ [1] = data scadenza lunghezza 6 numerico
2775+ [2] = importo in centesimi di euro
2776+ [3] = nome debitore lunghezza 60 alfanumerico
2777+ [4] = codice fiscale/partita iva debitore lunghezza 16 alfanumerico
2778+ [5] = indirizzo debitore lunghezza 30 alfanumerico
2779+ [6] = cap debitore lunghezza 5 numerico
2780+ [7] = citta debitore alfanumerico
2781+ [8] = debitor_province debitore alfanumerico
2782+ [9] = abi banca domiciliataria lunghezza 5 numerico
2783+ [10] = cab banca domiciliataria lunghezza 5 numerico
2784+ [11] = descrizione banca domiciliataria lunghezza 50 alfanumerico
2785+ [12] = codice cliente attribuito dal creditore lunghezza 16 numerico
2786+ [13] = numero fattura lunghezza 40 alfanumerico
2787+ [14] = data effettiva della fattura
2788+
2789+'''
2790+
2791+import tools
2792+import base64
2793+from osv import fields,osv
2794+from tools.translate import _
2795+import datetime
2796+
2797+class riba_file_export(osv.osv_memory):
2798+
2799+ _progressivo = 0
2800+ _assuntrice = 0
2801+ _sia = 0
2802+ _data = 0
2803+ _valuta = 0
2804+ _supporto = 0
2805+ _totale = 0
2806+ _creditore = 0
2807+ _descrizione = ''
2808+ _codice = ''
2809+ _comune_provincia_debitor = ''
2810+
2811+ def _RecordIB(self, sia_assuntrice, abi_assuntrice, data_creazione, nome_supporto, codice_divisa): #record di testa
2812+ self._sia = sia_assuntrice.rjust(5,'0')
2813+ self._assuntrice = abi_assuntrice.rjust(5, '0')
2814+ self._data = data_creazione.rjust(6, '0')
2815+ self._valuta = codice_divisa[0:1]
2816+ self._supporto = nome_supporto.ljust(20, ' ')
2817+ return " IB" + self._sia + self._assuntrice + self._data + self._supporto + " " * 74 + self._valuta + " " * 6 + "\r\n"
2818+
2819+ def _Record14(self, scadenza, importo, abi_assuntrice, cab_assuntrice, conto, abi_domiciliataria, cab_domiciliataria, sia_credit, codice_cliente):
2820+ self._totale += importo
2821+ return " 14" + str(self._progressivo).rjust(7,'0') + " " * 12 + scadenza + "30000" + str(int(round(importo*100))).rjust(13,'0') + "-" + abi_assuntrice.rjust(5,'0') + cab_assuntrice.rjust(5,'0') + conto.ljust(12,'0') + abi_domiciliataria.rjust(5,'0') + cab_domiciliataria.rjust(5,'0') + " " * 12 + str(sia_credit).rjust(5,'0') + "4" + codice_cliente.ljust(16) + " " * 6 + self._valuta + "\r\n"
2822+
2823+ def _Record20(self, ragione_soc1_creditore, indirizzo_creditore, cap_citta_creditore, ref_creditore,):
2824+ self._creditore = ragione_soc1_creditore.ljust(24)
2825+ return " 20" + str(self._progressivo).rjust(7,'0') + self._creditore[0:24] + indirizzo_creditore.ljust(24)[0:24] + cap_citta_creditore.ljust(24)[0:24]+ ref_creditore.ljust(24)[0:24] + " " * 14 + "\r\n"
2826+
2827+ def _Record30(self, nome_debitore, codice_fiscale_debitore):
2828+ return " 30" + str(self._progressivo).rjust(7,'0') + nome_debitore.ljust(60)[0:60] + codice_fiscale_debitore.ljust(16,' ') + " " * 34 + "\r\n"
2829+
2830+ def _Record40(self, indirizzo_debitore, cap_debitore, comune_debitore, provincia_debitore, descrizione_domiciliataria=""):
2831+ self._comune_provincia_debitor = comune_debitore + provincia_debitore.rjust(25-len(comune_debitore),' ')
2832+ return " 40" + str(self._progressivo).rjust(7,'0') + indirizzo_debitore.ljust(30)[0:30] + str(cap_debitore).rjust(5,'0') + self._comune_provincia_debitor + descrizione_domiciliataria.ljust(50)[0:50] + "\r\n"
2833+
2834+ def _Record50(self, importo_debito, invoice_ref, data_invoice, partita_iva_creditore):
2835+ self._descrizione = 'PER LA FATTURA N. ' + invoice_ref + ' DEL '+ data_invoice + ' IMP '+ str(importo_debito)
2836+ return " 50" + str(self._progressivo).rjust(7,'0') + self._descrizione.ljust(80)[0:80] + " " * 10 + partita_iva_creditore.ljust(16,' ') + " " * 4 + "\r\n"
2837+
2838+ def _Record51(self, numero_ricevuta_creditore):
2839+ return " 51" + str(self._progressivo).rjust(7,'0') + str(numero_ricevuta_creditore).rjust(10,'0') + self._creditore[0:20] + " " * 80 + "\r\n"
2840+
2841+ def _Record70(self):
2842+ return " 70" + str(self._progressivo).rjust(7,'0') + " " * 110 + "\r\n"
2843+
2844+ def _RecordEF(self): #record di coda
2845+ return " EF" + self._sia + self._assuntrice + self._data + self._supporto + " " * 6 + str(self._progressivo).rjust(7,'0') + str(int(round(self._totale * 100))).rjust(15,'0') + "0" * 15 + str(int(self._progressivo)*7+2).rjust(7,'0') + " " * 24 + self._valuta + " " * 6 + "\r\n"
2846+
2847+ def _creaFile(self, intestazione, ricevute_bancarie):
2848+ accumulatore = self._RecordIB(intestazione[0], intestazione[1], intestazione[4], intestazione[5], intestazione[6])
2849+ for value in ricevute_bancarie: #estraggo le ricevute dall'array
2850+ self._progressivo =self._progressivo + 1
2851+ accumulatore = accumulatore + self._Record14(
2852+ value[1], value[2], intestazione[1], intestazione[2], intestazione[3], value[9], value[10], intestazione[0], value[12])
2853+ accumulatore = accumulatore + self._Record20(intestazione[7], intestazione[8], intestazione[9], intestazione[10])
2854+ accumulatore = accumulatore + self._Record30(value[3], value[4])
2855+ accumulatore = accumulatore + self._Record40(value[5], value[6], value[7], value[8], value[11])
2856+ accumulatore = accumulatore + self._Record50(value[2], value[13], value[14], intestazione[11])
2857+ accumulatore = accumulatore + self._Record51(value[0])
2858+ accumulatore = accumulatore + self._Record70()
2859+ accumulatore = accumulatore + self._RecordEF()
2860+ self._progressivo = 0
2861+ self._totale = 0
2862+ return accumulatore
2863+
2864+ def act_getfile(self, cr, uid, ids, context=None):
2865+ active_ids = context and context.get('active_ids', [])
2866+ order_obj = self.pool.get('riba.order').browse(cr, uid, active_ids, context=context)[0]
2867+ credit_bank = order_obj.mode.bank_id
2868+ name_company = order_obj.company_id.partner_id.name
2869+ if not credit_bank.iban:
2870+ raise osv.except_osv('Error', _('No IBAN specified'))
2871+ credit_abi = credit_bank.iban[5:10]
2872+ credit_cab = credit_bank.iban[10:15]
2873+ credit_conto = credit_bank.iban[-12:]
2874+ if not credit_bank.codice_sia:
2875+ raise osv.except_osv('Error', _('No SIA Code specified for: ') + name_company)
2876+ credit_sia = credit_bank.codice_sia
2877+ credit_account = credit_bank.iban[15:27]
2878+ dataemissione = datetime.datetime.now().strftime("%d%m%y")
2879+ nome_supporto = datetime.datetime.now().strftime("%d%m%y%H%M%S") + credit_sia
2880+ creditor_address = order_obj.company_id.partner_id.address
2881+ if not creditor_address[0].street:
2882+ raise osv.except_osv('Error', _('No address specified for: ') + name_company)
2883+ creditor_city = ''
2884+ if creditor_address[0].city:
2885+ creditor_city = creditor_address[0].city
2886+ creditor_province = ''
2887+ if creditor_address[0].province:
2888+ creditor_province = creditor_address[0].province.code
2889+ if not order_obj.company_id.partner_id.vat and not order_obj.company_id.partner_id.fiscalcode:
2890+ raise osv.except_osv('Error', _('No VAT or Fiscalcode specified for: ') + name_company)
2891+ array_testata = [
2892+ credit_sia,
2893+ credit_abi,
2894+ credit_cab,
2895+ credit_conto,
2896+ dataemissione,
2897+ nome_supporto,
2898+ 'E',
2899+ name_company,
2900+ creditor_address[0].street or '',
2901+ creditor_address[0].zip or '' + ' ' + creditor_city,
2902+ order_obj.mode.company_id.partner_id.ref or '',
2903+ order_obj.company_id.partner_id.vat and order_obj.company_id.partner_id.vat[2:] or order_obj.company_id.partner_id.fiscalcode,
2904+ ]
2905+ arrayRiba = []
2906+ for line in order_obj.line_ids:
2907+ debit_bank = line.bank_id
2908+ if not line.partner_id.address:
2909+ raise osv.except_osv('Error', _('No address specified for ') + line.partner_id.name)
2910+ debitor_address = line.partner_id.address
2911+ if debitor_address[0].street:
2912+ debitor_street = debitor_address[0].street
2913+ else:
2914+ raise osv.except_osv('Error', _('No Street specified for ') + line.partner_id.name)
2915+ if debitor_address[0].zip:
2916+ debitor_zip = debitor_address[0].zip
2917+ else:
2918+ raise osv.except_osv('Error', _('No CAP specified for ') + line.partner_id.name)
2919+ if not debit_bank.iban:
2920+ raise osv.except_osv('Error', _('No IBAN specified for ') + line.partner_id.name)
2921+ debit_abi = debit_bank.iban[5:10]
2922+ debit_cab = debit_bank.iban[10:15]
2923+ debitor_city = ''
2924+ if debitor_address[0].city:
2925+ debitor_city = debitor_address[0].city
2926+ else:
2927+ raise osv.except_osv('Error', _('No City specified for ') + line.partner_id.name)
2928+ debitor_province = ''
2929+ if debitor_address[0].province:
2930+ debitor_province = debitor_address[0].province.code
2931+ if not line.date:
2932+ due_date = '000000'
2933+
2934+ else:
2935+ due_date = datetime.datetime.strptime(line.date[:10], '%Y-%m-%d').strftime("%d%m%y")
2936+
2937+ if not line.partner_id.vat and not line.partner_id.fiscalcode:
2938+ raise osv.except_osv('Error', _('No VAT or Fiscal code specified for ') + line.partner_id.name)
2939+ Riba = [
2940+ line.name,
2941+ due_date,
2942+ line.amount_currency,
2943+ line.partner_id.name,
2944+ line.partner_id.vat and line.partner_id.vat[2:] or line.partner_id.fiscalcode,
2945+ debitor_street,
2946+ debitor_zip,
2947+ debitor_city,
2948+ debitor_province,
2949+ debit_abi,
2950+ debit_cab,
2951+ debit_bank.bank.name,
2952+ line.partner_id.ref or '',
2953+ line.ml_inv_ref.internal_number,
2954+ datetime.datetime.strptime(line.ml_date_created, '%Y-%m-%d').strftime("%d/%m/%Y"),
2955+ ]
2956+ arrayRiba.append(Riba)
2957+
2958+ out=base64.encodestring(self._creaFile(array_testata, arrayRiba))
2959+
2960+ return self.write(cr, uid, ids, {'state':'get', 'riba_.txt':out}, context=context)
2961+
2962+ _name = "riba.file.export"
2963+
2964+ _columns = {
2965+ 'state': fields.selection( ( ('choose','choose'), # choose accounts
2966+ ('get','get'), # get the file
2967+ ) ),
2968+ 'riba_.txt': fields.binary('File', readonly=True),
2969+ }
2970+ _defaults = {
2971+ 'state': lambda *a: 'choose',
2972+ }
2973+
2974+
2975+riba_file_export()
2976+
2977+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2978
2979=== added file 'l10n_it_ri_ba/wizard/riba_file_export.xml'
2980--- l10n_it_ri_ba/wizard/riba_file_export.xml 1970-01-01 00:00:00 +0000
2981+++ l10n_it_ri_ba/wizard/riba_file_export.xml 2012-01-03 08:07:26 +0000
2982@@ -0,0 +1,33 @@
2983+<?xml version="1.0" encoding="utf-8"?>
2984+<openerp>
2985+ <data>
2986+
2987+ <record id="wizard_riba_file_export" model="ir.ui.view">
2988+ <field name="name">Export Ri.Ba.</field>
2989+ <field name="model">riba.file.export</field>
2990+ <field name="type">form</field>
2991+ <field name="arch" type="xml">
2992+ <form string="Export Ri.Ba. file">
2993+ <group col="4">
2994+ <group colspan="4" >
2995+ <button icon="gtk-cancel" special="cancel" string="Cancel"/>
2996+ <button icon="gtk-ok" name="act_getfile" string="Export" type="object"/>
2997+ </group>
2998+ <group colspan="4">
2999+ <field name="riba_.txt" readonly="1"/>
3000+ </group>
3001+ </group>
3002+ </form>
3003+ </field>
3004+ </record>
3005+
3006+ <act_window name="Export Ri.Ba."
3007+ res_model="riba.file.export"
3008+ src_model="riba.order"
3009+ view_mode="form"
3010+ target="new"
3011+ key2="client_action_multi"
3012+ id="action_wizard_riba_file_export"
3013+ view_id="wizard_riba_file_export"/>
3014+ </data>
3015+</openerp>
3016
3017=== added file 'l10n_it_ri_ba/wizard/riba_issue_order.py'
3018--- l10n_it_ri_ba/wizard/riba_issue_order.py 1970-01-01 00:00:00 +0000
3019+++ l10n_it_ri_ba/wizard/riba_issue_order.py 2012-01-03 08:07:26 +0000
3020@@ -0,0 +1,131 @@
3021+# -*- coding: utf-8 -*-
3022+##############################################################################
3023+#
3024+# Copyright (C) 2011 Associazione OpenERP Italia
3025+# (<http://www.openerp-italia.org>).
3026+# All Rights Reserved
3027+# Thanks to Cecchi s.r.l http://www.cecchi.com/
3028+#
3029+# This program is free software: you can redistribute it and/or modify
3030+# it under the terms of the GNU Affero General Public License as published by
3031+# the Free Software Foundation, either version 3 of the License, or
3032+# (at your option) any later version.
3033+#
3034+# This program is distributed in the hope that it will be useful,
3035+# but WITHOUT ANY WARRANTY; without even the implied warranty of
3036+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3037+# GNU General Public License for more details.
3038+#
3039+# You should have received a copy of the GNU Affero General Public License
3040+# along with this program. If not, see <http://www.gnu.org/licenses/>.
3041+#
3042+##############################################################################
3043+
3044+import time
3045+from lxml import etree
3046+from tools.translate import _
3047+from osv import osv, fields
3048+
3049+class riba_order_create(osv.osv_memory):
3050+ """
3051+ Create a riba object with lines corresponding to the account move line
3052+ to pay according to the date and the mode provided by the user.
3053+ Hypothesis:
3054+ - Riba mode and bank account type,
3055+ - Iban number of partner and bank account.
3056+
3057+ If a type is given, unsuitable account Entry lines are ignored.
3058+ """
3059+
3060+ _name = 'riba.order.create'
3061+ _description = 'riba.order.create'
3062+ _columns = {
3063+ 'duedate': fields.date('Due Date', required=True),
3064+ 'entries': fields.many2many('account.move.line', 'line_pay_rel', 'pay_id', 'line_id', 'Entries')
3065+ }
3066+ _defaults = {
3067+ 'duedate': lambda *a: time.strftime('%Y-%m-%d'),
3068+ }
3069+
3070+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
3071+ res = super(riba_order_create, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
3072+ if context and 'line_ids' in context:
3073+ view_obj = etree.XML(res['arch'])
3074+ child = view_obj.getchildren()[0]
3075+ domain = '[("id", "in", '+ str(context['line_ids'])+')]'
3076+ field = etree.Element('field', attrib={'domain': domain, 'name':'entries', 'colspan':'4', 'height':'300', 'width':'800', 'nolabel':"1"})
3077+ child.addprevious(field)
3078+ res['arch'] = etree.tostring(view_obj)
3079+ return res
3080+
3081+ def create_riba(self, cr, uid, ids, context=None):
3082+ order_obj = self.pool.get('riba.order')
3083+ line_obj = self.pool.get('account.move.line')
3084+ riba_obj = self.pool.get('riba.line')
3085+ if context is None:
3086+ context = {}
3087+ data = self.browse(cr, uid, ids, context=context)[0]
3088+ line_ids = [entry.id for entry in data.entries]
3089+ if not line_ids:
3090+ return {'type': 'ir.actions.act_window_close'}
3091+
3092+ riba = order_obj.browse(cr, uid, context['active_id'], context=context)
3093+ t = None
3094+ line2bank = line_obj.line_2_bank(cr, uid, line_ids, t, context)
3095+ line2iban = line_obj.line_2_iban(cr, uid, line_ids, t, context)
3096+
3097+ ## Finally populate the current riba with new lines:
3098+ for line in line_obj.browse(cr, uid, line_ids, context=context):
3099+ if riba.date_prefered == "now":
3100+ #no riba date => immediate payment
3101+ date_to_pay = False
3102+ elif riba.date_prefered == 'due':
3103+ date_to_pay = line.date_maturity
3104+ elif riba.date_prefered == 'fixed':
3105+ date_to_pay = riba.date_scheduled
3106+ iban = []
3107+ if line2iban.get(line.id):
3108+ iban = line2iban.get(line.id)
3109+ else:
3110+ raise osv.except_osv('Error', _('No IBAN specified for one o more partner(s)'))
3111+ riba_obj.create(cr, uid,{
3112+ 'move_line_id': line.id,
3113+ 'amount_currency': line.riba_amount_to_pay,
3114+ 'bank_id': line2bank.get(line.id),
3115+ 'order_id': riba.id,
3116+ 'partner_id': line.partner_id and line.partner_id.id or False,
3117+ 'communication': line.ref or '/',
3118+ 'date': date_to_pay,
3119+ 'currency': line.invoice and line.invoice.currency_id.id or False,
3120+ }, context=context)
3121+ return {'type': 'ir.actions.act_window_close'}
3122+
3123+ def search_entries(self, cr, uid, ids, context=None):
3124+ line_obj = self.pool.get('account.move.line')
3125+ mod_obj = self.pool.get('ir.model.data')
3126+ invoice_obj = self.pool.get('account.invoice')
3127+ if context is None:
3128+ context = {}
3129+ data = self.browse(cr, uid, ids, context=context)[0]
3130+ move_id = invoice_obj.search_move_id_riba(cr, uid, ids, context)
3131+ search_due_date = data.duedate
3132+ # Search for move line to pay:
3133+ domain = [('account_id.type', '=', 'receivable'), ('riba_amount_to_pay', '>', 0), ('move_id', 'in', move_id)]
3134+ domain = domain + ['|', ('date_maturity', '<=', search_due_date), ('date_maturity', '=', False)]
3135+ line_ids = line_obj.search(cr, uid, domain, context=context)
3136+ context.update({'line_ids': line_ids})
3137+ model_data_ids = mod_obj.search(cr, uid,[('model', '=', 'ir.ui.view'), ('name', '=', 'view_riba_order_create_lines')], context=context)
3138+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
3139+ return {'name': ('Entrie Lines'),
3140+ 'context': context,
3141+ 'view_type': 'form',
3142+ 'view_mode': 'form',
3143+ 'res_model': 'riba.order.create',
3144+ 'views': [(resource_id,'form')],
3145+ 'type': 'ir.actions.act_window',
3146+ 'target': 'new',
3147+ }
3148+
3149+riba_order_create()
3150+
3151+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3152
3153=== added file 'l10n_it_ri_ba/wizard/riba_issue_order_view.xml'
3154--- l10n_it_ri_ba/wizard/riba_issue_order_view.xml 1970-01-01 00:00:00 +0000
3155+++ l10n_it_ri_ba/wizard/riba_issue_order_view.xml 2012-01-03 08:07:26 +0000
3156@@ -0,0 +1,51 @@
3157+<?xml version="1.0" encoding="utf-8"?>
3158+<openerp>
3159+ <data>
3160+
3161+ <record id="view_riba_order_create" model="ir.ui.view">
3162+ <field name="name">riba.order.create.form</field>
3163+ <field name="model">riba.order.create</field>
3164+ <field name="type">form</field>
3165+ <field name="arch" type="xml">
3166+ <form string=":::Search Riba lines:::">
3167+ <group col="4" colspan="6">
3168+ <field name="duedate" />
3169+ </group>
3170+ <separator colspan="4"/>
3171+ <group col="2" colspan="4">
3172+ <button special="cancel" string="Cancel" icon='gtk-cancel'/>
3173+ <button name="search_entries" string="Search" colspan="1" type="object" icon="gtk-execute"/>
3174+ </group>
3175+ </form>
3176+ </field>
3177+ </record>
3178+
3179+ <record id="view_riba_order_create_lines" model="ir.ui.view">
3180+ <field name="name">riba.order.create.lines.form</field>
3181+ <field name="model">riba.order.create</field>
3182+ <field name="type">form</field>
3183+ <field name="arch" type="xml">
3184+ <form string="Search Riba lines">
3185+ <group col="4" colspan="6">
3186+ </group>
3187+ <separator colspan="4"/>
3188+ <group col="2" colspan="4">
3189+ <button special="cancel" string="Cancel" icon='gtk-cancel'/>
3190+ <button name="create_riba" string="_Add to Riba Order" colspan="1" type="object" icon="gtk-execute"/>
3191+ </group>
3192+ </form>
3193+ </field>
3194+ </record>
3195+
3196+ <record id="action_riba_order_create" model="ir.actions.act_window">
3197+ <field name="name">Populate RiBa</field>
3198+ <field name="type">ir.actions.act_window</field>
3199+ <field name="res_model">riba.order.create</field>
3200+ <field name="view_type">form</field>
3201+ <field name="view_mode">form</field>
3202+ <field name="view_id" ref="view_riba_order_create"/>
3203+ <field name="target">new</field>
3204+ </record>
3205+
3206+ </data>
3207+</openerp>
3208
3209=== added file 'l10n_it_ri_ba/wizard/riba_issue_pay.py'
3210--- l10n_it_ri_ba/wizard/riba_issue_pay.py 1970-01-01 00:00:00 +0000
3211+++ l10n_it_ri_ba/wizard/riba_issue_pay.py 2012-01-03 08:07:26 +0000
3212@@ -0,0 +1,42 @@
3213+# -*- coding: utf-8 -*-
3214+##############################################################################
3215+#
3216+# Copyright (C) 2011 Associazione OpenERP Italia
3217+# (<http://www.openerp-italia.org>).
3218+# All Rights Reserved
3219+# Thanks to Cecchi s.r.l http://www.cecchi.com/
3220+#
3221+# This program is free software: you can redistribute it and/or modify
3222+# it under the terms of the GNU Affero General Public License as published by
3223+# the Free Software Foundation, either version 3 of the License, or
3224+# (at your option) any later version.
3225+#
3226+# This program is distributed in the hope that it will be useful,
3227+# but WITHOUT ANY WARRANTY; without even the implied warranty of
3228+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3229+# GNU General Public License for more details.
3230+#
3231+# You should have received a copy of the GNU Affero General Public License
3232+# along with this program. If not, see <http://www.gnu.org/licenses/>.
3233+#
3234+##############################################################################
3235+
3236+from osv import osv
3237+
3238+class riba_issue_make_payment(osv.osv_memory):
3239+ _name = "riba.issue.make.payment"
3240+ _description = "Riba make issue"
3241+
3242+ def launch_wizard_riba(self, cr, uid, ids, context=None):
3243+ """
3244+ Search for a wizard to launch according to the type.
3245+ If type is manual. just confirm the order.
3246+ """
3247+ obj_riba_order = self.pool.get('riba.order')
3248+ if context is None:
3249+ context = {}
3250+ obj_riba_order.set_done(cr, uid, [context['active_id']], context)
3251+ return {'type': 'ir.actions.act_window_close'}
3252+riba_issue_make_payment()
3253+
3254+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3255
3256=== added file 'l10n_it_ri_ba/wizard/riba_issue_pay_view.xml'
3257--- l10n_it_ri_ba/wizard/riba_issue_pay_view.xml 1970-01-01 00:00:00 +0000
3258+++ l10n_it_ri_ba/wizard/riba_issue_pay_view.xml 2012-01-03 08:07:26 +0000
3259@@ -0,0 +1,33 @@
3260+<?xml version="1.0" encoding="utf-8"?>
3261+<openerp>
3262+ <data>
3263+
3264+ <record id="riba_issue_make_payment_view" model="ir.ui.view">
3265+ <field name="name">riba.issue.make.payment.form</field>
3266+ <field name="model">riba.issue.make.payment</field>
3267+ <field name="type">form</field>
3268+ <field name="arch" type="xml">
3269+ <form string="Make RiBa Issue">
3270+ <separator string="Are you sure you want to make Issue RiBa?"/>
3271+ <newline/>
3272+ <group colspan="2" col="4">
3273+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
3274+ <button name="launch_wizard_riba" string="Yes" type="object" icon="gtk-ok" default_focus="1"/>
3275+ </group>
3276+ </form>
3277+ </field>
3278+ </record>
3279+
3280+ <record id="action_riba_issue_make_payment" model="ir.actions.act_window">
3281+ <field name="name">Make RiBa Issue</field>
3282+ <field name="type">ir.actions.act_window</field>
3283+ <field name="res_model">riba.issue.make.payment</field>
3284+ <field name="view_type">form</field>
3285+ <field name="view_mode">form</field>
3286+ <field name="view_id" ref="riba_issue_make_payment_view"/>
3287+ <field name="target">new</field>
3288+ </record>
3289+
3290+
3291+ </data>
3292+</openerp>