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

Proposed by Bharat Devnani (Open ERP)
Status: Rejected
Rejected by: qdp (OpenERP)
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-871314-bde
Merge into: lp:openobject-addons
Diff against target: 79 lines (+23/-7)
2 files modified
account/account.py (+20/-4)
account/account_view.xml (+3/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-871314-bde
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Approve
Bharat Devnani (Open ERP) (community) Needs Resubmitting
qdp (OpenERP) Pending
Review via email: mp+78811@code.launchpad.net

Description of the change

Hello Sir,

I have applied the patch of Stéphane Bidoul, after applying the patch the Journal Entries can be duplicated.

Thanks & Regards,
Devnani Bharat R.

To post a comment you must log in.
Revision history for this message
qdp (OpenERP) (qdp) wrote :

i reject the merge proposal, for the reasons explained in the bug.

thanks

Revision history for this message
qdp (OpenERP) (qdp) wrote :

mmhm i need to reconsider that merge prop

Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Bharat,

Try to follow python coding standard, declare pool variable at beginning of method and pass context in write method too.
Above changes will make your Merge proposal more consistent.

Thanks,
Mustufa

review: Needs Fixing
5324. By Bharat Devnani (Open ERP)

[IMP] account : improved the coding style, variable name and passed the context argument in write method of account/account.py

Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

Hello Sir,

Thanks for your kind suggestion, i have improved the changes on the coding conventions, variable naming convention and also passed context argument in write methods.

Thanks & Regards,
Devnani Bharat R.

review: Needs Resubmitting
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Seems good now.

Note: After comma there should be one space.

Thank you,
Mustufa

review: Approve
5325. By Bharat Devnani (Open ERP)

[IMP] account : improved the useability in def onchange_journal_id and onchange_period_id of account/account.py

Revision history for this message
qdp (OpenERP) (qdp) wrote :

as explained on the bug report, i choosed another solution to fix the problem so i'm rejecting the merge prop.

thanks

Unmerged revisions

5325. By Bharat Devnani (Open ERP)

[IMP] account : improved the useability in def onchange_journal_id and onchange_period_id of account/account.py

5324. By Bharat Devnani (Open ERP)

[IMP] account : improved the coding style, variable name and passed the context argument in write method of account/account.py

5323. By Stéphane Bidoul

[FIX] account : cannot duplicate journal entries

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/account.py'
--- account/account.py 2011-10-02 17:31:16 +0000
+++ account/account.py 2011-10-12 05:56:27 +0000
@@ -367,8 +367,8 @@
367367
368 move_obj = self.pool.get('account.move.line')368 move_obj = self.pool.get('account.move.line')
369 move_id = move_obj.search(cr, uid, [369 move_id = move_obj.search(cr, uid, [
370 ('journal_id','=',jids[0]), 370 ('journal_id','=',jids[0]),
371 ('period_id','=',pids[0]), 371 ('period_id','=',pids[0]),
372 ('account_id','=', account_id),372 ('account_id','=', account_id),
373 (name,'>', 0.0),373 (name,'>', 0.0),
374 ('name','=', _('Opening Balance'))374 ('name','=', _('Opening Balance'))
@@ -930,7 +930,7 @@
930 _sql_constraints = [930 _sql_constraints = [
931 ('name_company_uniq', 'unique(name, company_id)', 'The name of the period must be unique per company!'),931 ('name_company_uniq', 'unique(name, company_id)', 'The name of the period must be unique per company!'),
932 ]932 ]
933 933
934 def _check_duration(self,cr,uid,ids,context=None):934 def _check_duration(self,cr,uid,ids,context=None):
935 obj_period = self.browse(cr, uid, ids[0], context=context)935 obj_period = self.browse(cr, uid, ids[0], context=context)
936 if obj_period.date_stop < obj_period.date_start:936 if obj_period.date_stop < obj_period.date_start:
@@ -1564,6 +1564,22 @@
1564 valid_moves = [move.id for move in valid_moves]1564 valid_moves = [move.id for move in valid_moves]
1565 return len(valid_moves) > 0 and valid_moves or False1565 return len(valid_moves) > 0 and valid_moves or False
15661566
1567 def onchange_journal_id(self, cr, uid, ids, journal_id, context=None):
1568 account_move_line_obj = self.pool.get('account.move.line')
1569 if journal_id:
1570 for move in self.browse(cr, uid, ids, context=context):
1571 line_ids = [line.id for line in move.line_id]
1572 account_move_line_obj.write(cr, uid, line_ids, {'journal_id': journal_id}, context=context)
1573 return {}
1574
1575 def onchange_period_id(self, cr, uid, ids, period_id, context=None):
1576 account_move_line_obj = self.pool.get('account.move.line')
1577 if period_id:
1578 for move in self.browse(cr, uid, ids, context=context):
1579 line_ids = [line.id for line in move.line_id]
1580 account_move_line_obj.write(cr, uid, line_ids, {'period_id': period_id}, context=context)
1581 return {}
1582
1567account_move()1583account_move()
15681584
1569class account_move_reconcile(osv.osv):1585class account_move_reconcile(osv.osv):
@@ -2177,7 +2193,7 @@
2177 entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}2193 entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
2178 except:2194 except:
2179 raise osv.except_osv(_('Wrong model !'), _('You have a wrong expression "%(...)s" in your model !'))2195 raise osv.except_osv(_('Wrong model !'), _('You have a wrong expression "%(...)s" in your model !'))
2180 2196
2181 move_id = account_move_obj.create(cr, uid, {2197 move_id = account_move_obj.create(cr, uid, {
2182 'ref': entry['name'],2198 'ref': entry['name'],
2183 'period_id': period_id,2199 'period_id': period_id,
21842200
=== modified file 'account/account_view.xml'
--- account/account_view.xml 2011-10-11 14:03:35 +0000
+++ account/account_view.xml 2011-10-12 05:56:27 +0000
@@ -752,7 +752,7 @@
752 <group col="2" colspan="2">752 <group col="2" colspan="2">
753 <separator string="Reporting Configuration" colspan="4"/>753 <separator string="Reporting Configuration" colspan="4"/>
754 <field name="report_type" select="2"/>754 <field name="report_type" select="2"/>
755 <field name="sign" /> 755 <field name="sign" />
756 </group>756 </group>
757 <group col="2" colspan="2">757 <group col="2" colspan="2">
758 <separator string="Closing Method" colspan="4"/>758 <separator string="Closing Method" colspan="4"/>
@@ -1318,8 +1318,8 @@
1318 <field name="name" readonly="True"/>1318 <field name="name" readonly="True"/>
1319 <field name="ref"/>1319 <field name="ref"/>
1320 <field name="to_check" groups="base.group_extended"/>1320 <field name="to_check" groups="base.group_extended"/>
1321 <field name="journal_id"/>1321 <field name="journal_id" on_change="onchange_journal_id(journal_id)"/>
1322 <field name="period_id"/>1322 <field name="period_id" on_change="onchange_period_id(period_id)"/>
1323 <field name="date"/>1323 <field name="date"/>
1324 <field name="company_id" required="1" groups="base.group_multi_company"/>1324 <field name="company_id" required="1" groups="base.group_multi_company"/>
1325 <field name="partner_id" invisible="1"/>1325 <field name="partner_id" invisible="1"/>

Subscribers

People subscribed via source and target branches

to all changes: