GoodERP
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

29 rindas
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