1234567891011121314151617181920212223 |
- # -*- encoding: utf-8 -*-
- from openerp import models, fields, api, tools
- from openerp.exceptions import ValidationError
- class ProductServiceBrand(models.Model):
- _name = 'product.service.brand'
- name = fields.Char(string='Brand Name', required=True)
- description = fields.Text(string="Description")
- logo = fields.Binary('Logo File')
- product_service_ids = fields.One2many(
- 'product.service',
- 'product_service_brand_id',
- )
- product_service_count = fields.Integer(
- string='Numero de autos',
- compute='_get_product_service_count',
- )
- @api.one
- @api.depends('product_service_ids')
- def _get_product_service_count(self):
- self.product_service_count = len(self.product_service_ids)
|