Do not test quantity for lines of type different than line

Closes #12274
This commit is contained in:
Sergi Almacellas Abellana
2023-05-16 09:35:15 +02:00
parent 74af46a4bf
commit cf95121e98
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -10,5 +10,5 @@ class Line(metaclass=PoolMeta):
def get_invoice_line(self):
with Transaction().set_context(
taxes=[t.id for t in self.taxes],
return_=self.quantity < 0):
return_=self.type == 'line' and self.quantity < 0):
return super().get_invoice_line()
+1 -1
View File
@@ -10,5 +10,5 @@ class Line(metaclass=PoolMeta):
def get_invoice_line(self):
with Transaction().set_context(
taxes=[t.id for t in self.taxes],
return_=self.quantity < 0):
return_=self.type == 'line' and self.quantity < 0):
return super().get_invoice_line()
@@ -95,6 +95,9 @@ Test rules with a sale::
>>> line = sale.lines.new()
>>> line.product = product
>>> line.quantity = -1
>>> line = sale.lines.new()
>>> line.type = 'comment'
>>> line.description = 'Sample'
>>> sale.click('quote')
>>> sale.click('confirm')
>>> sale.state