Merge lp:~sandi-dirntis/openerpsl/openerpsl_20140319_2 into lp:openerpsl/7.0

Proposed by Aleksander Dirntiš
Status: Merged
Merged at revision: 367
Proposed branch: lp:~sandi-dirntis/openerpsl/openerpsl_20140319_2
Merge into: lp:openerpsl/7.0
Diff against target: 108 lines (+30/-38)
3 files modified
account_slovenian/account_invoice.py (+24/-24)
purchase_recalculation/__openerp__.py (+4/-4)
purchase_recalculation/account_invoice.py (+2/-10)
To merge this branch: bzr merge lp:~sandi-dirntis/openerpsl/openerpsl_20140319_2
Reviewer Review Type Date Requested Status
Mentis Pending
Review via email: mp+211732@code.launchpad.net

Description of the change

[FIX] account_slovenian: Fixed creation of double accounting lines
[FIX] purchase_recalculation: Fixed bug when confirming supplier invoice

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_slovenian/account_invoice.py'
2--- account_slovenian/account_invoice.py 2014-03-17 07:50:11 +0000
3+++ account_slovenian/account_invoice.py 2014-03-19 13:59:06 +0000
4@@ -20,27 +20,27 @@
5 #
6 ##############################################################################
7
8-from openerp.osv import osv
9-
10-class account_invoice(osv.Model):
11- _inherit = "account.invoice"
12-
13- def _prepare_refund(self, cr, uid, invoice, date=None, period_id=None, description=None, journal_id=None, context=None):
14- invoice_data = super(account_invoice, self)._prepare_refund(cr, uid, invoice, date, period_id,
15- description, journal_id, context=context)
16- if invoice.type == 'in_invoice':
17- fiscal_position = self.pool.get('account.fiscal.position')
18- for _, _, line_dict in invoice_data['invoice_line']:
19- if line_dict.get('product_id'):
20- product = self.pool.get('product.product').browse(cr, uid, line_dict['product_id'], context=context)
21- counterpart_acct_id = product.property_stock_account_output and \
22- product.property_stock_account_output.id
23- if not counterpart_acct_id:
24- counterpart_acct_id = product.categ_id.property_stock_account_output_categ and \
25- product.categ_id.property_stock_account_output_categ.id
26- if counterpart_acct_id:
27- fpos = invoice.fiscal_position or False
28- line_dict['account_id'] = fiscal_position.map_account(cr, uid,
29- fpos,
30- counterpart_acct_id)
31- return invoice_data
32+# from openerp.osv import osv
33+#
34+# class account_invoice(osv.Model):
35+# _inherit = "account.invoice"
36+#
37+# def _prepare_refund(self, cr, uid, invoice, date=None, period_id=None, description=None, journal_id=None, context=None):
38+# invoice_data = super(account_invoice, self)._prepare_refund(cr, uid, invoice, date, period_id,
39+# description, journal_id, context=context)
40+# if invoice.type == 'in_invoice':
41+# fiscal_position = self.pool.get('account.fiscal.position')
42+# for _, _, line_dict in invoice_data['invoice_line']:
43+# if line_dict.get('product_id'):
44+# product = self.pool.get('product.product').browse(cr, uid, line_dict['product_id'], context=context)
45+# counterpart_acct_id = product.property_stock_account_output and \
46+# product.property_stock_account_output.id
47+# if not counterpart_acct_id:
48+# counterpart_acct_id = product.categ_id.property_stock_account_output_categ and \
49+# product.categ_id.property_stock_account_output_categ.id
50+# if counterpart_acct_id:
51+# fpos = invoice.fiscal_position or False
52+# line_dict['account_id'] = fiscal_position.map_account(cr, uid,
53+# fpos,
54+# counterpart_acct_id)
55+# return invoice_data
56
57=== modified file 'purchase_recalculation/__openerp__.py'
58--- purchase_recalculation/__openerp__.py 2014-03-19 08:55:42 +0000
59+++ purchase_recalculation/__openerp__.py 2014-03-19 13:59:06 +0000
60@@ -33,12 +33,12 @@
61 - change values on customer shipments (outgoing and returns) manually (date of delivery, quantity)\n
62 - change values on supplier shipments (incoming and returns) shipment automatically via supplier invoice or refund (unit price)\n
63
64-Methods:
65-- cost price recalculation for period
66+Methods:\n
67+- cost price recalculation for period\n
68
69-TODO:
70+TODO:\n
71 - change values option on inventory stock moves (date, quantity, unit price)\n
72-- add inventory values to product cost recalculation
73+- add inventory values to product cost recalculation\n
74
75 """,
76 'author': 'Mentis d.o.o.',
77
78=== modified file 'purchase_recalculation/account_invoice.py'
79--- purchase_recalculation/account_invoice.py 2014-03-17 07:50:11 +0000
80+++ purchase_recalculation/account_invoice.py 2014-03-19 13:59:06 +0000
81@@ -39,7 +39,6 @@
82 ctx = {}
83 _costs_installed = self.pool.get('stock.picking.in').fields_get(cr, uid, ['landing_costs_line_ids'], context) != {}
84 _picking_ids = []
85- _return_ids = []
86 for _invoice in self.browse(cr, uid, _invoice_ids, context):
87 if _invoice.type == 'in_invoice':
88 _src_usage = 'supplier'
89@@ -81,16 +80,9 @@
90 ctx['move%s' % (_stock_move.id)] = {'price_unit': _line.price_unit}
91 _updated = True
92 if _updated:
93- if _invoice.type == 'in_invoice':
94- if _stock_move.picking_id.id not in _picking_ids:
95- _picking_ids.append(_stock_move.picking_id.id)
96- elif _invoice.type == 'in_refund':
97- if _stock_move.picking_id.id not in _return_ids:
98- _return_ids.append(_stock_move.picking_id.id)
99+ _picking_ids.append(_stock_move.picking_id.id)
100 if _picking_ids:
101- self.pool.get('stock.picking.in')._picking_update(cr, uid, _picking_ids, ctx)
102- if _return_ids:
103- self.pool.get('stock.picking.out')._picking_update(cr, uid, _return_ids, ctx)
104+ self.pool.get('stock.picking')._picking_update(cr, uid, _picking_ids, ctx)
105 return res
106
107 account_invoice()
108\ No newline at end of file

Subscribers

People subscribed via source and target branches