Merge lp:~openbig/bigconsulting/added_object into lp:bigconsulting

Proposed by gpa(OpenERP)
Status: Merged
Merged at revision: 42
Proposed branch: lp:~openbig/bigconsulting/added_object
Merge into: lp:bigconsulting
Diff against target: 52 lines (+7/-4)
2 files modified
account_invoice_cash_discount/account_invoice_cash_discount.py (+2/-1)
account_invoice_cash_discount/wizard/account_pay_invoice.py (+5/-3)
To merge this branch: bzr merge lp:~openbig/bigconsulting/added_object
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+29003@code.launchpad.net

Description of the change

remove pool and added object

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_invoice_cash_discount/account_invoice_cash_discount.py'
2--- account_invoice_cash_discount/account_invoice_cash_discount.py 2010-07-01 12:19:51 +0000
3+++ account_invoice_cash_discount/account_invoice_cash_discount.py 2010-07-01 14:50:52 +0000
4@@ -144,6 +144,8 @@
5
6 tax_obj = self.pool.get('account.tax')
7 invoice_tax_obj = self.pool.get("account.invoice.tax")
8+ move_line_obj = self.pool.get('account.move.line')
9+ move_obj = self.pool.get('account.move')
10
11 if 'amount_currency' in context and context['amount_currency']:
12 amount_currency = context['amount_currency']
13@@ -221,7 +223,6 @@
14 move_line = context['tax_move_ids']
15 for move_line_id in move_line:
16 move_line_data = self.pool.get('account.move.line').browse(cr, uid,move_line_id)
17- print "move_line_data::::::",move_line_data
18 l3 = {
19 'debit': move_line_data.debit,
20 'credit': move_line_data.credit,
21
22=== modified file 'account_invoice_cash_discount/wizard/account_pay_invoice.py'
23--- account_invoice_cash_discount/wizard/account_pay_invoice.py 2010-07-01 12:19:51 +0000
24+++ account_invoice_cash_discount/wizard/account_pay_invoice.py 2010-07-01 14:50:52 +0000
25@@ -135,7 +135,9 @@
26 invoice = self.pool.get('account.invoice').browse(cr, uid, context['id'], context=context)
27 tax_obj = self.pool.get('account.tax')
28 invoice_tax_obj = self.pool.get("account.invoice.tax")
29-
30+ move_obj = self.pool.get('account.move')
31+ move_line_obj = self.pool.get('account.move.line')
32+
33 ######## to get ref
34 if invoice.type in ('in_invoice', 'in_refund'):
35 ref = invoice.reference
36@@ -180,7 +182,7 @@
37 'tax_code_id':tax_value.tax_code_id.id,
38 'tax_amount':tax_amount,
39 }
40- line_id = self.pool.get('account.move.line').create(cr,uid,l3,context=context)
41+ line_id = move_line_obj.create(cr,uid,l3,context=context)
42 line_ids.append(line_id)
43 self.write(cr, uid, ids, {'tax_move_ids':[(6,0,line_ids)]}, context)
44
45@@ -214,7 +216,7 @@
46
47 lines4.append((0, 0, l4))
48 move = {'ref': ref, 'line_id': lines4, 'journal_id': data['journal_id'], 'period_id': data['period_id'], }
49- move_id = self.pool.get('account.move').create(cr, uid, move, context=context)
50+ move_id = move_obj.create(cr, uid, move, context=context)
51 self.write(cr, uid, ids, {'discount_move_ids':[(6,0,[move_id])]}, context)
52 return True
53

Subscribers

People subscribed via source and target branches