GoodERP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
783B

  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 BankAccount(models.Model):
  5. _name = 'bank.account'
  6. _description = '账户'
  7. name = fields.Char('名称', required=True)
  8. bank_name = fields.Char('开户行')
  9. num = fields.Char('账号')
  10. balance = fields.Float('余额', readonly=True,
  11. digits='Amount')
  12. active = fields.Boolean('启用', default=True)
  13. company_id = fields.Many2one(
  14. 'res.company',
  15. string='公司',
  16. change_default=True,
  17. default=lambda self: self.env.company)
  18. _sql_constraints = [
  19. ('name_uniq', 'unique(name)', '账户不能重名')
  20. ]
上海开阖软件有限公司 沪ICP备12045867号-1