[RFC] stock_barcodes_gs1: add AI 310 barcode value
dalonsod opened this issue · 3 comments
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
(like 3102
, 3.50 kg => 00350) is usually used, that we've tested that is successfully filled in base_gs1_barcode
decode method as 310
key.
In my case I'd simply solve if this piece of code:
both 37
and 310
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
because barcode_decoded
dict with all values (including my desired 310
alternative quantity) is not available for hook method.
Why should be the proper approach for this?
- Create a simply PR accepting
310
quantity when37
is not filled (enough for my scenario, and immediately available for everyone). - Pass
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?
Well, IMO, I see another option 🤔
Add the hook of product_qty here:
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.