diff --git a/sf_bf_connect/__init__.py b/sf_bf_connect/__init__.py index 50ed18aa..c081ee06 100644 --- a/sf_bf_connect/__init__.py +++ b/sf_bf_connect/__init__.py @@ -1 +1,2 @@ # -*-coding:utf-8-*- +from . import models diff --git a/sf_bf_connect/__manifest__.py b/sf_bf_connect/__manifest__.py new file mode 100644 index 00000000..8e78b13f --- /dev/null +++ b/sf_bf_connect/__manifest__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +{ + 'name': '机企猫智能工厂 同步模块', + 'version': '1.0', + 'summary': '智能工厂同步模块', + 'sequence': 1, + 'description': """ +在本模块,同步资源库 + """, + 'category': 'YZ', + 'website': 'https://www.sf.cs.jikimo.com', + 'depends': ['account', 'sf_base', 'base'], + 'data': [ + 'views/sf_sync_config_settings_views.xml', + 'data/sf_cron.xml' + + + ], + 'demo': [ + ], + 'qweb': [ + ], + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/sf_bf_connect/models/__init__.py b/sf_bf_connect/models/__init__.py new file mode 100644 index 00000000..176b8cbe --- /dev/null +++ b/sf_bf_connect/models/__init__.py @@ -0,0 +1,3 @@ +# from . import sf_process_order + + diff --git a/sf_bf_connect/models/sf_process_order.py b/sf_bf_connect/models/sf_process_order.py new file mode 100644 index 00000000..acff902a --- /dev/null +++ b/sf_bf_connect/models/sf_process_order.py @@ -0,0 +1,39 @@ +from odoo import models,fields +from odoo.exceptions import ValidationError + + +class Order(models.Model): + _name = 'sf.order' + + _inherit = ['portal.mixin', 'mail.thread', 'mail.activity.mixin', 'utm.mixin'] + _description = '业务平台订单' + + order_number = fields.Char('订单号') + date_order = fields.Datetime('订购日期') + validity_date = fields.Date('到期') + partner_id = fields.Many2one( + 'res.partner', string='客户', + domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", ) + + sale_order_template_id = fields.Many2one('sf.order.template', '报价单模板') + pricelist_id = fields.Many2one('sf.pricelist', string='付款条款', ) + deadline_of_delivery= fields.Datetime('交货截止日期') + order_line = fields.One2many('sale.order.line', 'order_id', string='Order Lines', states={'cancel': [('readonly', True)], 'done': [('readonly', True)]}, copy=True, auto_join=True) + + +class OrderTemplate(models.Model): + _name = "sf.order.template" + _description = "报价单模板" + + name = fields.Char('名称', required=True) + active = fields.Boolean('有效', default=True) + + +class Pricelist(models.Model): + _name = "sf.pricelist" + _description = "付款条款" + + name = fields.Char('名称') + active = fields.Boolean('有效', default=True) + + diff --git a/sf_bf_connect/models/sf_process_order_line.py b/sf_bf_connect/models/sf_process_order_line.py new file mode 100644 index 00000000..3ffd7bcf --- /dev/null +++ b/sf_bf_connect/models/sf_process_order_line.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from datetime import timedelta + +from odoo import api, fields, models, _ +from odoo.exceptions import UserError +from odoo.tools.misc import get_lang +from odoo.osv import expression +from odoo.tools import float_is_zero, float_compare, float_round + + +class OrderLine(models.Model): + _name = 'sf.order.line' + _description = '订单行' + + order_id = fields.Many2one('sf.order') + name = fields.Text(string='说明', required=True) + product_uom_qty = fields.Float('单价') + diff --git a/sf_bf_connect/views/bf_process_order_view.xml b/sf_bf_connect/views/bf_process_order_view.xml new file mode 100644 index 00000000..9ea0c097 --- /dev/null +++ b/sf_bf_connect/views/bf_process_order_view.xml @@ -0,0 +1,39 @@ + + + + + 业务平台订单 + sale.order + tree,form,pivot,graph + [] + {} + +

+ [业务平台订单] 还没有哦!点左上角的[创建]按钮,沙发归你了! +

+

+

+
+
+ + + + + + + + + + + + + + + +
+
\ No newline at end of file