GoodERP
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

29 行
1.2KB

  1. # Copyright 2016 上海开阖软件有限公司 (http://www.osbzr.com)
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import api, fields, models
  4. class Service(models.Model):
  5. ''' 是对其他收支业务的更细分类 '''
  6. _name = 'service'
  7. _description = '收支项'
  8. name = fields.Char('名称', required=True)
  9. get_categ_id = fields.Many2one('core.category',
  10. '收入类别', ondelete='restrict',
  11. domain="[('type', '=', 'other_get')]",
  12. context={'type': 'other_get'})
  13. pay_categ_id = fields.Many2one('core.category',
  14. '支出类别', ondelete='restrict',
  15. domain="[('type', '=', 'other_pay')]",
  16. context={'type': 'other_pay'})
  17. price = fields.Float('价格', required=True)
  18. tax_rate = fields.Float('税率%')
  19. active = fields.Boolean('启用', default=True)
  20. company_id = fields.Many2one(
  21. 'res.company',
  22. string='公司',
  23. change_default=True,
  24. default=lambda self: self.env.company)
上海开阖软件有限公司 沪ICP备12045867号-1