Integer, Numeric and Float allow None as value

NULL value is None and not False

issue2022
This commit is contained in:
Cédric Krier committed 2012-03-23 20:59:22 +01:00
1 parent 2ba0c28bea
commit 77fc99e7cd
3 files changed
+7 -4

No files matched your search

+4 -3
View File
@@ -49,9 +49,10 @@ class Sale(Model):
product = id2product[line['product']]
quantity = uom_obj.compute_qty(id2unit[line['unit']],
line['quantity'], product.default_uom, round=False)
weight += uom_obj.compute_qty(product.weight_uom,
product.weight * quantity, carrier.weight_uom,
round=False)
if product.weight:
weight += uom_obj.compute_qty(product.weight_uom,
product.weight * quantity, carrier.weight_uom,
round=False)
weights.append(weight)
return context
+1 -1
View File
@@ -214,7 +214,7 @@ Create payment term::
>>> PaymentTerm = Model.get('account.invoice.payment_term')
>>> PaymentTermLine = Model.get('account.invoice.payment_term.line')
>>> payment_term = PaymentTerm(name='Direct')
>>> payment_term_line = PaymentTermLine(type='remainder')
>>> payment_term_line = PaymentTermLine(type='remainder', days=0)
>>> payment_term.lines.append(payment_term_line)
>>> payment_term.save()
+2
View File
@@ -64,6 +64,8 @@ class CarrierWeightTestCase(unittest.TestCase):
'default_uom': uom_id,
'category': category_id,
'type': 'service',
'list_price': Decimal(0),
'cost_price': Decimal(0),
})
weight_uom_id, = self.uom.search([
('name', '=', 'Kilogram'),