Merge lp://qastaging/~camptocamp/openerp-humanitarian-ngo/purchase-wkfl-fix_copy_origin-rde into lp://qastaging/openerp-humanitarian-ngo/purchase-wkfl

Proposed by Romain Deheele - Camptocamp
Status: Merged
Merged at revision: 71
Proposed branch: lp://qastaging/~camptocamp/openerp-humanitarian-ngo/purchase-wkfl-fix_copy_origin-rde
Merge into: lp://qastaging/openerp-humanitarian-ngo/purchase-wkfl
Diff against target: 29 lines (+12/-0)
1 file modified
purchase_requisition_extended/model/purchase_order.py (+12/-0)
To merge this branch: bzr merge lp://qastaging/~camptocamp/openerp-humanitarian-ngo/purchase-wkfl-fix_copy_origin-rde
Reviewer Review Type Date Requested Status
Joël Grand-Guillaume @ camptocamp code review + no tests Approve
Nicolas Bessi - Camptocamp (community) code review, no test Approve
Leonardo Pistone code review Needs Fixing
Review via email: mp+203584@code.qastaging.launchpad.net

Description of the change

Hi,

When a cost estimate is confirmed, a copy of chosen rfq is duplicated to create a PO in draftpo state.
The problem was that during this operation the origin is lost, because openerp original orm method copy clears the origin field.
This MP overwrites purchase.order copy to pick origin if PO comes from requisition.

To post a comment you must log in.
Revision history for this message
Leonardo Pistone (lepistone) wrote :

Romain,

I suggest doing that another way, that I find more clear.

if default is None:
    default = {}

initial_origin = default.get('origin')

...super...

if initial_origin:
   ...write...

thanks!

review: Needs Fixing (code review)
72. By Romain Deheele - Camptocamp

[IMP] improve origin checking

Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

I doubt about this MP utility.
It seems that rev 12 in lp:openerp-humanitarian-ngo/addons-backport has introduced
origin cleaning in purchase addon, def copy.
Actually, in stable/ocb addons, origin cleaning in purchase addon is not present.

Romain

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Check on requisition id is missing

review: Needs Fixing
73. By Romain Deheele - Camptocamp

[FIX] forget a condition : only set origin if the PO comes from requisition

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

LGTM thanks

review: Approve (code review + no tests)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches