I have on creation trigger for a model filed and current value is
record.env["ir.sequence"].next_by_code("seq.fservice")
I want to update to check of a company id
if company_id = old compnay od
then
record.env["ir.sequence"].next_by_code("seq.fservice")
else
record.env["ir.sequence"].next_by_code("seq.fnewservice")
Could you please provide more clarity on your question so that we can offer you a suitable solution?
"I have an automated action that needs to be used in task creation for two different companies. The field called 'Job Number' needs to be auto-created with the prefix 'NO' or 'RO' depending on the company. I have a question regarding how to write Python expressions that can handle conditions such as 'if the company is A, then return sequence seq.company1sq, otherwise return seq.company2sq'."
I have found a way to fix this by creating a sequence with the same name for both companies. But I would like to know the solution to how can we write complex logic in automated action returns value for field