Merge lp:~openerp-dev/openobject-addons/trunk-bug-813329-bde into lp:openobject-addons

Proposed by Bharat Devnani (Open ERP)
Status: Merged
Merged at revision: 5152
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-813329-bde
Merge into: lp:openobject-addons
Diff against target: 48 lines (+11/-12)
1 file modified
account_anglo_saxon/invoice.py (+11/-12)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-813329-bde
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Approve
Review via email: mp+68652@code.launchpad.net

Description of the change

Hello Sir,

I have added the company_id in product_id_change method in account_anglo_saxon module.

Thanks & Regards,
Devnani Bharat R.

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Improve little code.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_anglo_saxon/invoice.py'
2--- account_anglo_saxon/invoice.py 2011-01-14 00:11:01 +0000
3+++ account_anglo_saxon/invoice.py 2011-09-15 13:36:46 +0000
4@@ -134,14 +134,13 @@
5 'taxes':line.get('taxes',[]),
6 })
7 res += diff_res
8- return res
9-
10- def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
11+ return res
12+
13+ def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None, company_id=None):
14+ fiscal_pool = self.pool.get('account.fiscal.position')
15+ res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context, company_id)
16 if not product:
17- return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context)
18- else:
19- res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context)
20-
21+ return res
22 if type in ('in_invoice','in_refund'):
23 product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
24 if type == 'in_invoice':
25@@ -153,11 +152,11 @@
26 if not oa:
27 oa = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id
28 if oa:
29- fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id, context=context) or False
30- a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
31- res['value'].update({'account_id':a})
32+ fpos = fposition_id and fiscal_pool.browse(cr, uid, fposition_id, context=context) or False
33+ a = fiscal_pool.map_account(cr, uid, fpos, oa)
34+ res['value'].update({'account_id':a})
35 return res
36-
37+
38 account_invoice_line()
39
40 class account_invoice(osv.osv):
41@@ -180,6 +179,6 @@
42 line.update({'account_id': (account_data['id'],account_data['name'])})
43 res = super(account_invoice,self)._refund_cleanup_lines(cr, uid, lines)
44 return res
45-
46+
47 account_invoice()
48 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Subscribers

People subscribed via source and target branches

to all changes: