Merge lp:~openerp-dev/openobject-addons/trunk-bug-1129089-bhavesh into lp:openobject-addons

Proposed by Bhavesh Tilvani(OpenERP-Trainee)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1129089-bhavesh
Merge into: lp:openobject-addons
Diff against target: 26 lines (+8/-1)
1 file modified
account_budget/account_budget.py (+8/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1129089-bhavesh
Reviewer Review Type Date Requested Status
Lionel Sausin - Initiatives/Numérigraphe (community) Approve
Serpent Consulting Services (community) Approve
OpenERP Core Team Pending
Review via email: mp+151706@code.launchpad.net

This proposal supersedes a proposal from 2013-03-01.

Description of the change

Hello,

Improved as per your suggestion

Thanks,
Bhavesh.

To post a comment you must log in.
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote : Posted in a previous version of this proposal

Bhavesh,

This can be improved by the following way.

_constraints = [
    (_check_dates, _('Start date must be configured earlier than End date!'), ['date_to','date_from'])
]

Thanks.

review: Needs Fixing
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Good work Bhavesh,

Sounds good now!

Thank you for quick reaction.

review: Approve
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) :
review: Approve

Unmerged revisions

8560. By Bhavesh Tilvani(OpenERP-Trainee)

[IMP] Start date-End date constraint.

8559. By Bhavesh Tilvani(OpenERP-Trainee)

[FIX/ADD] constraint: start date must be lower than end date

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_budget/account_budget.py'
--- account_budget/account_budget.py 2012-12-17 15:23:03 +0000
+++ account_budget/account_budget.py 2013-03-05 09:22:23 +0000
@@ -185,7 +185,12 @@
185 else:185 else:
186 res[line.id] = 0.00186 res[line.id] = 0.00
187 return res187 return res
188188 def _check_dates(self, cr, uid, ids, context=None):
189 for date in self.read(cr, uid, ids, ['date_to', 'date_from'], context=context):
190 if date['date_to'] and date['date_from']:
191 if date['date_from'] > date['date_to']:
192 return False
193 return True
189 _name = "crossovered.budget.lines"194 _name = "crossovered.budget.lines"
190 _description = "Budget Line"195 _description = "Budget Line"
191 _columns = {196 _columns = {
@@ -202,6 +207,8 @@
202 'company_id': fields.related('crossovered_budget_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)207 'company_id': fields.related('crossovered_budget_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
203 }208 }
204209
210 _constraints = [
211 (_check_dates, _('Start date must be configured earlier than End date!'), ['date_to','date_from'])]
205crossovered_budget_lines()212crossovered_budget_lines()
206213
207class account_analytic_account(osv.osv):214class account_analytic_account(osv.osv):

Subscribers

People subscribed via source and target branches

to all changes: