Merge branch 'feature/wechat_message' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/销售和排程添加消息推送

This commit is contained in:
jinling.yang
2024-09-20 16:57:19 +08:00
17 changed files with 46 additions and 16 deletions

View File

@@ -3,6 +3,7 @@ from odoo import models, fields, api
class SaleOrder(models.Model):
_name = "sale.order"
_description = "销售订单"
_inherit = ["sale.order", "jikimo.message.dispatch"]
def create(self, vals_list):

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

View File

@@ -234,7 +234,7 @@
</record>
<menuitem name="系统工单" id="work_order_1_list" web_icon="jikimo_system_order,static/description/icon.png"/>
<menuitem name="系统工单" id="work_order_1_list" web_icon="jikimo_system_order,static/description/系统工单.png"/>
<menuitem name="工单" id="work_order" parent="work_order_1_list" action="system_order"/>
<menuitem name="工单模板" id="work_order_template" parent="work_order_1_list" action="work_template" groups="jikimo_system_order.group_operations_permissions_rwc"/>
<menuitem name="工单分类" id="work_order_type" parent="work_order_1_list" action="classify" groups="jikimo_system_order.group_operations_permissions_rwc"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

View File

@@ -1024,7 +1024,7 @@
<menuitem
id="menu_quality_root"
name="Quality"
web_icon="quality_control,static/description/icon.svg"
web_icon="quality_control,static/description/质量.png"
sequence="150"
groups="quality.group_quality_user"/>

View File

@@ -1,2 +1,3 @@
pystrich
cpca
pycryptodome==3.20

View File

@@ -242,3 +242,8 @@ access_sf_fixture_materials_basic_parameters_group_sf_stock_manager,sf_fixture_m
access_sf_multi_mounting_type_group_sf_stock_manager,sf_multi_mounting_type_group_sf_stock_manager,model_sf_multi_mounting_type,sf_base.group_sf_stock_manager,1,0,0,0
access_sf_machine_brand_group_sf_stock_manager,sf_machine_brand_group_sf_stock_manager,model_sf_machine_brand,sf_base.group_sf_stock_manager,1,0,0,0
access_sf_cutting_tool_type_group_sf_stock_manager,sf_cutting_tool_type_group_sf_stock_manager,model_sf_cutting_tool_type,sf_base.group_sf_stock_manager,1,0,0,0
access_sf_cutting_tool_material_group_plan_dispatch,sf_cutting_tool_material_group_plan_dispatch,model_sf_cutting_tool_material,sf_base.group_plan_dispatch,1,0,0,0
access_sf_functional_cutting_tool_model_group_plan_dispatch,sf_functional_cutting_tool_model_group_plan_dispatch,model_sf_functional_cutting_tool_model,sf_base.group_plan_dispatch,1,0,0,0
access_sf_cutting_tool_type_group_plan_dispatch,sf_cutting_tool_type_group_plan_dispatch,model_sf_cutting_tool_type,sf_base.group_plan_dispatch,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
242
243
244
245
246
247
248
249

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

View File

@@ -1230,5 +1230,9 @@
action="hr_equipment_action1"
sequence="0"/>
<menuitem
id="maintenance.menu_maintenance_title"
web_icon="sf_maintenance,static/description/维护.png"/>
</odoo>

View File

@@ -184,6 +184,7 @@ class WorkpieceDeliveryWizard(models.TransientModel):
if not barcode.isdigit():
# 判断是否是AGV接驳站名称
agv_site = self.env['sf.agv.site'].search([('name', '=', barcode)])
if agv_site:
self.feeder_station_start_id = agv_site.id # 修正:移除 .id
return

View File

@@ -16,11 +16,11 @@ class ResConfigSettings(models.TransientModel):
token = fields.Char(string='TOKEN', default='b811ac06-3f00-11ed-9aed-0242ac110003')
sf_secret_key = fields.Char(string='密钥', default='wBmxej38OkErKhD6')
sf_url = fields.Char(string='访问地址', default='https://sf.cs.jikimo.com')
center_control_url = fields.Char(string='中控访问地址',
default='http://172.16.21.50:8001')
center_control_Authorization = fields.Char(string='中控访问认证')
task_type_no = fields.Char('任务单类型编号')
model_parser_url = fields.Char('特征识别路径')
ftp_host = fields.Char(string='FTP的ip')
ftp_port = fields.Char(string='FTP端口')

View File

@@ -9,7 +9,7 @@
<field name="name">jikimo.bom.form</field>
<field name="model">jikimo.bom</field>
<field name="arch" type="xml">
<form>
<form create="False">
<header>
<button type="action" name="%(action_jikimo_bom_wizard)d"
class="btn btn-info" string="组装方式.." context="{'default_bom_id':id}"
@@ -31,7 +31,7 @@
<notebook colspan="4">
<page string="物料清单">
<field name="product_ids" context="{'jikimo_bom_product': True}">
<tree>
<tree create="False">
<field name="name"/>
<!-- <field name="categ_id"/>-->
<field name="cutting_tool_material_id"/>

View File

@@ -20,7 +20,7 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='extension']" position="after">
<searchpanel>
<field name="knife_handle_model" enable_counters="1"/>
<field name="functional_cutting_tool_model_id" enable_counters="1"/>
<!-- <field name="job_id" enable_counters="1"/>-->
<!-- <field name="department_id" enable_counters="1"/>-->
<!-- <field name="company_id" enable_counters="1"/>-->

View File

@@ -17,6 +17,22 @@ class JikimoBomWizard(models.TransientModel):
], string='组装方式', required=True)
is_ok = fields.Boolean('确认上述信息正确无误。')
@api.model
def default_get(self, fields):
res = super(JikimoBomWizard, self).default_get(fields)
# 根据某个字段的值设置默认选项
if 'default_bom_id' in self.env.context:
jikimo_bom = self.env['jikimo.bom'].browse(self.env.context['default_bom_id'])
if not jikimo_bom:
return res
if jikimo_bom.options:
res['assembly_options'] = jikimo_bom.options
# some_field_value = self.env.context.get('some_field')
# if some_field_value == 'condition_value':
# res['default_option'] = 'option2' # 设置为特定选项
return res
def submit(self):
if not self.bom_id:
raise UserError('缺少bom信息')

View File

@@ -931,13 +931,6 @@ class SfStockMoveLine(models.Model):
if not record.destination_location_id.product_id:
record.destination_location_id.product_id = record.product_id.id
@api.model_create_multi
def create(self, vals_list):
records = super(SfStockMoveLine, self).create(vals_list)
self.put_shelf_location(records)
return records
class SfStockPicking(models.Model):
_inherit = 'stock.picking'
@@ -1122,6 +1115,12 @@ class SfPickingType(models.Model):
'sf_warehouse.group_sf_stock_manager'
)
def _get_action(self, action_xmlid):
action = super(SfPickingType, self)._get_action(action_xmlid)
if not self.env.user.has_group('base.group_system'):
action['context']['create'] = False
return action
class CustomStockMove(models.Model):
_name = 'stock.move'

View File

@@ -4,6 +4,7 @@
<record model="ir.actions.act_window" id="stock.stock_picking_type_action">
<field name="context">{'search_default_groupby_code':1}</field>
<field name="domain">[('name', '!=', '制造')]</field>
</record>
<record id="view_location_form_sf_inherit" model="ir.ui.view">

View File

@@ -77,18 +77,20 @@ class ShelfLocationWizard(models.TransientModel):
def confirm_the_change(self):
if self.destination_barcode_id:
stocks = []
if self.lot_id:
self.current_barcode_id.product_sn_id = False
self.destination_barcode_id.product_sn_id = self.lot_id.id
self.create_stock_moves(self.lot_id, 1)
stocks = self.create_stock_moves(self.lot_id, 1)
elif self.current_product_sn_ids:
for current_product_sn_id in self.current_product_sn_ids:
self.create_stock_moves(current_product_sn_id.lot_id, current_product_sn_id.qty_num)
stocks = self.create_stock_moves(current_product_sn_id.lot_id, current_product_sn_id.qty_num)
current_product_sn_id.write({
'qty_num': 0
})
else:
raise ValidationError('没有需要变更的批次/序列号!')
self.env['stock.move.line'].sudo().put_shelf_location(stocks[-1])
else:
raise ValidationError('请选择目标货位编码!')