[FIX] website_event: track publishing

When an event is published/unpublished, the 'Is Published' value appears
twice in the chatter.

This is because `website_published` is defined as a related of
`is_published`, and `is_published` is tracked. The button calls
`website_publish_button` which triggers a `write` on
`website_published`, the latter triggering a `write` on `is_published`.

The situation is quite exceptional: we usually don't define a related on
a field of the same model. Therefore, we can simply change the field
tracked.

opw-2073804

closes odoo/odoo#37128

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-09-19 09:46:30 +00:00
parent 5c408dd442
commit e3d2b018c2
+1 -1
View File
@@ -22,7 +22,7 @@ class Event(models.Model):
_name = 'event.event'
_inherit = ['event.event', 'website.seo.metadata', 'website.published.multi.mixin']
is_published = fields.Boolean(tracking=True)
website_published = fields.Boolean(tracking=True)
is_participating = fields.Boolean("Is Participating", compute="_compute_is_participating")