Merge lp:~openerp-dev/openobject-addons/6.1-opw-581974-msh into lp:openobject-addons/6.1

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-581974-msh
Merge into: lp:openobject-addons/6.1
Diff against target: 19 lines (+2/-6)
1 file modified
purchase_requisition/purchase_requisition.py (+2/-6)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-581974-msh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+139393@code.launchpad.net

Description of the change

Hello,

Fixed the issue of schedule date in purchase order line, when purchase order created from purchase requisition, it gives date difference in purchase order date and schedule date even though you have not defined supplier lead time or company purchase lead time.

Demo :- Install Purchase requisition module, Go to Purchase -> Purchase requisition -> create one purchase requisition and select requisition date older than today and convert it to Quotation and now go to Purchase order and find that purchase order which is created from requisition you will see there will be a difference in Purchaser order date and schedule date even though you have not defined any lead time(supplier delay or company purchase lead time).

Reason :- It is because for creating Purchase order from requisition we have used current date but while creating purchase order line we have used requisition date + lead times(_date_planned method) which cause the issue, expected is that we should also consider current date + lead time for purchase order line, we should consider schedule date = date on which we convert to quotation + lead time, otherwise it will give difference.

Example :- Today is 12th December so create a requisition for date 5th December, make sure you have not defined supplier lead time or company purchase lead time, now convert it to quote on date 13th December so schedule date will be 5th December + lead time which is not expected behavior.

Thanks.

To post a comment you must log in.

Unmerged revisions

7101. By Mohammed Shekha(Open ERP)

[FIX]Fixed the issue of schedule date in purchase order line, when purchase order created from purchase requisition, it gives date difference in purchase order date and schedule date even though you have not defined supplier lead time or company purchase leade time.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'purchase_requisition/purchase_requisition.py'
2--- purchase_requisition/purchase_requisition.py 2011-12-23 11:22:41 +0000
3+++ purchase_requisition/purchase_requisition.py 2012-12-12 07:46:22 +0000
4@@ -86,13 +86,9 @@
5
6 def _planned_date(self, requisition, delay=0.0):
7 company = requisition.company_id
8- date_planned = False
9- if requisition.date_start:
10- date_planned = datetime.strptime(requisition.date_start, '%Y-%m-%d %H:%M:%S') - relativedelta(days=company.po_lead)
11- else:
12- date_planned = datetime.today() - relativedelta(days=company.po_lead)
13+ date_planned = datetime.today() - relativedelta(days=company.po_lead)
14 if delay:
15- date_planned -= relativedelta(days=delay)
16+ date_planned += relativedelta(days=delay)
17 return date_planned and date_planned.strftime('%Y-%m-%d %H:%M:%S') or False
18
19 def _seller_details(self, cr, uid, requisition_line, supplier, context=None):