[12.0][MIG] pos_tare w/ barcode#491
Conversation
|
Hi @Fkawala, |
|
Hi @Fkawala. I'm currently reviewing this PR. |
Works for me! |
|
@legalsylvain this PR is pending a formal test with an ESCPOS printer. I'll try to get that done tomorrow. In the meantime would you have some spare cycles to review the code? @vvrossem this PR is the base layer for a proper tare / gross weight handling in the POS. It adds a "Tare" button and includes @legalsylvain's nice rework of the scale screen (first introduced in #436). This PR features the gross weight / Tare / net weight display on receipt (works for web print and proxy print). This PR is meant to become a dependency for #470 that you've already reviewed a while ago. Do you think you'll have time to review this? If not would you be kind enough to bounce it back to someone else at CoopITEasy? Thank you in advance. |
|
The CI tests fail b/c:
I'm not sure how to fix that!? |
| check_sanitize_value: function (input_name) { | ||
| var res = this.$(input_name)[0].value.replace(',', '.').trim(); | ||
| if (isNaN(res)) { | ||
| this.$(input_name).css("background-color", "#F66"); | ||
| return undefined; | ||
| } | ||
| this.$(input_name).css("background-color", "#FFF"); | ||
| return parseFloat(res, 10); | ||
| }, |
There was a problem hiding this comment.
Kudos go to @legalsylvain on this (and most of the code actually).
| validate_order: function(options) { | ||
| var order = this.pos.get_order(); | ||
| var orderlines = Array.from(order.get_orderlines()); | ||
|
|
||
| if (orderlines.some(leq_zero_qty)) { | ||
| var _super_validate_order = this._super.bind(this); | ||
| var wrong_orderline = orderlines.find(leq_zero_qty); | ||
| var wrong_product = wrong_orderline.get_product().display_name; | ||
| this.gui.show_popup('confirm', { | ||
| title: _t('Quantity lower or equal to zero'), | ||
| body: _.str.sprintf( | ||
| _t("The quantity for \"%s\" is lower or equal to" + | ||
| " zero. Call for help unless you're perfectly" + | ||
| " sure you are doing right."), wrong_product), | ||
| confirm: function() { | ||
| _super_validate_order(); | ||
| }, | ||
| }); | ||
| return; | ||
| } | ||
| return this._super(options); | ||
| }, |
There was a problem hiding this comment.
Glad you liked it! Thank you for the review :)
Neither do I, but I noticed the following logs appear in the console on the |
Not sure how to read what you sent. The dependency is expected (we are trying to find a nice icon to make the tare information more explicit). The CI crash is kind of expected since it does not have the dependency (https://github.com/OCA/server-tools/tree/12.0/base_fontawesome) available. |
|
this commit should fix the problem. |
|
@legalsylvain thank you! |
|
Howdy, can we try to close this one in what is left of this week? |
|
it seems you have some conflicts. could you try to fix it ? I guess a rebase should solve the issue. |
|
Hello @legalsylvain, hope you're doing good! Am kind of lost with the codecov tool. Would you be able to provide any guidance to get that working? I looked around in codecov but https://codecov.io/gh/OCA/pos/tree/aa2ffbf91645ab059a36fe08b74a0f367b209cd0/pos_tare/models looks ok to me and I don't know what to do. Thank you! |
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: pos-9.0/pos-9.0-pos_barcode_tare Translate-URL: https://translation.odoo-community.org/projects/pos-9-0/pos-9-0-pos_barcode_tare/
…. Apply tare on selected order item.
1a52e95 to
9fcd244
Compare
[ADD] barcode nomenclature for tare [ADD] tare field on pos.order.line model [ADD] Tare button in PoS numpad [IMP] handle correctly different UoM [IMP] add warning at checkout if qty <=0 [IMP] display gross and tare weight for each line Co-authored-by: François Kawala <[email protected]> Co-authored-by: Sylvain LE GAL <[email protected]>
9fcd244 to
3e88ad3
Compare
|
Could we merge and close this PR? Could/Should I do it my self as the maintainer? Thank you and have a nice day! |
|
This PR has the |
|
/ocabot merge nobump |
|
Sorry @Fkawala you are not allowed to merge. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
|
/ocabot merge patch |
|
On my way to merge this fine PR! |
|
@legalsylvain Merci! |
|
Congratulations, your PR was merged at 695ed15. Thanks a lot for contributing to OCA. ❤️ |




Following up our discussion with @legalsylvain here #436 and there #447 Sylvain and I decided to split the work related to tare in two parts.
This PR covers the first part. The second part will be delivered later next week.