Merge lp:~openerp-dev/openobject-addons/trunk-bug-1095652-rmu into lp:openobject-addons

Proposed by Ravish(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1095652-rmu
Merge into: lp:openobject-addons
Diff against target: 43 lines (+14/-1)
2 files modified
account/account_bank_statement.py (+13/-0)
account_payment/test/payment_order_process.yml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1095652-rmu
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+142284@code.launchpad.net

Description of the change

Hello,

I have been fixed in lp:~openerp-dev/openobject-addons/trunk-bug-1095652-rmu with Following Revision ID and Revison Number

Revision ID: <email address hidden>.
Revision No:8496.

Thanks,

To post a comment you must log in.
8497. By Ravish(OpenERP)

Improved the code

Unmerged revisions

8497. By Ravish(OpenERP)

Improved the code

8496. By Ravish(OpenERP)

added constraints in period for same period date

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_bank_statement.py'
2--- account/account_bank_statement.py 2012-12-20 11:54:56 +0000
3+++ account/account_bank_statement.py 2013-01-09 10:38:23 +0000
4@@ -20,6 +20,7 @@
5 ##############################################################################
6
7 import time
8+from datetime import datetime
9
10 from openerp.osv import fields, osv
11 from openerp.tools.translate import _
12@@ -148,6 +149,18 @@
13 _constraints = [
14 (_check_company_id, 'The journal and period chosen have to belong to the same company.', ['journal_id','period_id']),
15 ]
16+
17+ def _check_period_id(self, cr, uid, ids, context=None):
18+ statement = self.browse(cr, uid, ids[0], context=context)
19+ period_month = (datetime.strptime(statement.period_id.date_start,'%Y-%m-%d')).month
20+ date_month = (datetime.strptime(statement.date,'%Y-%m-%d')).month
21+ if date_month != period_month:
22+ return False
23+ return True
24+
25+ _constraints = [
26+ (_check_period_id, 'The date and period chosen have to belong to the same month.', ['date','period_id']),]
27+
28
29 def onchange_date(self, cr, uid, ids, date, company_id, context=None):
30 """
31
32=== modified file 'account_payment/test/payment_order_process.yml'
33--- account_payment/test/payment_order_process.yml 2012-01-31 13:36:57 +0000
34+++ account_payment/test/payment_order_process.yml 2013-01-09 10:38:23 +0000
35@@ -82,7 +82,7 @@
36 !record {model: account.bank.statement, id: account_bank_statement_1}:
37 balance_end_real: 0.0
38 balance_start: 0.0
39- date: !eval time.strftime('%Y-%m-%d')
40+ date: !eval time.strftime('%Y-10-%d')
41 journal_id: account.bank_journal
42 name: /
43 period_id: account.period_10

Subscribers

People subscribed via source and target branches

to all changes: