project_service_material.py 540 B

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