1.修复采购权限和销售权限2.销售新增审核向导
This commit is contained in:
@@ -6,8 +6,8 @@ import os
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
|
||||
|
||||
class ResProductMo(models.Model):
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/sale_order_wizard_views.xml',
|
||||
'views/sale_team.xml',
|
||||
'views/sale_order_view.xml',
|
||||
'views/purchase_order_view.xml',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import logging
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo import fields, models, api
|
||||
# from quatotion import readSql, feature_recognize, auto_quatotion
|
||||
from quatotion import readSql, feature_recognize, auto_quatotion
|
||||
|
||||
__author__ = 'jinling.yang'
|
||||
_logger = logging.getLogger(__name__)
|
||||
@@ -24,14 +24,14 @@ class AutoQuatotion(models.Model):
|
||||
def get_process_time_db_path(self):
|
||||
return get_resource_path('sf_sale', 'models', 'process_time.db')
|
||||
|
||||
# def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code):
|
||||
# '''
|
||||
# 通过打包好的.so库,
|
||||
# 以调用autoQuatotion库中Quatotion类,
|
||||
# 初始化后调用类的analyseShape方法对模型文件进行价格预测
|
||||
# '''
|
||||
# # 初始化自动报价类(输入特征数据库和加工时间数据库)
|
||||
# reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path)
|
||||
# # 获取价格、加工时间、尺寸、XYZ、翻面次数
|
||||
# feature_info = reader.analyseShape(stp_url, InfoJson={})
|
||||
# return feature_info
|
||||
def get_auto_quatotion(self, stp_url, feature_full_path, process_time_db_path, model_code):
|
||||
'''
|
||||
通过打包好的.so库,
|
||||
以调用autoQuatotion库中Quatotion类,
|
||||
初始化后调用类的analyseShape方法对模型文件进行价格预测
|
||||
'''
|
||||
# 初始化自动报价类(输入特征数据库和加工时间数据库)
|
||||
reader = auto_quatotion.Quatotion(feature_full_path, process_time_db_path)
|
||||
# 获取价格、加工时间、尺寸、XYZ、翻面次数
|
||||
feature_info = reader.analyseShape(stp_url, InfoJson={})
|
||||
return feature_info
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,8 +5,8 @@ import os
|
||||
import json
|
||||
from datetime import datetime
|
||||
import requests
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
from odoo import models, fields, api
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
|
||||
@@ -82,10 +82,6 @@ class RePurchaseOrder(models.Model):
|
||||
|
||||
check_status = fields.Selection([('unchecked', '未审核'), ('checked', '已审核')], '审核状态', default='unchecked')
|
||||
|
||||
# 审核
|
||||
def action_check(self):
|
||||
self.check_status = 'checked'
|
||||
|
||||
|
||||
class ResPartnerToSale(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
@@ -10,12 +10,38 @@ access_crm_team_member_director,crm_team_member_director,sales_team.model_crm_te
|
||||
access_res_users,res_users,base.model_res_users,sf_base.group_sale_director,1,1,1,0
|
||||
access_product_template_group_sale_salemanager,product_template_group_sale_salemanager,product.model_product_template,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_product_template_group_sale_director,product_template_group_sale_director,product.model_product_template,sf_base.group_sale_director,1,0,0,0
|
||||
access_product_template_group_purchase,product_template_group_purchase,product.model_product_template,sf_base.group_purchase,1,0,0,0
|
||||
access_product_template_group_purchase_director,product_template_group_purchase_director,product.model_product_template,sf_base.group_purchase_director,1,0,0,0
|
||||
access_stock_picking_group_sale_salemanager,stock_picking_group_sale_salemanager,stock.model_stock_picking,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_stock_picking_group_sale_director,stock_picking_group_sale_director,stock.model_stock_picking,sf_base.group_sale_director,1,0,0,0
|
||||
access_stock_picking_group_purchase,stock_picking_group_purchase,stock.model_stock_picking,sf_base.group_purchase,1,0,0,0
|
||||
access_stock_picking_group_purchase_director,stock_picking_group_purchase_director,stock.model_stock_picking,sf_base.group_purchase_director,1,0,0,0
|
||||
access_account_move_group_sale_salemanager,account_move_group_sale_salemanager,account.model_account_move,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_account_move_group_sale_director,account_move_group_sale_director,account.model_account_move,sf_base.group_sale_director,1,0,0,0
|
||||
access_resource_resource_group_sale_director,resource_resource_group_sale_director,resource.model_resource_resource,sf_base.group_sale_director,1,1,1,0
|
||||
|
||||
access_mrp_bom_group_purchase,mrp_bom_group_purchase,mrp.model_mrp_bom,sf_base.group_purchase,1,0,0,0
|
||||
access_mrp_bom_group_purchase_director,mrp_bom_group_purchase_director,mrp.model_mrp_bom,sf_base.group_purchase_director,1,0,0,0
|
||||
access_stock_move_group_purchase,stock_move_group_purchase,stock.model_stock_move,sf_base.group_purchase,1,0,0,0
|
||||
access_stock_move_group_purchase_director,stock_move_group_purchase_director,stock.model_stock_move,sf_base.group_purchase_director,1,0,0,0
|
||||
|
||||
access_uom_uom_group_sale_salemanager,uom_uom_group_sale_salemanager,uom.model_uom_uom,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_uom_uom_group_sale_director,uom_uom_group_sale_director,uom.model_uom_uom,sf_base.group_sale_director,1,1,1,0
|
||||
access_uom_uom_group_purchase,uom_uom_group_purchase,uom.model_uom_uom,sf_base.group_purchase,1,0,0,0
|
||||
access_uom_uom_group_purchase_director,uom_uom_group_purchase_director,uom.model_uom_uom,sf_base.group_purchase_director,1,0,0,0
|
||||
|
||||
access_uom_category_group_sale_salemanager,uom_category_group_sale_salemanager,uom.model_uom_category,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_uom_category_group_sale_director,uom_category_group_sale_director,uom.model_uom_category,sf_base.group_sale_director,1,1,1,0
|
||||
access_uom_category_group_purchase,uom_category_group_purchase,uom.model_uom_category,sf_base.group_purchase,1,0,0,0
|
||||
access_uom_category_group_purchase_director,uom_category_group_purchase_director,uom.model_uom_category,sf_base.group_purchase_director,1,0,0,0
|
||||
|
||||
access_sale_order_check_wizard_group_sale_salemanager,sale_order_check_wizard_group_sale_salemanager,model_sale_order_check_wizard,sf_base.group_sale_salemanager,1,1,1,0
|
||||
access_sale_order_check_wizard_group_sale_director,sale_order_check_wizard_group_sale_director,model_sale_order_check_wizard,sf_base.group_sale_director,1,1,1,0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -2,34 +2,25 @@
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- <record id="sale_order_view_search_inherit_quotation_inherit_quotation" model="ir.ui.view">-->
|
||||
<!-- <record id="sale_order_view_search_inherit_quotation_inherit_sf" model="ir.ui.view">-->
|
||||
<!-- <field name="name">sale.order.search.quotation.inherit.sf</field>-->
|
||||
<!-- <field name="model">sale.order</field>-->
|
||||
<!-- <field name="inherit_id" ref="sale.view_sales_order_filter"/>-->
|
||||
<!-- <!– <field name="inherit_id" ref="sale.view_sales_order_filter"/>–>-->
|
||||
|
||||
<!-- <field name="inherit_id" ref="sale.sale_order_view_search_inherit_quotation"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <filter name="my_sale_orders_filter" position="replace">-->
|
||||
<!-- <field name="campaign_id"/>-->
|
||||
<!-- <separator/>-->
|
||||
<!-- <!– <filter string="My Quotations" name="my_quotation" domain="[('user_id', '=', uid)]"/>–>-->
|
||||
<!-- <xpath expr="//filter[@name='my_sale_orders_filter']" position="replace">-->
|
||||
<!-- <!– <field name="campaign_id"/>–>-->
|
||||
<!-- <!– <separator/>–>-->
|
||||
<!-- <!– <filter string="Quotations" name="draft" domain="[('state','in',('draft', 'sent'))]"/>–>-->
|
||||
<!-- <!– <filter string="Sales Orders" name="sales" domain="[('state','in',('sale','done'))]"/>–>-->
|
||||
<!-- <!– <separator/>–>-->
|
||||
<!-- <filter string="Quotations" name="draft" domain="[('state','in',('draft', 'sent'))]"/>-->
|
||||
<!-- <filter string="Sales Orders" name="sales" domain="[('state','in',('sale','done'))]"/>-->
|
||||
<!-- <separator/>-->
|
||||
<!-- <filter string="Create Date" name="filter_create_date" date="create_date"/>-->
|
||||
<!-- </filter>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
<!-- <record model="ir.ui.view" id="view_sales_order_filter_inherit_sf">-->
|
||||
<!-- <field name="name">sale.order.search.quotation.inherit.sf</field>-->
|
||||
<!-- <field name="model">sale.order</field>-->
|
||||
<!-- <field name="inherit_id" ref="sale.view_sales_order_filter"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <filter name="my_sale_orders_filter" position="replace">-->
|
||||
<!--<!– <filter string="我的报价1" name="my_sale_orders_filter" domain="[]"/>–>-->
|
||||
<!-- </filter>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_order_form_inherit_sf">
|
||||
<field name="name">sale.order.form.inherit.sf</field>
|
||||
<field name="model">sale.order</field>
|
||||
@@ -37,13 +28,11 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form/header/button[@name='action_confirm']" position="after">
|
||||
<field name="check_status" invisible="1"/>
|
||||
<button name="action_check" string="审核" type="object"
|
||||
<button name="sf_sale.action_sale_order_check_wizard" string="审核" type="action"
|
||||
context="{'default_order_id':active_id}"
|
||||
attrs="{'invisible': [('check_status','=', 'checked')]}"
|
||||
class="oe_highlight"/>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_check']" position="attributes">
|
||||
<attribute name="groups">sf_base.group_sale_director</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_confirm'][1]" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('check_status', '=', 'unchecked'),('state', 'not in',
|
||||
['sent'])]}
|
||||
|
||||
1
sf_sale/wizard/__init__.py
Normal file
1
sf_sale/wizard/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import sale_order_wizard
|
||||
16
sf_sale/wizard/sale_order_wizard.py
Normal file
16
sf_sale/wizard/sale_order_wizard.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import models, api, fields
|
||||
|
||||
|
||||
class saleOrderCheckWizard(models.TransientModel):
|
||||
_name = 'sale.order.check.wizard'
|
||||
|
||||
_description = '报价/销售订单审核向导'
|
||||
|
||||
order_id = fields.Many2one('sale.order')
|
||||
check_state = fields.Selection([('pass', '通过'), ('back', '退回')], '审核状态', default='pass')
|
||||
check_audit = fields.Text('审核意见')
|
||||
|
||||
def submit(self):
|
||||
self.order_id.check_status = 'unchecked' if not self.check_state == 'pass' else 'checked'
|
||||
self.order_id.message_ids = '1'
|
||||
28
sf_sale/wizard/sale_order_wizard_views.xml
Normal file
28
sf_sale/wizard/sale_order_wizard_views.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="sale_order_check_wizard_form_view">
|
||||
<field name="name">sale.order.check.wizard.form.view</field>
|
||||
<field name="model">sale.order.check.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<field name="order_id" invisible="True"/>
|
||||
<group>
|
||||
<field name="check_state" required="True"/>
|
||||
<field name="check_audit" attrs="{'required': [('check_state', '=', 'back')]}"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="提交" name="submit" type="object" class="oe_highlight"/>
|
||||
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sale_order_check_wizard" model="ir.actions.act_window">
|
||||
<field name="name">销售订单审核向导</field>
|
||||
<field name="res_model">sale.order.check.wizard</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user