I would like to show, in product list view, a column called "Status" that displays "Live" if the product is active, and "Discontinued" if the product is not active (AKA as archived). If you open a product card, non-active products are shown as ARCHIVED, but this is not brought through to the product list view, except that you can make the "Active" column visible.
So I have created a new field "x_studio_archived_1", gone into "more" section to access the advanced properties, set the dependencies as "active, x_studio_archived_1" and added code to the Compute field as follows:
for record in self:
if record['active'] == True:
record[x_studio_archived_1] = 'Live'
elif record['active'] == False:
record[x_studio_archived_1] = 'Discontinued'
However, it does not appear tro do anything, even if i open a product card, change the price and save it, which i believe should trigger the code to run.
Any suggestions as to where I'm going wrong?
I'm on saas 16.3