Do not test quantity for lines of type different than line
Closes #12274
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user