Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0044622Openbravo ERP04. Warehouse managementpublic2020-07-16 14:212020-11-23 12:22
gorkaion 
inigo_lerga 
highmajoralways
closedfixed 
5
 
PR20Q4 
Core
No
0044622: Attribute required check in M_TRANSACTION_TRG trigger should be relaxed
In the M_Transaction_TRG trigger there is a check to enforce that an attribute set instance is defined for products that requires attributes

This check already has an exception to regularize stock with Physical Inventories.

There are known scenarios that require new exceptions to this check. Most of them involve creating transactions when there is no stock of the product.

Known cases:
1. POS selling products with no available stock and the Use Attributes preference disabled.
2. AutoBOM executing a production with the preference to consume all the required ingredients quantity even if there is no stock available.
3. BOM Production with the flag to consume all required products when there is not enough stock.
POS Case. It is working because it throws the triggers.
1. Ensure use attributes preferences is not enabled.
2. Sell a item that uses attributes and that does not have stock.

AutoBOM Case. It is required to use an old version, in latest triggers are disabled so it does not fail.
1. Create a BOM with ingredients that use attributes.
2. Ensure that there is not enougth stock of those ingredients.
3. Enable preference to allow negative stock on ingredients.
4. Sell the autobom.


BOM Production.
1. Create a BOM Product using parts that require attributes
2. Ensure that parts do not have enough stock
3. Create a new production and check the flag to consume all the required part quantities.
4. It creates production lines with no attributes for the parts with no stock.
5. Process it and check failure.

Relax the check to allow no attributes when there is no stock of the product on the transaction storage bin.
No tags attached.
related to defect 0045477 closed AtulOpenbravo Openbravo ERP Attribute required check in M_TRANSACTION_TRG trigger should allow when stock is zero 
blocks defect 0044596 closed ranjith_qualiantech_com Retail Modules Wrong M_STORAGE_DETAIL table when using AutoBOM with attributes and no stock 
Issue History
2020-07-16 14:21gorkaionNew Issue
2020-07-16 14:21gorkaionAssigned To => Triage Finance
2020-07-16 14:21gorkaionModules => Core
2020-07-16 14:21gorkaionResolution time => 1596664800
2020-07-16 14:21gorkaionTriggers an Emergency Pack => No
2020-07-16 14:24gorkaionRelationship addedblocks 0044596
2020-07-20 12:21ngarciaIssue Monitored: ngarcia
2020-07-22 10:15dmiguelezAssigned ToTriage Finance => inigo_lerga
2020-07-23 10:00inigo_lergaStatusnew => scheduled
2020-07-27 15:56hgbotNote Added: 0121643
2020-07-27 16:36inigo_lergaNote Added: 0121648
2020-07-28 09:52inigo_lergaNote Edited: 0121648bug_revision_view_page.php?bugnote_id=0121648#r21404
2020-07-28 12:59inigo_lergaNote Edited: 0121648bug_revision_view_page.php?bugnote_id=0121648#r21405
2020-07-28 13:00inigo_lergaNote Edited: 0121648bug_revision_view_page.php?bugnote_id=0121648#r21406
2020-07-31 10:47hgbotNote Added: 0121735
2020-07-31 10:47hgbotResolutionopen => fixed
2020-07-31 10:47hgbotStatusscheduled => closed
2020-07-31 10:47hgbotFixed in Version => PR20Q4
2020-07-31 10:47hgbotNote Added: 0121736
2020-11-23 12:22gorkaionIssue cloned0045477
2020-11-23 12:22gorkaionRelationship addedrelated to 0045477

Notes
(0121643)
hgbot   
2020-07-27 15:56   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/116 [^]
(0121648)
inigo_lerga   
2020-07-27 16:36   
(edited on: 2020-07-28 13:00)
--Test Plan Mantis HQL--
First of All, the M_INOUT_POST function in the BBDD needs to be modified
to get to execute the code of this Issue. Erase the lines from 382 to 388 (both included).
Moreover, the M_PRODUCT_TRG BBDD trigger needs to be disabled.
Also, retails modules need to be installed to use The White Valley data.

As the The White Valley Group Admin role in Backend (with a specific Organization such as Vall Blanca Store):
  - Go to Attribute window and create a new record with name "Color".
    In the Attribute Value Tab create two records, one for "Blue" and one for "Red".

  - Go to Product window and open the record for "Adhesive body warmers".
    Set any Attribute Set desired (a pre-existing one is fine).
    Now open that Attribute Set in the Attribute Set window and go to the Assigned Attribute Tab and create a new record with preciously created Attribute (Color).

  - Go to Goods Shipment window and create a new record for any Business Partner
    desired.
    Go to Lines Tab and create a new record for "Adhesive body warmers". Leave the
    Attribute Set Value empty. Select the "VBS/001 0-0-0" Storage Bin (which already
    has the negative stock needed to test the fix) and set 10 units as Operative
    Quantity.
    Save the record and Complete it.

#Now this workflow is successfully executed"

(0121735)
hgbot   
2020-07-31 10:47   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/116 [^]
(0121736)
hgbot   
2020-07-31 10:47   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: a1cfccefe7c93d2fc73538269f3ae58393f5b4f6
Author: IƱigo Lerga Valencia <inigo.lerga@openbravo.com>
Date: 2020-07-31T08:47:06+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/a1cfccefe7c93d2fc73538269f3ae58393f5b4f6 [^]

fixes BUG-44622:Condition relaxed in M_TRANSACTION_TRG trigger

When the stock of a product is negative (and the record is a
movementLine, sales inoutLine or productionLine) there is no need
to specify the attribute value of the product.

---
M src-db/database/model/triggers/M_TRANSACTION_TRG.xml
---