Closed dalonsod closed 3 months ago
Well, IMO, I see another option :thinking:
Add the hook of product_qty here: https://github.com/OCA/stock-logistics-barcode/blob/63a0576ccce0fbffa04ca8765e4622c0c92eba77/stock_barcodes_gs1/wizard/stock_barcodes_read.py#L89
We should do that in order to pass the product and package to the hook, that would be cleaner and we could decide to use 310 when the unit of the product is of a weight kind. WDYT?
Hi. Why not add the hook here:
Create a method to get product_qty from (37) by default if exists in barcode else get from 310 or 330 (net and gross).. if three keys exist in the same scan read ... mnhhuuuu I don't know jaja
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.
Hello,
according current implementation of
stock_barcodes_gs1
addon, only (01, 02, 10, 37
) AIs are implemented. For product quantity,37
is used, but it should be altered via_process_product_qty_gs1
hook method within main processing method (https://github.com/OCA/stock-logistics-barcode/blob/14.0/stock_barcodes_gs1/wizard/stock_barcodes_read.py#L91).For those who e.g. work with net weights as quantity unit,
310x
(like3102
, 3.50 kg => 00350) is usually used, that we've tested that is successfully filled inbase_gs1_barcode
decode method as310
key.In my case I'd simply solve if this piece of code:
https://github.com/OCA/stock-logistics-barcode/blob/63a0576ccce0fbffa04ca8765e4622c0c92eba77/stock_barcodes_gs1/wizard/stock_barcodes_read.py#L67C9-L67C21
both
37
and310
should be accepted. But, if this proposal shouldn't be a good approach (this could be inconsistent with current implementation and could be rejected), I cannot use hook method_process_product_qty_gs1
becausebarcode_decoded
dict with all values (including my desired310
alternative quantity) is not available for hook method.Why should be the proper approach for this?
310
quantity when37
is not filled (enough for my scenario, and immediately available for everyone).barcode_decoded
to hook method, so me and other people could make our custom implementation with another addon (and try to call it even ifproduct_qty
is not initially filled).I could make a PR with the finest solution.
@sergio-teruel @etobella what do you think?
cc @ChristianSantamaria