Merge branch 'feature/1007' into develop
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from . import models
|
||||
from . import controllers
|
||||
|
||||
@@ -10,12 +10,9 @@
|
||||
""",
|
||||
'category': 'YZ',
|
||||
'website': 'https://www.sf.cs.jikimo.com',
|
||||
'depends': ['account', 'sf_base', 'base'],
|
||||
'depends': ['account', 'sf_base', 'base', 'sale'],
|
||||
'data': [
|
||||
'views/sf_sync_config_settings_views.xml',
|
||||
'data/sf_cron.xml'
|
||||
|
||||
|
||||
'views/sale_process_order_view.xml'
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
|
||||
1
sf_bf_connect/controllers/__init__.py
Normal file
1
sf_bf_connect/controllers/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .import controllers
|
||||
32
sf_bf_connect/controllers/controllers.py
Normal file
32
sf_bf_connect/controllers/controllers.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import json
|
||||
import logging
|
||||
from datetime import date, timedelta
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
from odoo.addons.mrs_gateway_api.models.common import Common
|
||||
from odoo.addons.mrs_gateway_api.models.basicdata_str import BasicDataStr
|
||||
|
||||
|
||||
class Sf_Bf_Connect(http.Controller):
|
||||
|
||||
@http.route('/api/bfm_process_order/list', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||
cors="*")
|
||||
def get_bfm_process_order_list(self, **kw):
|
||||
"""
|
||||
获取业务平台传送来的业务平台订单
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
result = json.loads('bfm_process_order_list')
|
||||
for item in result:
|
||||
self.env['mrs.production.process'].create({
|
||||
"id": item['id'],
|
||||
"model_file": item['model_file'],
|
||||
"model_name": item['model_name'],
|
||||
"type": item['type'],
|
||||
"surface_technics": item['surface_technics'],
|
||||
"unit_price": item['unit_price'],
|
||||
"amount": item['amount'],
|
||||
"money": item['money']
|
||||
})
|
||||
@@ -1,3 +1,2 @@
|
||||
# from . import sf_process_order
|
||||
|
||||
from . import sf_process_order
|
||||
|
||||
|
||||
@@ -2,38 +2,33 @@ 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']
|
||||
class bfmOrderLine(models.Model):
|
||||
_name = 'sf.bfm.order.line'
|
||||
_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)
|
||||
model_file = fields.Binary('模型文件', attachment=False)
|
||||
model_name = fields.char('模型名称')
|
||||
type = fields.Many2one('mrs.materials.model', '型号')
|
||||
surface_technics = fields.Many2one('mrs.production.process', string='表面工艺')
|
||||
# technological_parameter = fields.Many2one('',string='工艺参数')
|
||||
unit_price = fields.Float('单价')
|
||||
amount = fields.Integer('数量')
|
||||
money = fields.Float('金额')
|
||||
|
||||
|
||||
class sale(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
bfm_process_order_ids = fields.Many2one('sf.bfm.order.line', string='业务平台订单')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
# -*- 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('单价')
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record model="ir.actions.act_window" id="action_sale_process_order">
|
||||
<field name="name">业务平台订单</field>
|
||||
<field name="res_model">sale.order</field>
|
||||
<field name="view_mode">tree,form,pivot,graph</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
[业务平台订单] 还没有哦!点左上角的[创建]按钮,沙发归你了!
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="view_sf_bfm_order_form" model="ir.ui.view">-->
|
||||
<!-- <field name="name">sf.order.form</field>-->
|
||||
<!-- <field name="model">sf.order</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="Sales Order" class="o_sale_order" js_class="sale_discount_form">-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<menuitem id="sale_business_process_order_menu"
|
||||
name="业务平台订单"
|
||||
parent="sale.sale_order_menu"
|
||||
action="action_sale_process_order"
|
||||
sequence="2"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
18
sf_bf_connect/views/sale_process_order_view.xml
Normal file
18
sf_bf_connect/views/sale_process_order_view.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_sf_form_inherit">
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='Customer Signature']" position="before">
|
||||
<page string="Bfm Line">
|
||||
<group>
|
||||
<field name="bfm_process_order_ids"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user