diff --git a/jikimo_account_process/__init__.py b/jikimo_account_process/__init__.py new file mode 100644 index 00000000..511a0ca3 --- /dev/null +++ b/jikimo_account_process/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import controllers +from . import models \ No newline at end of file diff --git a/jikimo_account_process/__manifest__.py b/jikimo_account_process/__manifest__.py new file mode 100644 index 00000000..f701deb7 --- /dev/null +++ b/jikimo_account_process/__manifest__.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +{ + 'name': "jikimo_account_process", + + 'summary': """ + Short (1 phrase/line) summary of the module's purpose, used as + subtitle on modules listing or apps.openerp.com""", + + 'description': """ + Long description of module's purpose + """, + + 'author': "My Company", + 'website': "https://www.yourcompany.com", + + # Categories can be used to filter modules in modules listing + # Check https://github.com/odoo/odoo/blob/16.0/odoo/addons/base/data/ir_module_category_data.xml + # for the full list + 'category': 'Uncategorized', + 'version': '0.1', + + # any module necessary for this one to work correctly + 'depends': ['base', 'account'], + + # always loaded + 'data': [ + # 'security/ir.model.access.csv', + # 'views/views.xml', + # 'views/templates.xml', + ], + # only loaded in demonstration mode + 'demo': [ + # 'demo/demo.xml', + ], +} diff --git a/jikimo_account_process/controllers/__init__.py b/jikimo_account_process/controllers/__init__.py new file mode 100644 index 00000000..457bae27 --- /dev/null +++ b/jikimo_account_process/controllers/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import controllers \ No newline at end of file diff --git a/jikimo_account_process/controllers/controllers.py b/jikimo_account_process/controllers/controllers.py new file mode 100644 index 00000000..88f9332a --- /dev/null +++ b/jikimo_account_process/controllers/controllers.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# from odoo import http + + +# class JikimoAccountProcess(http.Controller): +# @http.route('/jikimo_account_process/jikimo_account_process', auth='public') +# def index(self, **kw): +# return "Hello, world" + +# @http.route('/jikimo_account_process/jikimo_account_process/objects', auth='public') +# def list(self, **kw): +# return http.request.render('jikimo_account_process.listing', { +# 'root': '/jikimo_account_process/jikimo_account_process', +# 'objects': http.request.env['jikimo_account_process.jikimo_account_process'].search([]), +# }) + +# @http.route('/jikimo_account_process/jikimo_account_process/objects/', auth='public') +# def object(self, obj, **kw): +# return http.request.render('jikimo_account_process.object', { +# 'object': obj +# }) diff --git a/jikimo_account_process/models/__init__.py b/jikimo_account_process/models/__init__.py new file mode 100644 index 00000000..bef2bae9 --- /dev/null +++ b/jikimo_account_process/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import models +from . import account_move \ No newline at end of file diff --git a/jikimo_account_process/models/account_move.py b/jikimo_account_process/models/account_move.py new file mode 100644 index 00000000..e85d4e16 --- /dev/null +++ b/jikimo_account_process/models/account_move.py @@ -0,0 +1,15 @@ +from odoo import models, fields, api + +from odoo.exceptions import ValidationError + + +class CustomAccountMoveLine(models.Model): + _inherit = 'account.move' + _description = "account move line" + + @api.model_create_multi + def create(self, vals): + for val in vals: + val['name'] = self.env['ir.sequence'].next_by_code('account.move') or '/' + # 因为供应商与客户支付创建流程是先创建move line在修改来填充account_payment与move line的关联 + return super(CustomAccountMoveLine, self).create(vals) \ No newline at end of file diff --git a/jikimo_account_process/models/models.py b/jikimo_account_process/models/models.py new file mode 100644 index 00000000..ea14f4a4 --- /dev/null +++ b/jikimo_account_process/models/models.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +# from odoo import models, fields, api + + +# class jikimo_account_process(models.Model): +# _name = 'jikimo_account_process.jikimo_account_process' +# _description = 'jikimo_account_process.jikimo_account_process' + +# name = fields.Char() +# value = fields.Integer() +# value2 = fields.Float(compute="_value_pc", store=True) +# description = fields.Text() +# +# @api.depends('value') +# def _value_pc(self): +# for record in self: +# record.value2 = float(record.value) / 100