Repository navigation
[ADD] barcode_gs1_stock: the GS1 measure as the quantity, in the product's unit - #9
Conversation
40da2c4 to
05231b5
Compare
05231b5 to
b00bad4
Compare
b00bad4 to
8069e4b
Compare
|
This PR has the |
|
/ocabot merge nobump |
|
What a great day to merge this nice PR. Let's do it! |
|
@jelenapoblet The merge process could not be finalized, because command |
|
@OCA/pypi-support another one. Thanks |
|
/ocabot merge nobump |
|
What a great day to merge this nice PR. Let's do it! |
|
@jelenapoblet your merge command was aborted due to failed check(s), which you can inspect on this commit of 18.0-ocabot-merge-pr-9-by-jelenapoblet-bump-nobump. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
|
/ocabot merge nobump |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
@jelenapoblet your merge command was aborted due to failed check(s), which you can inspect on this commit of 18.0-ocabot-merge-pr-9-by-jelenapoblet-bump-nobump. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
8069e4b to
e69a876
Compare
|
/ocabot merge nobump |
|
This PR looks fantastic, let's merge it! |
|
@jelenapoblet The merge process could not be finalized, because command |
Brings the bridge in line with OCA/barcode-interface#9: - Of the measures a label carries, the quantity is the first one in the product's kind of unit (a weight for a product in kilograms, a volume for one in litres); the pack's gross weight and other logistic measures never count. - Should the units fail to load at startup, they are loaded again in the background when a scan carries a measure. - A measure that rounds to nothing in the product's unit reads as a scan without one.
…n the product's unit Brings the bridge in line with OCA/barcode-interface#9: - The decimals the quantity is stored with are read from the field's digits (fields_get) instead of decimal.precision.precision_get, which fails over RPC once `account` is installed, so the measure was never read there. - Of the measures a label carries, the quantity is the first one in the product's kind of unit; the pack's gross weight and other logistic measures never count. - Should the units fail to load at startup, they are loaded again when a scan carries a measure; a measure that rounds to nothing reads as a scan without one.
…n the product's unit Brings the bridge in line with OCA/barcode-interface#9: - The decimals the quantity is stored with are read from the field's digits (fields_get) instead of decimal.precision.precision_get, which fails over RPC once `account` is installed, so the measure was never read there. - Of the measures a label carries, the quantity is the first one in the product's kind of unit; the pack's gross weight and other logistic measures never count. - Should the units fail to load at startup, they are loaded again when a scan carries a measure; a measure that rounds to nothing reads as a scan without one.
|
/ocabot merge nobump |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
It looks like something changed on |
|
@jelenapoblet The merge process could not be finalized, because command |
|
@OCA/pypi-support please add this name when possible. Thanks |
|
@jelenapoblet Name reserved |
|
/ocabot merge nobump |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
Congratulations, your PR was merged at 84c0972. Thanks a lot for contributing to OCA. ❤️ |
Bridge between
barcode_gs1andbarcode_stock: the measure on a GS1 label becomes the quantity picked, in the unit the product is stocked in.Depends on #8. That PR's commit is included here so CI can install
barcode_gs1; this branch will be rebased once it is merged, leaving only thebarcode_gs1_stockcommit.Why a separate module
A GS1 label often states both a piece count (AI 30/37) and a measure (AI 310n and the like): a box of cured meat carries "2 pieces" and "2.497 kg". Which one is the quantity depends on how the product is stocked, which neither module can decide on its own:
barcode_gs1only decodes the label. It doesn't know the product, so the quantity it reports is the piece count (null when the label states none), and the measure stays inweight/weightUom.barcode_stockdoesn't know GS1. It takes the scanned quantity as it comes.It installs itself when both modules are there.
What it does
barcode_stock'sscannedQuantityandapplyScanResultare overridden:The quantity is rounded the way the server stores it: to the product unit's Rounding Precision, then to the Product Unit of Measure decimals. With Odoo's defaults 2.497 kg is shown as 2.50, which is what gets stored.
readme/CONFIGURE.mdexplains how to keep the grams.The units of measure and the Product Unit of Measure decimals are read once when the app starts, because the scan path is synchronous.
Tests
browser_js. It includes the rounding and carton labels read by the realbarcode_gs1parser against a packaging of 12.@BinhexTeam