中国本土应用
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

83 lines
3.2KB

  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('编号', help='对应SPBM')
  43. name = fields.Char('名称', required=True, help='对应SPMC')
  44. print_name = fields.Char('打印名称', help='对应SPBMJC')
  45. superior = fields.Many2one('tax.category', '上级分类', help='上级类别', copy=False)
  46. can_use = fields.Boolean('可使用')
  47. note = fields.Text('备注')
  48. help = fields.Text('说明')
  49. tax_rate = fields.Char('税率', help='因为有可能有多个税率在这里面,所以现在很奇怪')
  50. class ProductCategory(models.Model):
  51. _inherit = 'product.category'
  52. tax_category_id = fields.Many2one('tax.category', string='税收分类')
  53. class CnInvoiceType(models.Model):
  54. _name = 'cn.invoice.type'
  55. _description = '发票类型'
  56. def _get_default_color(self):
  57. return randint(1, 11)
  58. name = fields.Char('类型名称')
  59. is_coming_tax = fields.Boolean('是否可以抵扣')
  60. note = fields.Text('备注')
  61. code = fields.Char('发票类型代码')
  62. color = fields.Integer('颜色', default=_get_default_color)
  63. class ResCompany(models.Model):
  64. _inherit = 'res.company'
  65. invoice_top_amount = fields.Float('单张发票最高金额', default=100000)
  66. class AccountMoveLine(models.Model):
  67. _inherit = "account.move.line"
  68. is_cn_invoice = fields.Boolean('已开票')
上海开阖软件有限公司 沪ICP备12045867号-1