1.新增销售和计划权限组2.优化代码格式
This commit is contained in:
@@ -5,7 +5,6 @@ from odoo.addons.sf_base.commons.common import Common
|
|||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FunctionalFixtureType(models.Model):
|
class FunctionalFixtureType(models.Model):
|
||||||
_name = 'sf.functional.fixture.type'
|
_name = 'sf.functional.fixture.type'
|
||||||
_description = "功能夹具类型"
|
_description = "功能夹具类型"
|
||||||
@@ -63,7 +62,8 @@ class FunctionalFixture(models.Model):
|
|||||||
def _get_name(self):
|
def _get_name(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.type:
|
if record.type:
|
||||||
if not record.transfer_tray_model_ids and not record.pneumatic_tray_model_ids and not record.magnetic_tray_model_ids and not record.vice_tray_model_ids:
|
if not record.transfer_tray_model_ids and not record.pneumatic_tray_model_ids and \
|
||||||
|
not record.magnetic_tray_model_ids and not record.vice_tray_model_ids:
|
||||||
record.name = ''
|
record.name = ''
|
||||||
if record.transfer_tray_model_ids:
|
if record.transfer_tray_model_ids:
|
||||||
for i in record.transfer_tray_model_ids:
|
for i in record.transfer_tray_model_ids:
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
from odoo import fields, models, api
|
from odoo import fields, models, api
|
||||||
|
|
||||||
|
|
||||||
# from datetime import datetime
|
|
||||||
# from odoo.exceptions import ValidationError
|
|
||||||
|
|
||||||
|
|
||||||
# 刀具物料
|
|
||||||
class CuttingToolMaterial(models.Model):
|
class CuttingToolMaterial(models.Model):
|
||||||
_name = 'sf.cutting.tool.material'
|
_name = 'sf.cutting.tool.material'
|
||||||
_description = '刀具物料'
|
_description = '刀具物料'
|
||||||
@@ -28,57 +23,6 @@ class FunctionalCuttingTool(models.Model):
|
|||||||
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型')
|
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型')
|
||||||
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀具型号')
|
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀具型号')
|
||||||
|
|
||||||
# # 整体式刀具型号
|
|
||||||
# mrs_cutting_tool_integral_model_ids = fields.Many2many('sf.cutting.tool.model', 'rel_integral_model_functional_sf',
|
|
||||||
# string='整体式刀具型号', domain=
|
|
||||||
# [('cutting_tool_type', '=', '整体式刀具')])
|
|
||||||
# # 刀片型号
|
|
||||||
# mrs_cutting_tool_blade_model_ids = fields.Many2many('sf.cutting.tool.model', 'rel_blade_model_functional_sf',
|
|
||||||
# string='刀片型号', domain=
|
|
||||||
# [('cutting_tool_type', '=', '刀片')])
|
|
||||||
# # 刀杆型号
|
|
||||||
# mrs_cutting_tool_cutterbar_model_ids = fields.Many2many('sf.cutting.tool.model',
|
|
||||||
# 'rel_cutterbar_model_functional_sf',
|
|
||||||
# string='刀杆型号', domain=
|
|
||||||
# [('cutting_tool_type', '=', '刀杆')])
|
|
||||||
# # 刀盘型号
|
|
||||||
# mrs_cutting_tool_cutterpad_model_ids = fields.Many2many('sf.cutting.tool.model',
|
|
||||||
# 'rel_cutterpad_model_functional_sf',
|
|
||||||
# string='刀盘型号', domain=
|
|
||||||
# [('cutting_tool_type', '=', '刀盘')])
|
|
||||||
# # 刀柄型号
|
|
||||||
# mrs_cutting_tool_cutterhandle_model_ids = fields.Many2many('sf.cutting.tool.model',
|
|
||||||
# 'rel_cutterhandle_model_functional_sf',
|
|
||||||
# string='刀柄型号',
|
|
||||||
# domain=
|
|
||||||
# [('cutting_tool_type', '=', '刀柄')])
|
|
||||||
# # 夹头型号
|
|
||||||
# mrs_cutting_tool_cutterhead_model_ids = fields.Many2many('sf.cutting.tool.model',
|
|
||||||
# 'rel_cutterhead_model_functional_sf',
|
|
||||||
# string='夹头型号', domain=
|
|
||||||
# [('cutting_tool_type', '=', '夹头')])
|
|
||||||
#
|
|
||||||
# diameter = fields.Float('直径(mm)')
|
|
||||||
# tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
|
||||||
# string='刀具等级')
|
|
||||||
# machining_accuracy = fields.Float('加工精度(mm)')
|
|
||||||
# tool_length = fields.Float('装刀长')
|
|
||||||
# blade_number = fields.Integer('刃数')
|
|
||||||
# integral_blade_length = fields.Float('整体刃长(mm)')
|
|
||||||
# effective_blade_length = fields.Float('有效刃长(mm)')
|
|
||||||
# max_life = fields.Float('最大寿命值')
|
|
||||||
# is_standard = fields.Boolean('是否标准刀')
|
|
||||||
# applicable_range = fields.Char('适用范围')
|
|
||||||
# image = fields.Binary('图片')
|
|
||||||
# active = fields.Boolean('有效', default=True)
|
|
||||||
#
|
|
||||||
# def _get_functional_tool_model_ids(self, functional_tool_model_code):
|
|
||||||
# functional_tool_model_ids = []
|
|
||||||
# for item in functional_tool_model_code:
|
|
||||||
# functional_tool_model = self.env['sf.cutting.tool.model'].search([('code', '=', item)])
|
|
||||||
# functional_tool_model_ids.append(functional_tool_model.id)
|
|
||||||
# return [(6, 0, functional_tool_model_ids)]
|
|
||||||
|
|
||||||
|
|
||||||
# 功能刀具类型
|
# 功能刀具类型
|
||||||
class FunctionalCuttingToolModel(models.Model):
|
class FunctionalCuttingToolModel(models.Model):
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
top_angle = fields.Integer('顶角(°)')
|
top_angle = fields.Integer('顶角(°)')
|
||||||
blade_tip_dip_angle = fields.Integer('刀尖倾角(°)')
|
blade_tip_dip_angle = fields.Integer('刀尖倾角(°)')
|
||||||
side_cutting_edge_angle = fields.Integer('侧切削角(°)')
|
side_cutting_edge_angle = fields.Integer('侧切削角(°)')
|
||||||
thread_model = fields.Selection([('无', '无'), ('外螺纹', '外螺纹'), ('内螺纹', '内螺纹')], string='螺纹类型', default='无')
|
thread_model = fields.Selection([('无', '无'), ('外螺纹', '外螺纹'), ('内螺纹', '内螺纹')], string='螺纹类型',
|
||||||
|
default='无')
|
||||||
thread_num = fields.Float('每英寸螺纹数(tpi)')
|
thread_num = fields.Float('每英寸螺纹数(tpi)')
|
||||||
blade_tip_height_tolerance = fields.Char('刀尖高度公差(mm)', size=20)
|
blade_tip_height_tolerance = fields.Char('刀尖高度公差(mm)', size=20)
|
||||||
inscribed_circle_tolerance = fields.Char('内接圆公差(mm)', size=20)
|
inscribed_circle_tolerance = fields.Char('内接圆公差(mm)', size=20)
|
||||||
@@ -199,8 +200,8 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
'is_cooling_hole': obj['is_cooling_hole'],
|
'is_cooling_hole': obj['is_cooling_hole'],
|
||||||
'locating_slot_code': obj['locating_slot_code'],
|
'locating_slot_code': obj['locating_slot_code'],
|
||||||
'installing_structure': obj['installing_structure'],
|
'installing_structure': obj['installing_structure'],
|
||||||
'blade_ids': [(6, 0, [])] if not obj.get('blade_codes') else self.evn['sf.cutting_tool.standard.library']._get_ids(
|
'blade_ids': [(6, 0, [])] if not obj.get('blade_codes') else
|
||||||
obj['blade_codes']),
|
self.evn['sf.cutting_tool.standard.library']._get_ids(obj['blade_codes']),
|
||||||
'tool_shim': obj['tool_shim'],
|
'tool_shim': obj['tool_shim'],
|
||||||
'cotter_pin': obj['cotter_pin'],
|
'cotter_pin': obj['cotter_pin'],
|
||||||
'pressing_plate': obj['pressing_plate'],
|
'pressing_plate': obj['pressing_plate'],
|
||||||
@@ -222,8 +223,8 @@ class ToolMaterialsBasicParameters(models.Model):
|
|||||||
'cutting_depth': obj['cutting_depth'],
|
'cutting_depth': obj['cutting_depth'],
|
||||||
'main_included_angle': obj['main_included_angle'],
|
'main_included_angle': obj['main_included_angle'],
|
||||||
'installing_structure': obj['installing_structure'],
|
'installing_structure': obj['installing_structure'],
|
||||||
'blade_ids': [(6, 0, [])] if not obj.get('blade_codes') else self.evn['sf.cutting_tool.standard.library']._get_ids(
|
'blade_ids': [(6, 0, [])] if not obj.get('blade_codes') else
|
||||||
obj['blade_codes']),
|
self.evn['sf.cutting_tool.standard.library']._get_ids(obj['blade_codes']),
|
||||||
'screw': obj['screw'],
|
'screw': obj['screw'],
|
||||||
'spanner': obj['spanner'],
|
'spanner': obj['spanner'],
|
||||||
'cutting_blade_model': obj['cutting_blade_model'],
|
'cutting_blade_model': obj['cutting_blade_model'],
|
||||||
|
|||||||
@@ -1,4 +1,32 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
<record model="ir.module.category" id="module_category_plan">
|
||||||
|
<field name="name">计划</field>
|
||||||
|
<field name="sequence">20</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="sales_team.group_sale_manager" model="res.groups">
|
||||||
|
<field name="name">销售经理</field>
|
||||||
|
<field name="category_id" ref="base.module_category_sales_sales"/>
|
||||||
|
<!-- <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>-->
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- <record id="group_sale_director" model="res.groups">-->
|
||||||
|
<!-- <field name="name">销售总监</field>-->
|
||||||
|
<!-- <field name="category_id" ref="base.module_category_sales_sales"/>-->
|
||||||
|
<!-- <field name="implied_ids" eval="[(4, ref('sf_base.group_sale_manager'))]"/>-->
|
||||||
|
<!-- </record>-->
|
||||||
|
|
||||||
|
<record id="group_plan_dispatch" model="res.groups">
|
||||||
|
<field name="name">计划调度岗</field>
|
||||||
|
<field name="category_id" ref="module_category_plan"/>
|
||||||
|
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="group_plan_director" model="res.groups">
|
||||||
|
<field name="name">计划总监</field>
|
||||||
|
<field name="category_id" ref="module_category_plan"/>
|
||||||
|
<field name="implied_ids" eval="[(4, ref('sf_base.group_plan_dispatch'))]"/>
|
||||||
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
from .import controllers
|
from .import controllers
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class Sf_Bf_Connect(http.Controller):
|
|||||||
self_machining_bom_line = self_machining_bom.with_user(
|
self_machining_bom_line = self_machining_bom.with_user(
|
||||||
request.env.ref("base.user_admin")).bom_create_line(
|
request.env.ref("base.user_admin")).bom_create_line(
|
||||||
self_machining_embryo)
|
self_machining_embryo)
|
||||||
if self_machining_bom_line is False:
|
if not self_machining_bom_line:
|
||||||
res['status'] = 2
|
res['status'] = 2
|
||||||
res['message'] = '该订单模型的材料型号在您分配的工厂里暂未有原材料,请先配置再进行分配'
|
res['message'] = '该订单模型的材料型号在您分配的工厂里暂未有原材料,请先配置再进行分配'
|
||||||
request.cr.rollback()
|
request.cr.rollback()
|
||||||
@@ -84,7 +84,7 @@ class Sf_Bf_Connect(http.Controller):
|
|||||||
# 创建坯料的bom的组件
|
# 创建坯料的bom的组件
|
||||||
outsource_bom_line = outsource_bom.with_user(
|
outsource_bom_line = outsource_bom.with_user(
|
||||||
request.env.ref("base.user_admin")).bom_create_line(outsource_embryo)
|
request.env.ref("base.user_admin")).bom_create_line(outsource_embryo)
|
||||||
if outsource_bom_line is False:
|
if not outsource_bom_line:
|
||||||
res['status'] = 2
|
res['status'] = 2
|
||||||
res['message'] = '该订单模型的材料型号在您分配的工厂里暂未有原材料,请先配置再进行分配'
|
res['message'] = '该订单模型的材料型号在您分配的工厂里暂未有原材料,请先配置再进行分配'
|
||||||
request.cr.rollback()
|
request.cr.rollback()
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
import requests
|
import requests
|
||||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
from odoo import fields, models
|
||||||
from odoo.exceptions import UserError
|
|
||||||
from odoo.exceptions import ValidationError
|
|
||||||
from collections import defaultdict, namedtuple
|
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -197,19 +194,20 @@ class FinishStatusChange(models.Model):
|
|||||||
if self.user_has_groups('stock.group_reception_report') \
|
if self.user_has_groups('stock.group_reception_report') \
|
||||||
and self.picking_type_id.auto_show_reception_report:
|
and self.picking_type_id.auto_show_reception_report:
|
||||||
lines = self.move_ids.filtered(lambda
|
lines = self.move_ids.filtered(lambda
|
||||||
m: m.product_id.type == 'product' and m.state != 'cancel' and m.quantity_done and not m.move_dest_ids)
|
m: m.product_id.type == 'product' and m.state != 'cancel'
|
||||||
|
and m.quantity_done and not m.move_dest_ids)
|
||||||
if lines:
|
if lines:
|
||||||
# don't show reception report if all already assigned/nothing to assign
|
# don't show reception report if all already assigned/nothing to assign
|
||||||
wh_location_ids = self.env['stock.location']._search(
|
wh_location_ids = self.env['stock.location']._search(
|
||||||
[('id', 'child_of', self.picking_type_id.warehouse_id.view_location_id.id),
|
[('id', 'child_of', self.picking_type_id.warehouse_id.view_location_id.id),
|
||||||
('usage', '!=', 'supplier')])
|
('usage', '!=', 'supplier')])
|
||||||
if self.env['stock.move'].search([
|
if self.env['stock.move'].search([
|
||||||
('state', 'in', ['confirmed', 'partially_available', 'waiting', 'assigned']),
|
('state', 'in', ['confirmed', 'partially_available', 'waiting', 'assigned']),
|
||||||
('product_qty', '>', 0),
|
('product_qty', '>', 0),
|
||||||
('location_id', 'in', wh_location_ids),
|
('location_id', 'in', wh_location_ids),
|
||||||
('move_orig_ids', '=', False),
|
('move_orig_ids', '=', False),
|
||||||
('picking_id', 'not in', self.ids),
|
('picking_id', 'not in', self.ids),
|
||||||
('product_id', 'in', lines.product_id.ids)], limit=1):
|
('product_id', 'in', lines.product_id.ids)], limit=1):
|
||||||
action = self.action_view_reception_report()
|
action = self.action_view_reception_report()
|
||||||
action['context'] = {'default_picking_ids': self.ids}
|
action['context'] = {'default_picking_ids': self.ids}
|
||||||
return action
|
return action
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
from . import models
|
from . import models
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
from . import models
|
from . import models
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,15 +16,12 @@
|
|||||||
'security/group_security.xml',
|
'security/group_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'views/mrp_production_addional_change.xml',
|
'views/mrp_production_addional_change.xml',
|
||||||
# 'views/mrp_maintenance_views.xml',
|
|
||||||
'views/mrp_routing_workcenter_view.xml',
|
'views/mrp_routing_workcenter_view.xml',
|
||||||
'views/production_line_view.xml',
|
'views/production_line_view.xml',
|
||||||
'views/mrp_workcenter_views.xml',
|
'views/mrp_workcenter_views.xml',
|
||||||
'views/mrp_workorder_view.xml',
|
'views/mrp_workorder_view.xml',
|
||||||
'views/model_type_view.xml',
|
'views/model_type_view.xml',
|
||||||
'views/sf_maintenance_equipment.xml',
|
'views/sf_maintenance_equipment.xml',
|
||||||
# 'views/kanban_change.xml'
|
|
||||||
|
|
||||||
],
|
],
|
||||||
'assets': {
|
'assets': {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from odoo import fields, models
|
|
||||||
import logging
|
import logging
|
||||||
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
class ResMrpRoutingWorkcenter(models.Model):
|
class ResMrpRoutingWorkcenter(models.Model):
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from odoo import api, fields, models
|
import datetime
|
||||||
from datetime import datetime
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
from odoo import fields, models
|
||||||
from odoo.addons.resource.models.resource import Intervals
|
from odoo.addons.resource.models.resource import Intervals
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
import json
|
import base64
|
||||||
import math
|
import math
|
||||||
import requests
|
import requests
|
||||||
import logging
|
import logging
|
||||||
import base64
|
|
||||||
# import subprocess
|
# import subprocess
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
@@ -304,7 +303,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
|
|
||||||
# 验证坯料序列号是否正确
|
# 验证坯料序列号是否正确
|
||||||
def pro_code_is_ok(self, barcode):
|
def pro_code_is_ok(self, barcode):
|
||||||
if barcode != False:
|
if barcode is not False:
|
||||||
if barcode != self.pro_code:
|
if barcode != self.pro_code:
|
||||||
raise UserError('坯料序列号错误')
|
raise UserError('坯料序列号错误')
|
||||||
return False
|
return False
|
||||||
@@ -623,7 +622,7 @@ class CNCprocessing(models.Model):
|
|||||||
if os.path.splitext(f)[1] == ".pdf":
|
if os.path.splitext(f)[1] == ".pdf":
|
||||||
full_path = os.path.join(serverdir, root, f)
|
full_path = os.path.join(serverdir, root, f)
|
||||||
logging.info('pdf:%s' % full_path)
|
logging.info('pdf:%s' % full_path)
|
||||||
if full_path != False:
|
if full_path is not False:
|
||||||
if not cnc_processing.workorder_id.cnc_worksheet:
|
if not cnc_processing.workorder_id.cnc_worksheet:
|
||||||
cnc_processing.workorder_id.cnc_worksheet = base64.b64encode(
|
cnc_processing.workorder_id.cnc_worksheet = base64.b64encode(
|
||||||
open(full_path, 'rb').read())
|
open(full_path, 'rb').read())
|
||||||
|
|||||||
@@ -287,12 +287,12 @@ class ResProductMo(models.Model):
|
|||||||
self.cutting_tool_flange_length = self.specification_id.flange_shank_length
|
self.cutting_tool_flange_length = self.specification_id.flange_shank_length
|
||||||
self.cutting_tool_shank_outer_diameter = self.specification_id.handle_external_diameter
|
self.cutting_tool_shank_outer_diameter = self.specification_id.handle_external_diameter
|
||||||
self.cutting_tool_shank_inner_diameter = self.specification_id.handle_inside_diameter
|
self.cutting_tool_shank_inner_diameter = self.specification_id.handle_inside_diameter
|
||||||
self.suitable_machining_method_ids = [(6, 0,
|
self.suitable_machining_method_ids = [(6, 0, [])] if not \
|
||||||
[])] if not self.cutting_tool_model_id.suitable_machining_method_ids else [
|
self.cutting_tool_model_id.suitable_machining_method_ids \
|
||||||
(6, 0, self.cutting_tool_model_id.suitable_machining_method_ids.ids)]
|
else [(6, 0, self.cutting_tool_model_id.suitable_machining_method_ids.ids)]
|
||||||
self.blade_tip_characteristics_id = [(6, 0,
|
self.blade_tip_characteristics_id = [(6, 0,[])] if not \
|
||||||
[])] if not self.cutting_tool_model_id.blade_tip_characteristics_id else [
|
self.cutting_tool_model_id.blade_tip_characteristics_id \
|
||||||
(6, 0, self.cutting_tool_model_id.blade_tip_characteristics_id.ids)]
|
else [(6, 0, self.cutting_tool_model_id.blade_tip_characteristics_id.ids)]
|
||||||
|
|
||||||
self.handle_type_ids = [(6, 0,
|
self.handle_type_ids = [(6, 0,
|
||||||
[])] if not self.cutting_tool_model_id.handle_type_ids else [
|
[])] if not self.cutting_tool_model_id.handle_type_ids else [
|
||||||
|
|||||||
@@ -187,7 +187,6 @@ class StockRule(models.Model):
|
|||||||
values={'self': production, 'origin': origin_production},
|
values={'self': production, 'origin': origin_production},
|
||||||
subtype_id=self.env.ref('mail.mt_note').id)
|
subtype_id=self.env.ref('mail.mt_note').id)
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
创建生产计划
|
创建生产计划
|
||||||
'''
|
'''
|
||||||
@@ -404,7 +403,8 @@ class ReStockMove(models.Model):
|
|||||||
'fixture_clamp_workpiece_diameter_max': item.product_id.fixture_clamp_workpiece_diameter_max,
|
'fixture_clamp_workpiece_diameter_max': item.product_id.fixture_clamp_workpiece_diameter_max,
|
||||||
'fixture_maximum_carrying_weight': item.product_id.fixture_maximum_carrying_weight,
|
'fixture_maximum_carrying_weight': item.product_id.fixture_maximum_carrying_weight,
|
||||||
'fixture_maximum_clamping_force': item.product_id.fixture_maximum_clamping_force,
|
'fixture_maximum_clamping_force': item.product_id.fixture_maximum_clamping_force,
|
||||||
'fixture_driving_way': '' if not item.product_id.fixture_driving_way else item.product_id.fixture_driving_way,
|
'fixture_driving_way': '' if not item.product_id.fixture_driving_way else
|
||||||
|
item.product_id.fixture_driving_way,
|
||||||
'fixture_apply_machine_tool_type_codes': self.env[
|
'fixture_apply_machine_tool_type_codes': self.env[
|
||||||
'product.template']._json_apply_machine_tool_type_item_code(item),
|
'product.template']._json_apply_machine_tool_type_item_code(item),
|
||||||
'fixture_through_hole_size': item.product_id.fixture_through_hole_size,
|
'fixture_through_hole_size': item.product_id.fixture_through_hole_size,
|
||||||
@@ -463,12 +463,14 @@ class ReStockMove(models.Model):
|
|||||||
'blade_tip_taper': item.product_id.cutting_tool_blade_tip_taper,
|
'blade_tip_taper': item.product_id.cutting_tool_blade_tip_taper,
|
||||||
'blade_helix_angle': item.product_id.cutting_tool_blade_helix_angle,
|
'blade_helix_angle': item.product_id.cutting_tool_blade_helix_angle,
|
||||||
'blade_type': item.product_id.cutting_tool_blade_type,
|
'blade_type': item.product_id.cutting_tool_blade_type,
|
||||||
'coarse_medium_fine': '' if item.product_id.cutting_tool_coarse_medium_fine is False else item.product_id.cutting_tool_coarse_medium_fine,
|
'coarse_medium_fine': '' if item.product_id.cutting_tool_coarse_medium_fine is False else
|
||||||
|
item.product_id.cutting_tool_coarse_medium_fine,
|
||||||
'run_out_accuracy_max': item.product_id.cutting_tool_run_out_accuracy_max,
|
'run_out_accuracy_max': item.product_id.cutting_tool_run_out_accuracy_max,
|
||||||
'run_out_accuracy_min': item.product_id.cutting_tool_run_out_accuracy_min,
|
'run_out_accuracy_min': item.product_id.cutting_tool_run_out_accuracy_min,
|
||||||
'head_diameter': item.product_id.cutting_tool_head_diameter,
|
'head_diameter': item.product_id.cutting_tool_head_diameter,
|
||||||
'diameter': item.product_id.cutting_tool_diameter,
|
'diameter': item.product_id.cutting_tool_diameter,
|
||||||
'blade_number': '' if item.product_id.cutting_tool_blade_number is False else item.product_id.cutting_tool_blade_number,
|
'blade_number': '' if item.product_id.cutting_tool_blade_number is False else
|
||||||
|
item.product_id.cutting_tool_blade_number,
|
||||||
'front_angle': item.product_id.cutting_tool_front_angle,
|
'front_angle': item.product_id.cutting_tool_front_angle,
|
||||||
'rear_angle': item.product_id.cutting_tool_rear_angle,
|
'rear_angle': item.product_id.cutting_tool_rear_angle,
|
||||||
'main_included_angle': item.product_id.cutting_tool_main_included_angle,
|
'main_included_angle': item.product_id.cutting_tool_main_included_angle,
|
||||||
@@ -512,7 +514,8 @@ class ReStockMove(models.Model):
|
|||||||
'inner_diameter': item.product_id.cutting_tool_inner_diameter,
|
'inner_diameter': item.product_id.cutting_tool_inner_diameter,
|
||||||
'cooling_suit_type_ids': item.product_id.cooling_suit_type_ids,
|
'cooling_suit_type_ids': item.product_id.cooling_suit_type_ids,
|
||||||
'er_size_model': item.product_id.cutting_tool_er_size_model,
|
'er_size_model': item.product_id.cutting_tool_er_size_model,
|
||||||
'image': '' if not item.product_id.image_1920 else base64.b64encode(item.product_id.image_1920).decode('utf-8'),
|
'image': '' if not item.product_id.image_1920 else
|
||||||
|
base64.b64encode(item.product_id.image_1920).decode('utf-8'),
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
if item.product_id.industry_code:
|
if item.product_id.industry_code:
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ from . import res_config_setting
|
|||||||
from . import sync_common
|
from . import sync_common
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class FtpController():
|
|||||||
self.ftp.connect(host, port)
|
self.ftp.connect(host, port)
|
||||||
self.ftp.login(username, password)
|
self.ftp.login(username, password)
|
||||||
logging.info("ftp连接成功")
|
logging.info("ftp连接成功")
|
||||||
except:
|
except Exception:
|
||||||
logging.info("ftp连接失败")
|
logging.info("ftp连接失败")
|
||||||
|
|
||||||
# 下载目录下的文件
|
# 下载目录下的文件
|
||||||
@@ -35,7 +35,7 @@ class FtpController():
|
|||||||
server = os.path.join(serverdir, file)
|
server = os.path.join(serverdir, file)
|
||||||
if file.find(".") != -1:
|
if file.find(".") != -1:
|
||||||
self.download_file(server, file)
|
self.download_file(server, file)
|
||||||
except:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# 下载指定目录下的指定文件
|
# 下载指定目录下的指定文件
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import base64
|
import base64
|
||||||
import logging
|
|
||||||
from odoo import models, fields
|
from odoo import models, fields
|
||||||
|
|
||||||
|
|
||||||
class ReSaleOrder(models.Model):
|
class ReSaleOrder(models.Model):
|
||||||
_inherit = 'sale.order'
|
_inherit = 'sale.order'
|
||||||
|
|
||||||
deadline_of_delivery = fields.Date('订单交期')
|
deadline_of_delivery = fields.Date('订单交期', tracking=True)
|
||||||
person_of_delivery = fields.Char('交货人')
|
person_of_delivery = fields.Char('交货人')
|
||||||
telephone_of_delivery = fields.Char('交货人电话号码')
|
telephone_of_delivery = fields.Char('交货人电话号码')
|
||||||
address_of_delivery = fields.Char('交货人地址')
|
address_of_delivery = fields.Char('交货人地址')
|
||||||
payments_way = fields.Selection([('现结', '现结'), ('月结', '月结')], '结算方式', default='现结')
|
payments_way = fields.Selection([('现结', '现结'), ('月结', '月结')], '结算方式', default='现结', tracking=True)
|
||||||
pay_way = fields.Selection([('转账', '转账'), ('微信', '微信'), ('支付宝', '支付宝')], '支付方式')
|
pay_way = fields.Selection([('转账', '转账'), ('微信', '微信'), ('支付宝', '支付宝')], '支付方式')
|
||||||
|
|
||||||
|
payment_term_id = fields.Many2one(
|
||||||
|
comodel_name='account.payment.term',
|
||||||
|
string="交付条件",
|
||||||
|
compute='_compute_payment_term_id',
|
||||||
|
store=True, readonly=False, precompute=True, check_company=True, tracking=True,
|
||||||
|
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||||
|
|
||||||
# 业务平台分配工厂后在智能工厂先创建销售订单
|
# 业务平台分配工厂后在智能工厂先创建销售订单
|
||||||
def sale_order_create(self, company_id, delivery_name, delivery_telephone, delivery_address,
|
def sale_order_create(self, company_id, delivery_name, delivery_telephone, delivery_address,
|
||||||
deadline_of_delivery, payments_way, pay_way):
|
deadline_of_delivery, payments_way, pay_way):
|
||||||
@@ -62,4 +68,3 @@ class ResaleOrderLine(models.Model):
|
|||||||
_inherit = 'sale.order.line'
|
_inherit = 'sale.order.line'
|
||||||
|
|
||||||
model_glb_file = fields.Binary('模型的glb文件')
|
model_glb_file = fields.Binary('模型的glb文件')
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import requests
|
|
||||||
import logging
|
import logging
|
||||||
|
import requests
|
||||||
from odoo import http
|
from odoo import http
|
||||||
from odoo.http import request
|
from odoo.http import request
|
||||||
|
|
||||||
@@ -36,7 +36,8 @@ class WechatAuthController(http.Controller):
|
|||||||
|
|
||||||
if not user:
|
if not user:
|
||||||
# 获取企业微信用户详细信息
|
# 获取企业微信用户详细信息
|
||||||
user_detail_url = f'https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={access_token}&userid={user_id}'
|
user_detail_url = \
|
||||||
|
f'https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={access_token}&userid={user_id}'
|
||||||
user_detail_response = requests.get(user_detail_url).json()
|
user_detail_response = requests.get(user_detail_url).json()
|
||||||
|
|
||||||
# 创建 Odoo 用户
|
# 创建 Odoo 用户
|
||||||
|
|||||||
@@ -6,6 +6,5 @@ from . import wxwork_settings
|
|||||||
from . import wxwork_approval_template_summary
|
from . import wxwork_approval_template_summary
|
||||||
from . import we_approval_record
|
from . import we_approval_record
|
||||||
from . import wx_work_api
|
from . import wx_work_api
|
||||||
|
|
||||||
from . import wxwork_approval
|
from . import wxwork_approval
|
||||||
# from . import res_config_setting
|
|
||||||
|
|||||||
@@ -39,5 +39,3 @@ class WxWorkApprovalTemplate(models.Model):
|
|||||||
def _compute_related_records_count(self):
|
def _compute_related_records_count(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
record.related_records_count = len(record.summary_info_ids)
|
record.related_records_count = len(record.summary_info_ids)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user