shopinvader / odoo-shopinvader

Odoo Modules. Sorry Magento, Shopinvader is coming
GNU Affero General Public License v3.0
121 stars 105 forks source link

[16.0] shopinvader_product_sale_packaging: fix empty barcode #1522

Open simahawk opened 8 months ago

simahawk commented 8 months ago

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

shopinvader-git-bot commented 7 months ago

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). 🤖

simahawk commented 7 months ago

@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.".

marielejeune commented 7 months ago

@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?