Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

77 lines
3.0KB

  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # OpenERP, Open Source Management Solution
  5. # Copyright (C) 2016 武康开源软件(宣一敏).
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as
  9. # published by the Free Software Foundation, either version 3 of the
  10. # License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. ##############################################################################
  21. from odoo import api, fields, models, tools, _
  22. from random import randint
  23. class Partner(models.Model):
  24. '''
  25. 在合作伙伴上增加由系统创建标志,用于区别是tax系统反向生成还是别的人员录入,可以作为是否能自动反推的依据
  26. '''
  27. _inherit = "res.partner"
  28. computer_import = fields.Boolean('系统创建', default= False)
  29. class ProductTemplate(models.Model):
  30. _inherit = "product.template"
  31. '''
  32. 在产品上增加由系统创建标志,用于区别是tax系统反向生成还是别的人员录入,可以作为是否能自动反推的依据
  33. '''
  34. computer_import = fields.Boolean('系统创建',default= False)
  35. tax_category_id = fields.Many2one('tax.category', string='税收分类')
  36. class tax_category(models.Model):
  37. _name = 'tax.category'
  38. _description = '税收分类编码'
  39. '''
  40. 增加税收分类编码,此编码很重要,是开票系统上传国家税务局的数据之一
  41. '''
  42. code = fields.Char('编号')
  43. name = fields.Char('名称')
  44. print_name = fields.Char('简称')
  45. superior = fields.Many2one('tax.category', '上级分类', help='上级类别', copy=False)
  46. note = fields.Text('说明')
  47. tax_rate = fields.Integer('税率', help='因为有可能有多个税率在这里面,所以现在很奇怪')
  48. class ProductCategory(models.Model):
  49. _inherit = 'product.category'
  50. tax_category_id = fields.Many2one('tax.category', string='税收分类')
  51. class CnInvoiceType(models.Model):
  52. _name = 'cn.invoice.type'
  53. _description = '发票类型'
  54. def _get_default_color(self):
  55. return randint(1, 11)
  56. name = fields.Char('类型名称')
  57. is_coming_tax = fields.Boolean('是否可以抵扣')
  58. note = fields.Text('备注')
  59. code = fields.Char('发票类型代码')
  60. color = fields.Integer('颜色', default=_get_default_color)
  61. is_electric = fields.Boolean('是否全电发票', default=False)
  62. class AccountMoveLine(models.Model):
  63. _inherit = "account.move.line"
  64. is_cn_invoice = fields.Boolean('已开票')
上海开阖软件有限公司 沪ICP备12045867号-1