Hi am new to both python and Odoo development, I used the web interface for customization before. I was trying to create a class to
- add a field to sale.subscription Model
subscription_tier = fields.Char(string='Subscription Tier',readonly=True)
enter code here
- loop through subscription line to see if the customer has
silver
orgold
subscription then set it to the fieldsubscription_tier
class subscription_tire_set(models.Model):
_inherit = 'sale.subscription'
subscription_tier = fields.Char(string='Subscription Tier',readonly=True)
@api.depends('recurring_invoice_line_ids.product_id')
def _compute_release_to_pay(self):
for n_subscription in self:
result = None
for n_subscription_line in n_subscription.recurring_invoice_line_ids:
if any(n_subscription_line.product_id) == 'gold':
result = gold'
break
else:
result = 'not'
subscription_tier = result
I probably am doing something horribly wrong
also a getting this massge when trying to open any customer in subscription
Something went wrong! sale.subscription(10,).subscription_tier
Thank u for the help in advance.