Review: Needs Fixing code review
Quick comment on your patch (I've just looked at the code, and did not get a
chance to test it, which I'll be doing later today).
lines 34-37 are not really nice. You should be using the "%.*f" % (precision,
value) syntax for this. Also "dp.get_precision('Product UoM')(cr)[1] or 0" is
quite unparseable to me (and there is to my knowledge no cases where the "or 0"
part will be exercised). I propose the following rewrite of these lines:
if new_qty > returned_qty:
precision = self.pool.get('decimal.precision').precision_get(cr, uid,
'Product UoM'))
raise osv.except_osv(_('Returning Error'),
_('Returning quantity %.*f for %s is larger than the available
quantity %.*f!')\
% (precision, new_qty, move.product_id.name, precision,
returned_qty))
Additional question: will this raise just a warning or plainly forbid such a
return?
For the new sequence name: it should work, but I fear we are loosing the name
of the out picking which is being returned, which can mean that the tracking of
this will become complicated. IMO, the name should be IN/nnnn-OUT/mmmm-return
where OUT/mmmm is the name of the outgoing move, or maybe OUT/mmmm-return-nnnn.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-575526-pso/+merge/109142
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.1-opw-575526-pso.
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp