Merge lp:~serpentcs/openerp-usa/serpentcs-openerp-usa-v7-compatability into lp:openerp-usa
- serpentcs-openerp-usa-v7-compatability
- Merge into 7.0
Proposed by
Serpent Consulting Services
Status: | Needs review |
---|---|
Proposed branch: | lp:~serpentcs/openerp-usa/serpentcs-openerp-usa-v7-compatability |
Merge into: | lp:openerp-usa |
Diff against target: |
731 lines (+263/-103) 26 files modified
account_payment_ccapi_authdotnet/__init__.py (+4/-3) account_payment_ccapi_authdotnet/__openerp__.py (+4/-3) account_payment_ccapi_authdotnet/account_voucher.py (+2/-4) account_payment_ccapi_authdotnet/account_voucher.xml (+12/-0) account_payment_ccapi_authdotnet/cc_auth_api.py (+4/-9) account_payment_ccapi_authdotnet/stock_return_picking.py (+1/-2) account_payment_ccapi_authdotnet/stock_view.xml (+0/-6) account_payment_ccapi_authdotnet/wizard/__init__.py (+26/-0) account_payment_ccapi_authdotnet/wizard/account_post_voucher.py (+115/-0) account_payment_ccapi_authdotnet/wizard/account_post_voucher.xml (+37/-0) account_payment_cim_authdotnet/__init__.py (+4/-4) account_payment_cim_authdotnet/__openerp__.py (+10/-10) account_payment_cim_authdotnet/account_voucher.py (+1/-1) account_payment_cim_authdotnet/cim_transaction.py (+0/-1) account_payment_cim_authdotnet/partner.py (+0/-1) account_payment_cim_authdotnet/res_company.py (+2/-2) account_payment_cim_authdotnet/wizard/__init__.py (+4/-4) account_payment_cim_authdotnet/wizard/create_payment_profile.py (+1/-0) account_payment_creditcard/__init__.py (+5/-5) account_payment_creditcard/__openerp__.py (+10/-9) account_payment_creditcard/account_journal.py (+4/-10) account_payment_creditcard/account_voucher.py (+5/-10) account_payment_creditcard/account_voucher_view.xml (+2/-2) account_payment_creditcard/invoice.py (+2/-6) account_payment_creditcard/sale.py (+5/-6) account_payment_creditcard/stock_picking.py (+3/-5) |
To merge this branch: | bzr merge lp:~serpentcs/openerp-usa/serpentcs-openerp-usa-v7-compatability |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Novapoint Group | Pending | ||
Review via email: mp+208740@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 7. By Krutarth Buch
-
optimizations for v7 compatibility
Unmerged revisions
- 7. By Krutarth Buch
-
optimizations for v7 compatibility
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'account_payment_ccapi_authdotnet/__init__.py' |
2 | --- account_payment_ccapi_authdotnet/__init__.py 2014-01-09 18:15:04 +0000 |
3 | +++ account_payment_ccapi_authdotnet/__init__.py 2014-03-07 18:35:55 +0000 |
4 | @@ -20,8 +20,9 @@ |
5 | # |
6 | ############################################################################## |
7 | |
8 | -import account_voucher |
9 | -import cc_auth_api |
10 | -import stock_return_picking |
11 | +from . import account_voucher |
12 | +from . import cc_auth_api |
13 | +from . import stock_return_picking |
14 | +import wizard |
15 | |
16 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
17 | |
18 | === modified file 'account_payment_ccapi_authdotnet/__openerp__.py' |
19 | --- account_payment_ccapi_authdotnet/__openerp__.py 2014-01-09 18:15:04 +0000 |
20 | +++ account_payment_ccapi_authdotnet/__openerp__.py 2014-03-07 18:35:55 +0000 |
21 | @@ -28,10 +28,11 @@ |
22 | """, |
23 | 'author': 'NovaPoint Group LLC', |
24 | 'website': ' http://www.novapointgroup.com', |
25 | - 'depends': ['account_voucher_credits_us'], |
26 | + 'depends': ['account_payment_creditcard'], |
27 | 'data': [ |
28 | - 'account_voucher.xml', |
29 | - 'security/ir.model.access.csv', |
30 | + 'wizard/account_post_voucher.xml', |
31 | + 'account_voucher.xml', |
32 | + 'security/ir.model.access.csv', |
33 | ], |
34 | 'demo': [ |
35 | ], |
36 | |
37 | === modified file 'account_payment_ccapi_authdotnet/account_voucher.py' |
38 | --- account_payment_ccapi_authdotnet/account_voucher.py 2014-01-09 18:15:04 +0000 |
39 | +++ account_payment_ccapi_authdotnet/account_voucher.py 2014-03-07 18:35:55 +0000 |
40 | @@ -22,12 +22,10 @@ |
41 | |
42 | from openerp.osv import osv, fields |
43 | |
44 | -class account_voucher(osv.osv): |
45 | +class account_voucher(osv.Model): |
46 | |
47 | _inherit = 'account.voucher' |
48 | |
49 | _columns = { |
50 | 'origin':fields.char('Origin', size=16, help='Mentions the reference of Sale/Purchase document'), |
51 | - } |
52 | - |
53 | -account_voucher() |
54 | + } |
55 | \ No newline at end of file |
56 | |
57 | === modified file 'account_payment_ccapi_authdotnet/account_voucher.xml' |
58 | --- account_payment_ccapi_authdotnet/account_voucher.xml 2014-01-09 18:15:04 +0000 |
59 | +++ account_payment_ccapi_authdotnet/account_voucher.xml 2014-03-07 18:35:55 +0000 |
60 | @@ -23,6 +23,18 @@ |
61 | </field> |
62 | </record> |
63 | |
64 | + <record model="ir.ui.view" id="view_vendor_receipt_form_5"> |
65 | + <field name="name">account.voucher.receipt.form.5</field> |
66 | + <field name="model">account.voucher</field> |
67 | + <field name="inherit_id" ref="account_voucher.view_vendor_receipt_form"/> |
68 | + <field name="arch" type="xml"> |
69 | + <xpath expr="//form/header/button[@name='proforma_voucher']" position="replace"> |
70 | + <button name="%(action_proforma_voucher)d" string="Post" states="draft" type="action" |
71 | + attrs="{'invisible': ['|',('cc_info_hide','=',False),('state','<>','draft')]}" icon="terp-camera_test"/> |
72 | + </xpath> |
73 | + </field> |
74 | + </record> |
75 | + |
76 | </data> |
77 | </openerp> |
78 | |
79 | |
80 | === modified file 'account_payment_ccapi_authdotnet/cc_auth_api.py' |
81 | --- account_payment_ccapi_authdotnet/cc_auth_api.py 2014-01-09 18:15:04 +0000 |
82 | +++ account_payment_ccapi_authdotnet/cc_auth_api.py 2014-03-07 18:35:55 +0000 |
83 | @@ -48,7 +48,7 @@ |
84 | raise AuthnetAIMError('Incorrect parameters passed to setParameter(): {0}:{1}'.format(key, value)) |
85 | return parameters |
86 | |
87 | -class auth_net_cc_api(osv.osv): |
88 | +class auth_net_cc_api(osv.Model): |
89 | _name = "auth.net.cc.api" |
90 | ''' |
91 | Class to do credit card transaction |
92 | @@ -495,9 +495,7 @@ |
93 | |
94 | return ret |
95 | |
96 | -auth_net_cc_api() |
97 | - |
98 | -class account_voucher(osv.osv): |
99 | +class account_voucher(osv.Model): |
100 | |
101 | _inherit = 'account.voucher' |
102 | ''' |
103 | @@ -524,9 +522,7 @@ |
104 | def cc_refund(self, cr, uid, ids, context=None): |
105 | return self.pool.get('auth.net.cc.api').do_this_transaction(cr, uid, ids, refund=True, context=context) |
106 | |
107 | -account_voucher() |
108 | - |
109 | -class sale_order(osv.osv): |
110 | +class sale_order(osv.Model): |
111 | _inherit = "sale.order" |
112 | |
113 | def _get_prod_acc(self, product_id, journal_obj, context=False): |
114 | @@ -604,6 +600,5 @@ |
115 | if sale.order_policy == 'credit_card': |
116 | self.pool.get('account.invoice').action_cancel(cr, uid, [inv.id], {}) |
117 | return super(sale_order, self).action_cancel(cr, uid, ids, context) |
118 | - |
119 | -sale_order() |
120 | + |
121 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
122 | |
123 | === modified file 'account_payment_ccapi_authdotnet/stock_return_picking.py' |
124 | --- account_payment_ccapi_authdotnet/stock_return_picking.py 2014-01-09 18:15:04 +0000 |
125 | +++ account_payment_ccapi_authdotnet/stock_return_picking.py 2014-03-07 18:35:55 +0000 |
126 | @@ -108,7 +108,7 @@ |
127 | |
128 | stock_return_picking() |
129 | |
130 | -class stock_picking(osv.osv): |
131 | +class stock_picking(osv.Model): |
132 | |
133 | _inherit = "stock.picking" |
134 | _columns = { |
135 | @@ -172,7 +172,6 @@ |
136 | voucher_obj.write(cr, uid, [pick.voucher_id.id], {'cc_refund_amt':amount}, context=context) |
137 | self.pool.get('auth.net.cc.api').do_this_transaction(cr, uid, [pick.voucher_id.id] , refund=True, context=context) |
138 | return res |
139 | -stock_picking() |
140 | |
141 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
142 | |
143 | |
144 | === removed file 'account_payment_ccapi_authdotnet/stock_view.xml' |
145 | --- account_payment_ccapi_authdotnet/stock_view.xml 2014-01-09 18:15:04 +0000 |
146 | +++ account_payment_ccapi_authdotnet/stock_view.xml 1970-01-01 00:00:00 +0000 |
147 | @@ -1,6 +0,0 @@ |
148 | -<?xml version="1.0" encoding="UTF-8"?> |
149 | -<openerp> |
150 | - <data> |
151 | - |
152 | - </data> |
153 | -</openerp> |
154 | \ No newline at end of file |
155 | |
156 | === added directory 'account_payment_ccapi_authdotnet/wizard' |
157 | === added file 'account_payment_ccapi_authdotnet/wizard/__init__.py' |
158 | --- account_payment_ccapi_authdotnet/wizard/__init__.py 1970-01-01 00:00:00 +0000 |
159 | +++ account_payment_ccapi_authdotnet/wizard/__init__.py 2014-03-07 18:35:55 +0000 |
160 | @@ -0,0 +1,26 @@ |
161 | +# -*- coding: utf-8 -*- |
162 | +############################################################################## |
163 | +# |
164 | +# OpenERP, Open Source Management Solution |
165 | +# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) |
166 | +# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) |
167 | +# |
168 | +# This program is free software: you can redistribute it and/or modify |
169 | +# it under the terms of the GNU General Public License as published by |
170 | +# the Free Software Foundation, either version 3 of the License, or |
171 | +# (at your option) any later version. |
172 | +# |
173 | +# This program is distributed in the hope that it will be useful, |
174 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
175 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
176 | +# GNU General Public License for more details. |
177 | +# |
178 | +# You should have received a copy of the GNU General Public License |
179 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
180 | +# |
181 | +############################################################################## |
182 | + |
183 | +from . import account_post_voucher |
184 | + |
185 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
186 | + |
187 | |
188 | === added file 'account_payment_ccapi_authdotnet/wizard/account_post_voucher.py' |
189 | --- account_payment_ccapi_authdotnet/wizard/account_post_voucher.py 1970-01-01 00:00:00 +0000 |
190 | +++ account_payment_ccapi_authdotnet/wizard/account_post_voucher.py 2014-03-07 18:35:55 +0000 |
191 | @@ -0,0 +1,115 @@ |
192 | +# -*- coding: utf-8 -*- |
193 | +############################################################################## |
194 | +# |
195 | +# OpenERP, Open Source Management Solution |
196 | +# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) |
197 | +# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) |
198 | +# |
199 | +# This program is free software: you can redistribute it and/or modify |
200 | +# it under the terms of the GNU General Public License as published by |
201 | +# the Free Software Foundation, either version 3 of the License, or |
202 | +# (at your option) any later version. |
203 | +# |
204 | +# This program is distributed in the hope that it will be useful, |
205 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
206 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
207 | +# GNU General Public License for more details. |
208 | +# |
209 | +# You should have received a copy of the GNU General Public License |
210 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
211 | +# |
212 | +############################################################################## |
213 | + |
214 | +from openerp.osv import fields, osv |
215 | +from tools.translate import _ |
216 | + |
217 | +class account_post_voucher(osv.TransientModel): |
218 | + _name = 'account.post.voucher' |
219 | + _description = 'Account Pay Voucher' |
220 | + _columns = { |
221 | + 'total_paid': fields.float('Total Received'), |
222 | + 'total_allocated': fields.float('Total Allocated'), |
223 | + 'ok_to_go': fields.float('OK to Go'), |
224 | + } |
225 | + |
226 | + def _get_total_paid(self, cr, uid, context=None): |
227 | + """ |
228 | + @param cr: current row of the database |
229 | + @param uid: id of the user currently logged in |
230 | + @param context: context |
231 | + @return: total amount |
232 | + """ |
233 | + if context is None: |
234 | + context = {} |
235 | + obj_voucher = self.pool.get('account.voucher') |
236 | + amount = 0.00 |
237 | + if context.get('active_id'): |
238 | + amount = obj_voucher.browse(cr, uid, context['active_id'], context=context).amount |
239 | + |
240 | + return amount |
241 | + |
242 | + def _get_total_allocated(self, cr, uid, context=None): |
243 | + """ |
244 | + @param cr: current row of the database |
245 | + @param uid: id of the user currently logged in |
246 | + @param context: context |
247 | + @return: total allocated amount |
248 | + """ |
249 | + if context is None: |
250 | + context = {} |
251 | + obj_voucher = self.pool.get('account.voucher') |
252 | + voucher = obj_voucher.browse(cr, uid, context.get('active_id', []), context=context) |
253 | + total_allocated = 0.0 |
254 | + for line in voucher.line_cr_ids: |
255 | + total_allocated += line.amount |
256 | + |
257 | + return total_allocated |
258 | + |
259 | + def _get_ok_to_go(self, cr, uid, context=None): |
260 | + """ |
261 | + @param cr: current row of the database |
262 | + @param uid: id of the user currently logged in |
263 | + @param context: context |
264 | + @return: |
265 | + """ |
266 | + if context is None: |
267 | + context = {} |
268 | + obj_voucher = self.pool.get('account.voucher') |
269 | + voucher = obj_voucher.browse(cr, uid, context.get('active_id', []), context=context) |
270 | + total_allocated = 0.0 |
271 | + if context.get('invoice_type', '') == 'out_refund': |
272 | + return total_allocated |
273 | + for line in voucher.line_cr_ids: |
274 | + total_allocated += line.amount |
275 | + return total_allocated - voucher.amount |
276 | + |
277 | + _defaults = { |
278 | + 'total_paid': _get_total_paid, |
279 | + 'total_allocated': _get_total_allocated, |
280 | + 'ok_to_go': _get_ok_to_go, |
281 | + } |
282 | + |
283 | + def onchange_ok_to_go(self, cr, uid, ids, ok_to_go, context=None): |
284 | + """ |
285 | + @param cr: current row of the database |
286 | + @param uid: id of the user currently logged in |
287 | + @param ids: ids of the selected records |
288 | + @param ok_to_go: |
289 | + @param context: context |
290 | + @return: |
291 | + """ |
292 | + if ok_to_go > 0.0: |
293 | + return {'warning': {'title': _('Overallocated invoices'), 'message': _('Reduce allocations to match Total Receipt')}} |
294 | + return {'value': {}} |
295 | + |
296 | + def launch_wizard(self, cr, uid, ids, context=None): |
297 | + """ |
298 | + Don't allow post if total_allocated > total_paid. |
299 | + """ |
300 | + if context is None: |
301 | + context = {} |
302 | + obj_voucher = self.pool.get('account.voucher') |
303 | + obj_voucher.action_move_line_create(cr, uid, context.get('active_ids', []), context=context) |
304 | + return {} |
305 | + |
306 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
307 | |
308 | === added file 'account_payment_ccapi_authdotnet/wizard/account_post_voucher.xml' |
309 | --- account_payment_ccapi_authdotnet/wizard/account_post_voucher.xml 1970-01-01 00:00:00 +0000 |
310 | +++ account_payment_ccapi_authdotnet/wizard/account_post_voucher.xml 2014-03-07 18:35:55 +0000 |
311 | @@ -0,0 +1,37 @@ |
312 | +<?xml version="1.0" encoding="utf-8"?> |
313 | +<openerp> |
314 | + <data> |
315 | + <!-- Account post voucher Form --> |
316 | + |
317 | + <record id="account_voucher_post_view" model="ir.ui.view"> |
318 | + <field name="name">account.post.voucher.form</field> |
319 | + <field name="model">account.post.voucher</field> |
320 | + <field name="arch" type="xml"> |
321 | + <form string="Post Voucher"> |
322 | + <group colspan="2" col="4"> |
323 | + <field name="total_paid" readonly="True"/> |
324 | + <field name="total_allocated" readonly="True"/> |
325 | + <field name="ok_to_go" invisible="True" on_change="onchange_ok_to_go(ok_to_go)"/> |
326 | + </group> |
327 | + <group height="100" width="320"> |
328 | + <separator string="Confirm Amounts?"/> |
329 | + <newline/> |
330 | + <group colspan="2" col="4"> |
331 | + <button special="cancel" string="Cancel" icon="gtk-cancel"/> |
332 | + <button name="launch_wizard" string="Yes" type="object" attrs="{'invisible':[('ok_to_go', '>', 0.0)]}" icon="gtk-ok" default_focus="1"/> |
333 | + </group> |
334 | + </group> |
335 | + </form> |
336 | + </field> |
337 | + </record> |
338 | + |
339 | + <record id="action_proforma_voucher" model="ir.actions.act_window"> |
340 | + <field name="name">Post Voucher</field> |
341 | + <field name="type">ir.actions.act_window</field> |
342 | + <field name="res_model">account.post.voucher</field> |
343 | + <field name="view_id" ref="account_voucher_post_view"/> |
344 | + <field name="target">new</field> |
345 | + </record> |
346 | + |
347 | + </data> |
348 | +</openerp> |
349 | |
350 | === modified file 'account_payment_cim_authdotnet/__init__.py' |
351 | --- account_payment_cim_authdotnet/__init__.py 2014-01-09 18:15:04 +0000 |
352 | +++ account_payment_cim_authdotnet/__init__.py 2014-03-07 18:35:55 +0000 |
353 | @@ -20,10 +20,10 @@ |
354 | # |
355 | ############################################################################## |
356 | |
357 | -import res_company |
358 | -import partner |
359 | -import account_voucher |
360 | -import cim_transaction |
361 | +from . import res_company |
362 | +from . import partner |
363 | +from . import account_voucher |
364 | +from . import cim_transaction |
365 | import wizard |
366 | |
367 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
368 | |
369 | === modified file 'account_payment_cim_authdotnet/__openerp__.py' |
370 | --- account_payment_cim_authdotnet/__openerp__.py 2014-01-09 18:15:04 +0000 |
371 | +++ account_payment_cim_authdotnet/__openerp__.py 2014-03-07 18:35:55 +0000 |
372 | @@ -29,17 +29,17 @@ |
373 | """, |
374 | 'author': 'NovaPoint Group LLC', |
375 | 'website': ' http://www.novapointgroup.com', |
376 | - 'depends': ['account_payment_ccapi_authdotnet'], |
377 | + 'depends': ['account_payment_creditcard'], |
378 | 'data': [ |
379 | - 'security/ir.model.access.csv', |
380 | - 'wizard/edit_payment_profile_view.xml', |
381 | - 'wizard/make_transaction_view.xml', |
382 | - 'wizard/delete_payment_profile_view.xml', |
383 | - 'wizard/create_payment_profile_view.xml', |
384 | - 'cim_transaction_view.xml', |
385 | - 'partner_view.xml', |
386 | - 'company_view.xml', |
387 | - 'account_voucher_view.xml' |
388 | + 'security/ir.model.access.csv', |
389 | + 'wizard/edit_payment_profile_view.xml', |
390 | + 'wizard/make_transaction_view.xml', |
391 | + 'wizard/delete_payment_profile_view.xml', |
392 | + 'wizard/create_payment_profile_view.xml', |
393 | + 'cim_transaction_view.xml', |
394 | + 'partner_view.xml', |
395 | + 'company_view.xml', |
396 | + 'account_voucher_view.xml' |
397 | ], |
398 | 'demo': [ |
399 | ], |
400 | |
401 | === modified file 'account_payment_cim_authdotnet/account_voucher.py' |
402 | --- account_payment_cim_authdotnet/account_voucher.py 2014-01-09 18:15:04 +0000 |
403 | +++ account_payment_cim_authdotnet/account_voucher.py 2014-03-07 18:35:55 +0000 |
404 | @@ -707,7 +707,7 @@ |
405 | 'trans_type' : 'AuthOnly' |
406 | } |
407 | |
408 | -class Stock_Picking(osv.osv): |
409 | +class Stock_Picking(osv.Model): |
410 | _inherit = 'stock.picking' |
411 | |
412 | def ddo_partial(self, cr, uid, ids, partial_datas, context=None): |
413 | |
414 | === modified file 'account_payment_cim_authdotnet/cim_transaction.py' |
415 | --- account_payment_cim_authdotnet/cim_transaction.py 2014-01-09 18:15:04 +0000 |
416 | +++ account_payment_cim_authdotnet/cim_transaction.py 2014-03-07 18:35:55 +0000 |
417 | @@ -55,7 +55,6 @@ |
418 | } |
419 | |
420 | _defaults = { |
421 | - 'use_default':False, |
422 | 'partner_id': _get_partner, |
423 | } |
424 | |
425 | |
426 | === modified file 'account_payment_cim_authdotnet/partner.py' |
427 | --- account_payment_cim_authdotnet/partner.py 2014-01-09 18:15:04 +0000 |
428 | +++ account_payment_cim_authdotnet/partner.py 2014-03-07 18:35:55 +0000 |
429 | @@ -217,5 +217,4 @@ |
430 | |
431 | return ret |
432 | |
433 | -res_partner() |
434 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
435 | |
436 | === modified file 'account_payment_cim_authdotnet/res_company.py' |
437 | --- account_payment_cim_authdotnet/res_company.py 2014-01-09 18:15:04 +0000 |
438 | +++ account_payment_cim_authdotnet/res_company.py 2014-03-07 18:35:55 +0000 |
439 | @@ -24,7 +24,7 @@ |
440 | class res_company(osv.Model): |
441 | _inherit = "res.company" |
442 | _columns = { |
443 | - 'auth_config_id':fields.many2one('auth.config', 'Auth Configuration')} |
444 | -res_company() |
445 | + 'auth_config_id':fields.many2one('auth.config', 'Auth Configuration') |
446 | + } |
447 | |
448 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
449 | |
450 | === modified file 'account_payment_cim_authdotnet/wizard/__init__.py' |
451 | --- account_payment_cim_authdotnet/wizard/__init__.py 2014-01-09 18:15:04 +0000 |
452 | +++ account_payment_cim_authdotnet/wizard/__init__.py 2014-03-07 18:35:55 +0000 |
453 | @@ -20,9 +20,9 @@ |
454 | # |
455 | ############################################################################## |
456 | |
457 | -import create_payment_profile |
458 | -import make_transaction |
459 | -import edit_payment_profile |
460 | -import delete_payment_profile |
461 | +from . import create_payment_profile |
462 | +from . import make_transaction |
463 | +from . import edit_payment_profile |
464 | +from . import delete_payment_profile |
465 | |
466 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
467 | |
468 | === modified file 'account_payment_cim_authdotnet/wizard/create_payment_profile.py' |
469 | --- account_payment_cim_authdotnet/wizard/create_payment_profile.py 2014-01-09 18:15:04 +0000 |
470 | +++ account_payment_cim_authdotnet/wizard/create_payment_profile.py 2014-03-07 18:35:55 +0000 |
471 | @@ -90,6 +90,7 @@ |
472 | |
473 | def _clean_string(self, text): |
474 | lis = ['\t', '\n'] |
475 | + print "text",text |
476 | if type(text) != type(''): |
477 | text = str(text) |
478 | for t in lis: |
479 | |
480 | === modified file 'account_payment_creditcard/__init__.py' |
481 | --- account_payment_creditcard/__init__.py 2014-01-09 18:15:04 +0000 |
482 | +++ account_payment_creditcard/__init__.py 2014-03-07 18:35:55 +0000 |
483 | @@ -20,10 +20,10 @@ |
484 | # |
485 | ############################################################################## |
486 | |
487 | -import account_voucher |
488 | -import account_journal |
489 | -import stock_picking |
490 | -import sale |
491 | -import invoice |
492 | +from . import sale |
493 | +from . import account_voucher |
494 | +from . import account_journal |
495 | +from . import stock_picking |
496 | +from . import invoice |
497 | import rsa_encrypt |
498 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
499 | |
500 | === modified file 'account_payment_creditcard/__openerp__.py' |
501 | --- account_payment_creditcard/__openerp__.py 2014-01-09 18:15:04 +0000 |
502 | +++ account_payment_creditcard/__openerp__.py 2014-03-07 18:35:55 +0000 |
503 | @@ -30,15 +30,16 @@ |
504 | """, |
505 | 'author': 'NovaPoint Group LLC', |
506 | 'website': ' http://www.novapointgroup.com', |
507 | - 'depends': ['sale_stock', 'account_voucher'], |
508 | - 'data': ['security/account_security.xml', |
509 | - 'security/ir.model.access.csv', |
510 | - 'account_voucher_view.xml', |
511 | - 'account_journal_view.xml', |
512 | - 'stock_picking_view.xml', |
513 | - 'invoice_view.xml', |
514 | - 'sale_stock_view.xml', |
515 | - ], |
516 | + 'depends': ['sale_stock','sale', 'account_voucher', 'stock'], |
517 | + 'data': [ |
518 | + 'security/account_security.xml', |
519 | + 'security/ir.model.access.csv', |
520 | + 'account_voucher_view.xml', |
521 | + 'account_journal_view.xml', |
522 | + 'stock_picking_view.xml', |
523 | + 'invoice_view.xml', |
524 | + 'sale_stock_view.xml', |
525 | + ], |
526 | 'demo': [], |
527 | # 'test': ['test/account_payment_creditcard.yml'], |
528 | 'installable': True, |
529 | |
530 | === modified file 'account_payment_creditcard/account_journal.py' |
531 | --- account_payment_creditcard/account_journal.py 2014-01-09 18:15:04 +0000 |
532 | +++ account_payment_creditcard/account_journal.py 2014-03-07 18:35:55 +0000 |
533 | @@ -23,16 +23,14 @@ |
534 | from openerp.osv import osv, fields |
535 | import rsa_encrypt |
536 | |
537 | -class account_journal(osv.osv): |
538 | +class account_journal(osv.Model): |
539 | _inherit = "account.journal" |
540 | _columns = { |
541 | 'cc_allow_processing': fields.boolean('Allow Credit Card Processing',), |
542 | 'cc_allow_refunds': fields.boolean('Allow Credit Card Refunds',), |
543 | } |
544 | -account_journal() |
545 | - |
546 | - |
547 | -class res_partner(osv.osv): |
548 | + |
549 | +class res_partner(osv.Model): |
550 | _inherit = "res.partner" |
551 | |
552 | def write(self, cr, uid, ids, vals, context=None): |
553 | @@ -44,9 +42,7 @@ |
554 | result = super(res_partner, self).write(cr, uid, ids, vals, context) |
555 | return True |
556 | |
557 | -res_partner() |
558 | - |
559 | -class res_partner_bank(osv.osv): |
560 | +class res_partner_bank(osv.Model): |
561 | '''Bank Accounts''' |
562 | |
563 | _inherit = "res.partner.bank" |
564 | @@ -156,7 +152,5 @@ |
565 | } |
566 | default.update(vals) |
567 | return super(res_partner_bank, self).copy(cr, uid, id, default=default, context=context) |
568 | - |
569 | -res_partner_bank() |
570 | |
571 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
572 | \ No newline at end of file |
573 | |
574 | === modified file 'account_payment_creditcard/account_voucher.py' |
575 | --- account_payment_creditcard/account_voucher.py 2014-01-09 18:15:04 +0000 |
576 | +++ account_payment_creditcard/account_voucher.py 2014-03-07 18:35:55 +0000 |
577 | @@ -31,7 +31,7 @@ |
578 | def __str__(self): |
579 | return str(self.parameter) |
580 | |
581 | -class account_voucher(osv.osv): |
582 | +class account_voucher(osv.Model): |
583 | |
584 | def setParameter(self, parameters={}, key=None, value=None): |
585 | |
586 | @@ -291,11 +291,8 @@ |
587 | res['value']['cc_reseller'] = cardholder_details['title'] == 'Reseller' and True or False |
588 | res['value']['cc_save_card_details'] = False |
589 | |
590 | - res['value']['cc_info_hide'] = True |
591 | - if jorurnal_cc_allow: |
592 | - res['value']['cc_info_hide'] = False |
593 | - |
594 | - if cc_allow_refunds: |
595 | + res['value']['cc_info_hide'] = False |
596 | + if jorurnal_cc_allow and cc_allow_refunds: |
597 | res['value']['cc_info_hide'] = True |
598 | |
599 | context.update({'sale_id':sale_id}) |
600 | @@ -313,6 +310,7 @@ |
601 | line['amount'] = line['amount_original'] |
602 | lines.append(line) |
603 | res['value']['line_cr_ids'] = lines |
604 | + print "RES ",res |
605 | return res |
606 | |
607 | def recompute_voucher_lines(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None): |
608 | @@ -497,9 +495,7 @@ |
609 | self.pool.get('transaction.details').create(cr, uid, vals, context=context) |
610 | return True |
611 | |
612 | -account_voucher() |
613 | - |
614 | -class res_company(osv.osv): |
615 | +class res_company(osv.Model): |
616 | ''' |
617 | Add credit card details on company configuration |
618 | ''' |
619 | @@ -510,7 +506,6 @@ |
620 | 'cc_testmode': fields.boolean('Test Mode'), |
621 | 'cc_journal_id':fields.many2one('account.journal', 'Payment Method', help="The default payment method on payment voucher open using the Pay button from sale order."), |
622 | } |
623 | -res_company() |
624 | |
625 | class transaction_details(osv.Model): |
626 | _name = "transaction.details" |
627 | |
628 | === modified file 'account_payment_creditcard/account_voucher_view.xml' |
629 | --- account_payment_creditcard/account_voucher_view.xml 2014-01-09 18:15:04 +0000 |
630 | +++ account_payment_creditcard/account_voucher_view.xml 2014-03-07 18:35:55 +0000 |
631 | @@ -18,8 +18,8 @@ |
632 | <field name="inherit_id" ref="account_voucher.view_vendor_receipt_form"/> |
633 | <field name="arch" type="xml"> |
634 | <xpath expr="//notebook" position="inside"> |
635 | - <page string="Credit Card Details" attrs="{'invisible': [('cc_info_hide','=',True)]}"> |
636 | - <group string="Cardholder details"> |
637 | + <page string="Credit Card Details" attrs="{'invisible': [('cc_info_hide','=',False)]}"> |
638 | + <group string="Cardholder details" > |
639 | <field name="cc_info_hide" invisible="1"/> |
640 | <field name="cc_reseller" invisible="1"/> |
641 | <field name="cc_transaction" invisible="1"/> |
642 | |
643 | === modified file 'account_payment_creditcard/invoice.py' |
644 | --- account_payment_creditcard/invoice.py 2014-01-09 18:15:04 +0000 |
645 | +++ account_payment_creditcard/invoice.py 2014-03-07 18:35:55 +0000 |
646 | @@ -23,7 +23,7 @@ |
647 | from openerp.osv import osv, fields |
648 | from openerp.tools.translate import _ |
649 | |
650 | -class account_invoice(osv.osv): |
651 | +class account_invoice(osv.Model): |
652 | |
653 | _inherit = 'account.invoice' |
654 | |
655 | @@ -53,10 +53,6 @@ |
656 | _columns = { |
657 | 'credit_card' : fields.boolean('Credit Card', readonly=True) |
658 | } |
659 | - |
660 | - _defaults = { |
661 | - 'credit_card' : False |
662 | - } |
663 | -account_invoice() |
664 | + |
665 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
666 | |
667 | |
668 | === modified file 'account_payment_creditcard/sale.py' |
669 | --- account_payment_creditcard/sale.py 2014-01-09 18:15:04 +0000 |
670 | +++ account_payment_creditcard/sale.py 2014-03-07 18:35:55 +0000 |
671 | @@ -23,7 +23,7 @@ |
672 | from tools.translate import _ |
673 | import netsvc |
674 | |
675 | -class sale_order(osv.osv): |
676 | +class sale_order(osv.Model): |
677 | _inherit = "sale.order" |
678 | |
679 | # def onchange_partner_id(self, cr, uid, ids, part_id, context={}): |
680 | @@ -199,10 +199,10 @@ |
681 | 'invoiced': fields.function(_invoiced, method=True, string='Paid', |
682 | type='boolean', help="It indicates that an invoice has been paid.", |
683 | store={ |
684 | - 'account.invoice' : (_get_invoice, ['state'], 20), |
685 | - 'sale.order' : (lambda self, cr, uid, ids, c={}: ids, ['state'], 20), |
686 | - 'account.voucher' : (_get_voucher, ['state'], 20), |
687 | - }), |
688 | + 'account.invoice' : (_get_invoice, ['state'], 20), |
689 | + 'sale.order' : (lambda self, cr, uid, ids, c={}: ids, ['state'], 20), |
690 | + 'account.voucher' : (_get_voucher, ['state'], 20), |
691 | + }), |
692 | 'cc_ship_refund' : fields.boolean('Ship Refunded', readonly=True), |
693 | } |
694 | |
695 | @@ -229,4 +229,3 @@ |
696 | for pick in sale_obj.picking_ids: |
697 | self.pool.get('stock.picking.out').write(cr, uid, [pick.id], {'invoice_state': 'credit_card'}, context=context) |
698 | return ret |
699 | -sale_order() |
700 | |
701 | === modified file 'account_payment_creditcard/stock_picking.py' |
702 | --- account_payment_creditcard/stock_picking.py 2014-01-09 18:15:04 +0000 |
703 | +++ account_payment_creditcard/stock_picking.py 2014-03-07 18:35:55 +0000 |
704 | @@ -23,7 +23,7 @@ |
705 | |
706 | from openerp.osv import fields, osv |
707 | |
708 | -class stock_picking(osv.osv): |
709 | +class stock_picking(osv.Model): |
710 | |
711 | _inherit = "stock.picking" |
712 | ''' |
713 | @@ -64,9 +64,7 @@ |
714 | 'ship_message': fields.text('Message'), |
715 | } |
716 | |
717 | -stock_picking() |
718 | - |
719 | -class stock_picking_out(osv.osv): |
720 | +class stock_picking_out(osv.Model): |
721 | |
722 | _inherit = "stock.picking.out" |
723 | |
724 | @@ -80,7 +78,7 @@ |
725 | ], "Invoice Control", select=True, required=True, readonly=True, states={'draft': [('readonly', False)]}), |
726 | } |
727 | |
728 | -class stock_picking_in(osv.osv): |
729 | +class stock_picking_in(osv.Model): |
730 | |
731 | _inherit = "stock.picking.in" |
732 |