Merge lp:~openerp-dev/openobject-addons/trunk-bug-777522-aag into lp:openobject-addons

Proposed by Atik Agewan(OpenERP)
Status: Merged
Merged at revision: 5331
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-777522-aag
Merge into: lp:openobject-addons
Diff against target: 177 lines (+28/-29)
5 files modified
stock/i18n/stock.pot (+3/-3)
stock/product.py (+9/-10)
stock/product_view.xml (+1/-1)
stock/stock.py (+12/-12)
stock/stock_demo.xml (+3/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-777522-aag
Reviewer Review Type Date Requested Status
Atik Agewan(OpenERP) (community) Needs Resubmitting
Rucha (Open ERP) (community) Needs Fixing
qdp (OpenERP) Needs Fixing
Review via email: mp+77283@code.launchpad.net

Description of the change

 Hello,

   Stock:Rename string "Stock Variation Account" to "Stock Valuation Account"

 Thanks
  Atik

To post a comment you must log in.
Revision history for this message
Rucha (Open ERP) (rpa-openerp) :
review: Approve
Revision history for this message
qdp (OpenERP) (qdp) wrote :

it's better to change name in the code too as we are on a trunk version (but not for long, so it's better to do it now).

So please, change also the field name into 'property_stock_valuation_account_id'

thanks,
Quentin

review: Needs Fixing
Revision history for this message
Atik Agewan(OpenERP) (aag-openerp) wrote :

Hello,

  Stock:Change field name property_stock_variation into property_stock_valuation_account_id.

 Thanks
  Atik

review: Needs Resubmitting
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

I have seen that there is still one remaining reference to the old property name in stock/stock.py
can you please check that,
also change the name in pot,
thanks

review: Needs Fixing
Revision history for this message
Atik Agewan(OpenERP) (aag-openerp) wrote :

 Hello ,

   changes are done as per your suggestion.

 Thanks
  Atik

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/i18n/stock.pot'
2--- stock/i18n/stock.pot 2011-03-17 17:33:16 +0000
3+++ stock/i18n/stock.pot 2011-10-10 11:37:19 +0000
4@@ -1978,8 +1978,8 @@
5 msgstr ""
6
7 #. module: stock
8-#: field:product.category,property_stock_variation:0
9-msgid "Stock Variation Account"
10+#: field:product.category,property_stock_valuation_account_id:0
11+msgid "Stock Valuation Account"
12 msgstr ""
13
14 #. module: stock
15@@ -2036,7 +2036,7 @@
16 msgstr ""
17
18 #. module: stock
19-#: help:product.category,property_stock_variation:0
20+#: help:product.category,property_stock_valuation_account_id:0
21 msgid "When real-time inventory valuation is enabled on a product, this account will hold the current value of the products."
22 msgstr ""
23
24
25=== modified file 'stock/product.py'
26--- stock/product.py 2011-08-28 01:17:39 +0000
27+++ stock/product.py 2011-10-10 11:37:19 +0000
28@@ -44,13 +44,12 @@
29 stock_output_acc = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id or False
30
31 journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False
32- account_variation = product_obj.categ_id.property_stock_variation and product_obj.categ_id.property_stock_variation.id or False
33-
34+ account_valuation = product_obj.categ_id.property_stock_valuation_account_id and product_obj.categ_id.property_stock_valuation_account_id.id or False
35 return {
36 'stock_account_input': stock_input_acc,
37 'stock_account_output': stock_output_acc,
38 'stock_journal': journal_id,
39- 'property_stock_variation': account_variation
40+ 'property_stock_valuation_account_id': account_valuation
41 }
42
43 def do_change_standard_price(self, cr, uid, ids, datas, context=None):
44@@ -71,9 +70,9 @@
45 stock_input_acc = datas.get('stock_input_account', False)
46 journal_id = datas.get('stock_journal', False)
47 product_obj=self.browse(cr, uid, ids, context=context)[0]
48- account_variation = product_obj.categ_id.property_stock_variation
49- account_variation_id = account_variation and account_variation.id or False
50- if not account_variation_id: raise osv.except_osv(_('Error!'), _('Variation Account is not specified for Product Category: %s') % (product_obj.categ_id.name))
51+ account_valuation = product_obj.categ_id.property_stock_valuation_account_id
52+ account_valuation_id = account_valuation and account_valuation.id or False
53+ if not account_valuation_id: raise osv.except_osv(_('Error!'), _('Valuation Account is not specified for Product Category: %s') % (product_obj.categ_id.name))
54 move_ids = []
55 loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
56 for rec_id in ids:
57@@ -132,7 +131,7 @@
58 })
59 move_line_obj.create(cr, uid, {
60 'name': product.categ_id.name,
61- 'account_id': account_variation_id,
62+ 'account_id': account_valuation_id,
63 'credit': amount_diff,
64 'move_id': move_id
65 })
66@@ -158,7 +157,7 @@
67 })
68 move_line_obj.create(cr, uid, {
69 'name': product.categ_id.name,
70- 'account_id': account_variation_id,
71+ 'account_id': account_valuation_id,
72 'debit': amount_diff,
73 'move_id': move_id
74 })
75@@ -449,10 +448,10 @@
76 type='many2one', relation='account.account',
77 string='Stock Output Account', view_load=True,
78 help='When doing real-time inventory valuation, counterpart Journal Items for all outgoing stock moves will be posted in this account. This is the default value for all products in this category, it can also directly be set on each product.'),
79- 'property_stock_variation': fields.property('account.account',
80+ 'property_stock_valuation_account_id': fields.property('account.account',
81 type='many2one',
82 relation='account.account',
83- string="Stock Variation Account",
84+ string="Stock Valuation Account",
85 view_load=True,
86 help="When real-time inventory valuation is enabled on a product, this account will hold the current value of the products.",),
87 }
88
89=== modified file 'stock/product_view.xml'
90--- stock/product_view.xml 2011-09-29 05:14:07 +0000
91+++ stock/product_view.xml 2011-10-10 11:37:19 +0000
92@@ -27,7 +27,7 @@
93 <separator string="Accounting Stock Properties" colspan="2"/>
94 <field name="property_stock_account_input_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
95 <field name="property_stock_account_output_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
96- <field name="property_stock_variation"/>
97+ <field name="property_stock_valuation_account_id"/>
98 <field name="property_stock_journal"/>
99 </group>
100 </form>
101
102=== modified file 'stock/stock.py'
103--- stock/stock.py 2011-09-27 21:38:03 +0000
104+++ stock/stock.py 2011-10-10 11:37:19 +0000
105@@ -2033,14 +2033,14 @@
106 else:
107 acc_dest = accounts['stock_account_output']
108
109- acc_variation = accounts.get('property_stock_variation', False)
110+ acc_valuation = accounts.get('property_stock_valuation_account_id', False)
111 journal_id = accounts['stock_journal']
112
113- if acc_dest == acc_variation:
114- raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Output Account defined on this product and Variant account on category of this product are same.'))
115+ if acc_dest == acc_valuation:
116+ raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Output Account defined on this product and Valuation account on category of this product are same.'))
117
118- if acc_src == acc_variation:
119- raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Input Account defined on this product and Variant account on category of this product are same.'))
120+ if acc_src == acc_valuation:
121+ raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Input Account defined on this product and Valuation account on category of this product are same.'))
122
123 if not acc_src:
124 raise osv.except_osv(_('Error!'), _('There is no stock input account defined for this product or its category: "%s" (id: %d)') % \
125@@ -2051,10 +2051,10 @@
126 if not journal_id:
127 raise osv.except_osv(_('Error!'), _('There is no journal defined on the product category: "%s" (id: %d)') % \
128 (move.product_id.categ_id.name, move.product_id.categ_id.id,))
129- if not acc_variation:
130- raise osv.except_osv(_('Error!'), _('There is no inventory variation account defined on the product category: "%s" (id: %d)') % \
131+ if not acc_valuation:
132+ raise osv.except_osv(_('Error!'), _('There is no inventory Valuation account defined on the product category: "%s" (id: %d)') % \
133 (move.product_id.categ_id.name, move.product_id.categ_id.id,))
134- return journal_id, acc_src, acc_dest, acc_variation
135+ return journal_id, acc_src, acc_dest, acc_valuation
136
137 def _get_reference_accounting_values_for_valuation(self, cr, uid, move, context=None):
138 """
139@@ -2104,17 +2104,17 @@
140 if move.location_id.company_id \
141 and (move.location_id.usage == 'internal' and move.location_dest_id.usage != 'internal'\
142 or move.location_id.company_id != move.location_dest_id.company_id):
143- journal_id, acc_src, acc_dest, acc_variation = self._get_accounting_data_for_valuation(cr, uid, move, src_company_ctx)
144+ journal_id, acc_src, acc_dest, acc_valuation = self._get_accounting_data_for_valuation(cr, uid, move, src_company_ctx)
145 reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx)
146- account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_variation, acc_dest, reference_amount, reference_currency_id, context))]
147+ account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_valuation, acc_dest, reference_amount, reference_currency_id, context))]
148
149 # Incoming moves (or cross-company input part)
150 if move.location_dest_id.company_id \
151 and (move.location_id.usage != 'internal' and move.location_dest_id.usage == 'internal'\
152 or move.location_id.company_id != move.location_dest_id.company_id):
153- journal_id, acc_src, acc_dest, acc_variation = self._get_accounting_data_for_valuation(cr, uid, move, dest_company_ctx)
154+ journal_id, acc_src, acc_dest, acc_valuation = self._get_accounting_data_for_valuation(cr, uid, move, dest_company_ctx)
155 reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx)
156- account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_src, acc_variation, reference_amount, reference_currency_id, context))]
157+ account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_src, acc_valuation, reference_amount, reference_currency_id, context))]
158
159 move_obj = self.pool.get('account.move')
160 for j_id, move_lines in account_moves:
161
162=== modified file 'stock/stock_demo.xml'
163--- stock/stock_demo.xml 2011-07-19 10:46:31 +0000
164+++ stock/stock_demo.xml 2011-10-10 11:37:19 +0000
165@@ -260,9 +260,9 @@
166 <field name="lot_input_id" ref="stock_location_shop1"/>
167 </record>
168
169- <record forcecreate="True" id="property_stock_variation" model="ir.property">
170- <field name="name">property_stock_variation</field>
171- <field name="fields_id" search="[('model','=','product.category'),('name','=','property_stock_variation')]"/>
172+ <record forcecreate="True" id="property_stock_valuation_account_id" model="ir.property">
173+ <field name="name">property_stock_valuation_account_id</field>
174+ <field name="fields_id" search="[('model','=','product.category'),('name','=','property_stock_valuation_account_id')]"/>
175 <field eval="'account.account,'+str(ref('account.a_recv'))" model="account.account" name="value"/>
176 <field name="company_id" ref="base.main_company"/>
177 </record>

Subscribers

People subscribed via source and target branches

to all changes: