I made a new module from sales.order (odoo11). I have a field "cantidad" that should show the number of lines in the order but is not working .. not errors but not work
I try sereral example but the computed field desn't work
here is the code
from odoo import api, fields, models
class aleOrder(models.Model):
_name = "ale.order"
_description = "Forma"
name = fields.Char(string='OT')
partner_id = fields.Many2one('res.partner', string='Cliente', required=True, track_visibility='always')
order_line = fields.One2many('ale.order.line', 'order_id', string='Trabajos', copy=True, auto_join=True)
cantidad = fields.Float(string='Extintores', store='True', readonly='True', compute='_cant_ext')
@api.depends('order_line')
def _cant_ext(self):
for line in self:
cantidad += line.sequence
order.update({
'cantidad': cantidad,
})
class aleOrderLine(models.Model):
_name = 'ale.order.line'
_description = 'Lines'
order_id = fields.Many2one('ale.order', string='Order Reference', required=True, ondelete='cascade', index=True, copy=False)
name = fields.Text(string='Description')
sequence = fields.Float(string='Sequence', default=10)
any help ?