odoo-shopinvader icon indicating copy to clipboard operation
odoo-shopinvader copied to clipboard

[16.0] shopinvader_product_sale_packaging: fix empty barcode

Open simahawk opened this issue 10 months ago • 3 comments

Never fail when a packaging has no barcode. No matter where the data is coming from or how the object is initialized.

simahawk avatar Mar 25 '24 16:03 simahawk

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

shopinvader-git-bot avatar Apr 05 '24 06:04 shopinvader-git-bot

@simahawk Why not adding or None when building the SimpleProductPackaging here:

https://github.com/shopinvader/odoo-shopinvader/blob/5552357a8a34ff4814a9cbf1cd2af75e91adfd6c/shopinvader_product_sale_packaging/schemas/product_packaging.py#L24

I think it was forgotten there.

It's on purpose. That was my first fix but it won't work in all the cases. That's why I added the comment "Ensure barcode is set to None when empty, no matter if we use from_packaging.".

simahawk avatar Apr 19 '24 07:04 simahawk

@simahawk I'm sorry but I'm not really into the code anymore 😅 Can you give an example where we don't use from_packaging?

marielejeune avatar Apr 19 '24 08:04 marielejeune