I would like to setup a job to auto unpublish a product from ecommerce if the available stock is zero.
I tried to write the below code, but it gave error. Can you help what is wrong? Thanks
for record in records:
if record.qty_available == 0:
record.website_published = false
break;
I have updated with False (big F), the error message that is shown is:
forbidden opcode(s) in "# Available variables:\n# - env: Odoo Environment on which the action is triggered\n# - model: Odoo Model of the record on which the action is triggered; is a void recordset\n# - record: record on which the action is triggered; may be be void\n# - records: recordset of all records on which the action is triggered in multi-mode; may be void\n# - time, datetime, dateutil, timezone: useful Python libraries\n# - log: log(message, level='info'): logging function to record debug information in ir.logging table\n# - Warning: Warning Exception to use with raise\n# To return an action, assign: action = {...}\nfor record in records:\n if record.qty_available == 0:\n record.website_published = False\n break;": STORE_ATTR
can you update the question with the error message that you are getting