Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BOM creation, when you save the line it is not displayed until page refresh. #14326

Closed
simon3p opened this issue Jul 31, 2020 · 6 comments
Closed
Labels
Bug This is a bug (something does not work as expected)

Comments

@simon3p
Copy link

simon3p commented Jul 31, 2020

Bug

In module MRP, creating or modifying a BOM, new lines doesn't show until page refresh. Modifying existing line doesn't show new values on save until page refresh.

Environment

  • Version: 12.0.1
  • OS: Ubuntu 18.04 Server
  • Web server: Apache/2.4.29
  • PHP: 7.2.24
  • Database: MariaDB 5.5.5-10.1.44
  • URL(s): /bom/bom_card.php

Expected and actual behaviour

Added or saved lines will show right away.

Steps to reproduce the behavior

Go to MRP -> New bill of material -> Input name, product ant qty -> Create.
On the next screen, try add à new line (select à product, set qty and other values -> Click ADD button). The new line form is reset but the line (despite being correctly writed to database) does not show in the card. Reloading the BOM will show the line (Refreshing the page or navigate away and come back to this BOM).

Similar thing happen when modifying an existing line. New values doesn't show until page relaod.

@simon3p simon3p added the Bug This is a bug (something does not work as expected) label Jul 31, 2020
@StephaneLesage
Copy link
Contributor

+1
I confirm on v12.0.1, debian, french

@erikvanberkum
Copy link
Contributor

Further confirm that this bug is still available in 12.0.2

@yianisn
Copy link

yianisn commented Sep 1, 2020

+1
confirmed in 12.0.2, ubuntu 18.04, mariaDB 10.5

@simon3p
Copy link
Author

simon3p commented Oct 26, 2020

Ok, dont know why this issue has been closed but the problem still partially exist on 12.0.3.

The issue have been corrected on the line update but not on the line add.

Fortunately it's an easy fix, edit the file : /dolibar_root_folder/htdocs/bom/bom_card.php

Around line 181 / 186, change :

{
    			unset($_POST['idprod']);
    			unset($_POST['qty']);
    			unset($_POST['qty_frozen']);
    		        unset($_POST['disable_stock_change']);
    		}

To

{
    			unset($_POST["idprod"]);
    			unset($_POST["qty"]);
    			unset($_POST["qty_frozen"]);
    		        unset($_POST["disable_stock_change"]);

                        $object->fetchLines()
    		}

If you are on a version prior to 12.0.3 do the same thing around lines 223 / 229.

@erikvanberkum
Copy link
Contributor

Simon3P that did the job, thanks for the easy fix. Hope this will be included in the next release

@erikvanberkum
Copy link
Contributor

While the above code works their is still a redirecting issue when reloading the page.
it redirects to bom_card.php?id=27#addline this results in not showing the prices
it should redirect to bom_card.php?id=27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

4 participants