Commit db701c2
committed
[FIX] website_sale: store empty fields as False
If you specify an empty VAT number in the Contacts app, it will store it
as `False` in the ORM. If a new partner is created through the shop, the
VAT number is set through HTML form submission. It will use `''` for an
empty VAT number. When evaluating the VAT number in Python code, it will
usually be converted to a boolean, so it doesn't matter if it's `False`
or `''`. But in ORM queries those are two different values and code that
checks on `False` to check for the presence of a VAT number can
misinterpret `''` as being one.
This fix replaces `''` values submitted through the address form in the
shop with `False`.
opw-3114246
closes odoo#112807
Signed-off-by: Merel Geens <mege@odoo.com>1 parent 713a46c commit db701c2
1 file changed
+15
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
642 | | - | |
| 642 | + | |
643 | 643 | | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
648 | 657 | | |
649 | 658 | | |
650 | 659 | | |
| |||
742 | 751 | | |
743 | 752 | | |
744 | 753 | | |
745 | | - | |
| 754 | + | |
746 | 755 | | |
747 | 756 | | |
748 | 757 | | |
| |||
0 commit comments