GoodERP
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

59 lignes
1.8KB

  1. # Copyright 2016 上海开阖软件有限公司 (http://www.osbzr.com)
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import fields, models
  4. LINE_TYPES = [('get', '销售收款'),
  5. ('pay', '采购付款'),
  6. ('category', '其他收支'),
  7. ('begin', '科目期初'),
  8. ('end', '科目期末'),
  9. ('lines', '表行计算')]
  10. class CashFlowTemplate(models.Model):
  11. _name = 'cash.flow.template'
  12. _description = '现金流量表模版'
  13. _order = 'sequence'
  14. sequence = fields.Integer('序号')
  15. name = fields.Char('项目')
  16. line_num = fields.Char('行次')
  17. line_type = fields.Selection(LINE_TYPES, '行类型')
  18. # for type sum
  19. category_ids = fields.Many2many(
  20. 'core.category',
  21. string='收支类别',
  22. domain="[('type','in',['other_get','other_pay'])]")
  23. # for type begin
  24. begin_ids = fields.Many2many(
  25. 'finance.account',
  26. relation='cftb',
  27. string='会计科目期初')
  28. # for type end
  29. end_ids = fields.Many2many(
  30. 'finance.account',
  31. relation='cfte',
  32. string='会计科目期末')
  33. # for type lines
  34. plus_ids = fields.Many2many(
  35. 'cash.flow.template', 'c_p', 'c_id', 'p_id', string='+表行')
  36. nega_ids = fields.Many2many(
  37. 'cash.flow.template', 'c_n', 'c_id', 'n_id', string='-表行')
  38. class CashFlowStatement(models.Model):
  39. _name = 'cash.flow.statement'
  40. _description = '现金流量表'
  41. name = fields.Char('项目')
  42. line_num = fields.Char('行次')
  43. amount = fields.Float('本月金额', digits='Amount')
  44. year_amount = fields.Float('本年累计金额', digits='Amount')
  45. class CoreCategory(models.Model):
  46. _inherit = 'core.category'
  47. cash_flow_template_ids = fields.Many2many(
  48. 'cash.flow.template', string='现金流量表行')
上海开阖软件有限公司 沪ICP备12045867号-1