[FIX] sale: remove wrong chatter line when creating section/note

PR: #27293
task-1889346
This commit is contained in:
Sébastien Theys
2018-09-28 14:36:26 +02:00
parent 6b8d7bb6d6
commit 3b5440e785
+1 -1
View File
@@ -1046,7 +1046,7 @@ class SaleOrderLine(models.Model):
values.update(self._prepare_add_missing_fields(values))
line = super(SaleOrderLine, self).create(values)
if line.order_id.state == 'sale':
if line.product_id and line.order_id.state == 'sale':
msg = _("Extra line with %s ") % (line.product_id.display_name,)
line.order_id.message_post(body=msg)
# create an analytic account if at least an expense product