stock_planning : Needs improvements

Bug #599392 reported by Diego Abad
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
Ujjvala Collins

Bug Description

Hello, I am testing stock_planning module for 6.0, I found this bug.

stock_planning/stock_planning.py
line 355, in product_amt_change
    ret['product_qty'] = rounding(coeff_def2uom * product_amt/(val.product_id.product_tmpl_id.list_price), round_value)
UnboundLocalError: local variable 'rounding' referenced before assignment

To reproduce,
Menu Sales -> Stock and Sales Forecast -> Stock and Sales Forecast
Select one forecast, change to form view, and change product_amt field. The bug is on on_change function.

Tags: trunk
Revision history for this message
Diego Abad (dabada83) wrote :
Changed in openobject-addons:
importance: Undecided → Medium
milestone: none → 6.0
status: New → Confirmed
summary: - trunk stock_planning
+ stock_planning : Needs improvements
Changed in openobject-addons:
assignee: nobody → Harry (Open ERP) (hmo-tinyerp)
Revision history for this message
Grzegorz Grzelak (OpenGLOBE.pl) (grzegorz-og.pl) wrote :

In line 354 you should change rounding to round_value.

Changed in openobject-addons:
assignee: Harry (Open ERP) (hmo-tinyerp) → Sbh (Open ERP) (sbh-openerp)
Revision history for this message
Bhumika Shrimali (sbh-openerp) wrote :

Hello,
        This bug has all ready been fixed in lp:~openerp-dev/openobject-addons/trunk-dev-addons3 branch.
    I have attach the patch for this bug.

Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

hello Diego,

We have fixed the bug in above branch specified by sbh. And the that branch will be merge with trunk addons soon.

Thank you,
Mustufa (mra)

Changed in openobject-addons:
status: Confirmed → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello,

The module still needs refactoring.
Onchange is never supposed to work for unsaved records.

Thanks.

Changed in openobject-addons:
status: Fix Released → Confirmed
Revision history for this message
Richard (John) Nopkins@Servosoft (richard-nopkins) wrote :

Hi Diego, nice posting.
i would rather go for the full module changements.

@Grzegorz Grzelak, très bon travail sur la description du module.

last comment #5 makes more sense for my happy customers.
consistency is amatter of fact: SO,PO and invoicing have onchnages working for new record, it crashes here.

sorry for my bad english. :((

@diego , (is it diego maradona?)

Changed in openobject-addons:
assignee: Sbh (Open ERP) (sbh-openerp) → mtr(OpenERP) (mtr-openerp)
Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) wrote :

Hello,

We have fixed the bug and made improvements in the lp:~openerp-dev/openobject-addons/trunk-dev-addons3 branch.This branch will be merged with trunk addons soon.

Thanks.

Changed in openobject-addons:
status: Confirmed → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
Richard (John) Nopkins@Servosoft (richard-nopkins) wrote :

hi,

des changements impressionnants dans la qualité du code MTR (OpenERP) (MTR-OpenERP).
son vraiment fascinant de voir ce genre de code.

I meaned i am nice to see this qwuality changes. (you mai translaet it).

but,what i felt uncomfortable was why onchange returned null set {} for ids ? it doesnt work for unsaved records.
i repeat #6.

consistency is amatter of fact: SO,PO and invoicing have onchnages working for new record,for an unsaved record, i now get no crash, but it does nothng.

many thnks and wishes.

Changed in openobject-addons:
status: Fix Released → In Progress
Revision history for this message
Richard (John) Nopkins@Servosoft (richard-nopkins) wrote :

if possible, i will attach a patch, but i am not good at python.

Changed in openobject-addons:
assignee: mtr(OpenERP) (mtr-openerp) → uco (Open ERP) (uco-openerp)
Changed in openobject-addons:
status: In Progress → Fix Released
Revision history for this message
Ujjvala Collins (uco-openerp) wrote :

Hello All,

It has has been fixed and committed by revision: 4388 <email address hidden>

Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.