初次提交,智能工厂基础数据
This commit is contained in:
4
sf_mrs_sync/__init__.py
Normal file
4
sf_mrs_sync/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from . import models
|
||||
|
||||
pengge
|
||||
27
sf_mrs_sync/__manifest__.py
Normal file
27
sf_mrs_sync/__manifest__.py
Normal file
@@ -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'],
|
||||
'data': [
|
||||
|
||||
'data/sf_cron.xml'
|
||||
|
||||
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'qweb': [
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
}
|
||||
1
sf_mrs_sync/connect/__init__.py
Normal file
1
sf_mrs_sync/connect/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*-coding:utf-8-*-
|
||||
13
sf_mrs_sync/data/sf_cron.xml
Normal file
13
sf_mrs_sync/data/sf_cron.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding='UTF-8'?>
|
||||
<odoo>
|
||||
<record model="ir.cron" id="sf_cron">
|
||||
<field name="name">同步资源库材料</field>
|
||||
<field name="model_id" ref="model_mrs_production_materials"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">model.sync_production_materials()</field>
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">minutes</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field name="doall" eval="False"/>
|
||||
</record>
|
||||
</odoo>
|
||||
2
sf_mrs_sync/models/__init__.py
Normal file
2
sf_mrs_sync/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from. import sf_sync_common
|
||||
73
sf_mrs_sync/models/sf_sync_common.py
Normal file
73
sf_mrs_sync/models/sf_sync_common.py
Normal file
@@ -0,0 +1,73 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
import math
|
||||
import requests
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from datetime import timedelta, datetime
|
||||
|
||||
from odoo import models, fields, api
|
||||
from odoo.exceptions import ValidationError
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MrsProductionMaterials(models.Model):
|
||||
_inherit = "mrs.production.materials"
|
||||
_description = "材料"
|
||||
url = '/api/production_materials/list'
|
||||
|
||||
def sync_production_materials(self):
|
||||
str = '定时同步材料资源库'
|
||||
print(str)
|
||||
return str
|
||||
|
||||
|
||||
class MrsMaterialModel(models.Model):
|
||||
_inherit = 'mrs.materials.model'
|
||||
_description = '材料型号'
|
||||
|
||||
|
||||
class MrsProductionProcess(models.Model):
|
||||
_inherit = 'mrs.production.process'
|
||||
_description = '表面工艺'
|
||||
|
||||
|
||||
class MrsProcessingTechnology(models.Model):
|
||||
_inherit = 'mrs.processing.technology'
|
||||
_description = '加工工艺'
|
||||
|
||||
|
||||
class MachineBrandTags(models.Model):
|
||||
_inherit = 'mrs.machine.brand.tags'
|
||||
_description = '标签'
|
||||
|
||||
|
||||
class MachineControlSystem(models.Model):
|
||||
_inherit = 'mrs.machine_tool.type.control_system'
|
||||
_description = '控制系统'
|
||||
|
||||
|
||||
class MachineBrand(models.Model):
|
||||
_inherit = 'mrs.machine.brand'
|
||||
_description = '品牌'
|
||||
|
||||
|
||||
class MachineTool(models.Model):
|
||||
_inherit = 'mrs.machine_tool'
|
||||
_description = '机床'
|
||||
|
||||
|
||||
class MachineToolType(models.Model):
|
||||
_inherit = 'mrs.machine_tool.type'
|
||||
_description = '机床型号'
|
||||
|
||||
|
||||
class CuttingTool(models.Model):
|
||||
_inherit = 'mrs.cutting_tool.category'
|
||||
_description = '刀具类别'
|
||||
|
||||
|
||||
class CuttingToolType(models.Model):
|
||||
_inherit = 'mrs.cutting_tool.type'
|
||||
_description = '刀具型号'
|
||||
Reference in New Issue
Block a user