1234567891011121314 |
- # -*- coding: utf-8 -*-
- from openerp import fields, models, api
- class ProjectServiceMaterial(models.Model):
- _name = 'project.service.material'
- product_id = fields.Many2one('product.product', string='Productos', domain=[('sale_ok','=',True)])
- task_id = fields.Many2one('project.service.task',string="Trabajo")
- amount = fields.Integer(string='Cantidad', default=1)
- price = fields.Float(string='Precio Unitario')
-
- @api.onchange('product_id')
- def get_price(self):
- self.price = self.product_id.lst_price
|