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
[9.0] [ADD] sell loose goods using tare barcode label #447
Conversation
Hello @robinkeunen, hello @legalsylvain, would you please have time to give a look at this PR? Thx! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vvrossem @houssine78 fyi |
Hello @legalsylvain, Thank you for the thoughtful review! I'll (try to) do the same for #436. I agree with you #447 and #436 are complementary and should merge at some point! Thank you,
|
Howdy @robinkeunen @vvrossem @houssine78 a review would be much appreciated. |
Hi @legalsylvain, would you have time to take a look? I updated the code using the UOM as you do in #436. You'll need to define a "Kg" UOM if you plan to test that using the debug module. The UOM matching is case sensitive and the debug panel sets the weight to "Kg" whereas it should be "kg" (see https://github.com/odoo/odoo/blob/9.0/addons/point_of_sale/static/src/js/devices.js#L380). |
Hi @robinkeunen! I would love to get that addon running in our shop. This addon would massively speed up the checkout process. This is one of our highest pain-point right now. Would you mind to check if someone from coopITEasycould can review this? Thank you in advance! |
Hi @Fkawala, could you please explain me what happens if you put 'kg' instead of 'Kg' ? |
@vvrossem, thank you for looking into this PR. Please find a more detail explanation below. How the Addon works?The add-on saves weight on the tare label using the "kg" unit of measure (UOM). This UOM should exist for the add-on to work. The UOM is fetched from the POS and matched by its name (case sensitive). See here and there for the code responsible to find the UOM based on UOM name. When the electronic scale sends the weight, it comes with the unit name, for instance, "kg". The add-on fetches the UOM corresponding to the unit name. The UOM that matches the unit name sent by the scale is the "scale UOM". The add-on converts the scale weight from the scale UOM to the "kg" UOM. At this point, we're ready to create a tare label. When we read the tare label, we read a tare weight saved in "kg" UOM. We convert that tare weight into the product UOM so that we can compute the net weight in the product UOM. In summary, we have three UOM:
Today all the electronic scales that are supported (ADAM / Mettler-Toledo) use the "kg" UOM. However, this architecture would allow us to use an electronic scale that use another UOM, as long as this UOM is defined. What can be the problem in debug?My note on the "Kg" UOM is there because of the particular behavior of the "debug panel". As you can see here the debug pannel forges weights with a non-standard unit name "Kg". If you do run this code using the debug panel to moke the electronic scale, then the add-on will search for the "Kg" UOM. This UOM does not exist by default. Hence the add-on would fail to create a tare label. I hope this is clear enough, if not, please let me know! |
nice !
i propose to :
kind regards. |
It works for me! The plan looks fine, thank you.
We're running odoo 9.0. It won't change in the coming months. Hence, there is no rush to get that
working on 12.0 (for us at least).
Would you happen to know someone that could do the second review and approve the merge of this PR?
|
@PierrickBrun could you take a time to make a little functional review on that PR ? |
Hello @legalsylvain and @PierrickBrun. This is ready to be reviewed and hopefully merged. Thank you in advance! |
This PR has the |
Thanks for the review @PierrickBrun! Could we proceed forward and merge this? Best regards |
/ocabot merge |
Hey, thanks for contributing! Proceeding to merge this for you. |
Thank you @legalsylvain ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Fkawala ! First of all, thank you for your work !
I've tested and reviewed the module. I have minor suggestions that can be added in the roadmap if the community agrees :)
barcode_tare_action: function (code) { | ||
try { | ||
var order = this.pos.get_order(); | ||
var last_order_line = order.get_last_orderline(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this would be quite more flexible!
return self.pos.proxy.scale_read().then(function (weight) { | ||
try { | ||
self.set_weight(weight); | ||
} catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could the syntax scale_read().then(function (onFulfilled){...}, function (onRejected){...})
be an alternative for UOM management? scale_read
in point_of_sale.devices
uses it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not get the rationale here, could you please explain it to me? Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a first opinion, I was thinking it would be better to move the UOM management in an overridden scale_read
function, but my second opinion is that it's better to handle this on the TareScreenWidget
and not in the ProxyDevice
|
||
The command line to start a chrome base browser in kiosk mode with silent printing looks like: | ||
|
||
``chromium-browser --use-system-default-printer --kiosk --kiosk-printing http://localhost:8069/`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add a Configuration section explaining to check the show tare label button checkbox in Loose good options for the functional users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this can help and it is fairly straightforward.
<li class="info"> | ||
tare = <t t-esc="line.get_tare_str_with_unit()" /> | ||
</li> | ||
</t> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the tare and net weight is specified on the orderline, I wonder if the gross weight should be included as well for legal reasons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add it, it does not cost much. But I think this would be less readable. I'm not too worried about legal compliance since the whole POS scaling hasn't been certified (at least not in UE).
Congratulations, your PR was merged at ccb42d6. Thanks a lot for contributing to OCA. ❤️ |
@vvrossem What would the procedure to ship the changes you suggested to do (now that this PR has been merged)? Thanks! |
@vvrossem could you make a new PR agains 9.0 with all the nice improvments you propose ? |
This add-on enables POS to read and print tare barcodes. We print a barcode tare label to sell loose goods in a Bring Your Own pot (BYOC) scheme.
The BYOC scheme has five steps:
This add-on adds a news screen to POS to print (web) the tare barcode labels. This add-on enables POS to read a tare barcode. Reading a barcode makes POS adjust the weight of the latest article in the order list. The new weight is equal to the total weight minus the tare weight. The price is updated accordingly to the weight change.