Accept Merge Request #516: (feature/制造优化 -> develop)
Merge Request: 梳理计划模块结构,删除不必要的代码 Created By: @马广威 Accepted By: @马广威 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/516
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'views/view.xml',
|
||||
# 'views/duration_view.xml'
|
||||
],
|
||||
|
||||
'assets': {
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
from .import controllers
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import json
|
||||
import logging
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class ProductionPlan(http.Controller):
|
||||
|
||||
@http.route('/api/production/plan', type='http', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||
cors="*")
|
||||
def schedule_orders(self, **kw):
|
||||
"""
|
||||
排程订单
|
||||
"""
|
||||
logging.info('schedule_orders', kw)
|
||||
|
||||
@@ -2,4 +2,3 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import custom_plan
|
||||
# from . import duration
|
||||
|
||||
@@ -102,12 +102,6 @@ class sf_production_plan(models.Model):
|
||||
self.date_planned_finished = None
|
||||
self.state = 'draft'
|
||||
|
||||
# @api.model
|
||||
# def create(self, vals):
|
||||
# if 'sequence' not in vals:
|
||||
# vals['sequence'] = self.env['sf.production.plan'].search_count([]) + 1
|
||||
# return super().create(vals)
|
||||
|
||||
def unlink(self):
|
||||
sequence_to_reorder = self.mapped('sequence')
|
||||
res = super().unlink()
|
||||
@@ -169,6 +163,9 @@ class sf_production_plan(models.Model):
|
||||
|
||||
# 当不设置计划结束时间时,增加计算计划结束时间的方法,根据采购周期加缓冲期两个值来算就可以了
|
||||
def do_production_schedule(self):
|
||||
"""
|
||||
排程方法
|
||||
"""
|
||||
if not self.production_line_id:
|
||||
raise ValidationError("未选择生产线")
|
||||
else:
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import base64
|
||||
import json, requests
|
||||
from odoo import models, fields, api, _
|
||||
from datetime import datetime, timedelta
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
|
||||
class HoleDuration(models.Model):
|
||||
_name = 'hole.duration'
|
||||
_description = 'Hole Duration'
|
||||
|
||||
hole_diameter = fields.Selection([('3', '≤¢3'), ('6', '≤¢6'), ('10', '≤¢10'), ('12', '≤¢12'), ('16', '≤¢16'), ('25', '≤¢25')], string='孔径', required=True)
|
||||
name = fields.Char(string='名称', required=True, default='钻孔')
|
||||
hole_depth = fields.Selection([
|
||||
('10', '≤10'),
|
||||
('30', '≤30'),
|
||||
('50', '≤50'),
|
||||
('70', '≤70'),
|
||||
('90', '≤90'),
|
||||
('100', '≤100'),
|
||||
('120', '≤120'),
|
||||
('150', '≤150')], string='深度', required=True)
|
||||
working_hours = fields.Float(string='工时', required=True)
|
||||
hole_expansion = fields.Float(string='扩孔', required=True, default=0.6)
|
||||
@@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="hole_duration_tree" model="ir.ui.view">
|
||||
<field name="name">hole.duration.tree</field>
|
||||
<field name="model">hole.duration</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="孔加工">
|
||||
<field name="name"/>
|
||||
<field name="hole_diameter"/>
|
||||
<field name="hole_depth"/>
|
||||
<field name="working_hours"/>
|
||||
<field name="hole_expansion"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hole_duration_form" model="ir.ui.view">
|
||||
<field name="name">hole.duration.form</field>
|
||||
<field name="model">hole.duration</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="孔加工">
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="hole_diameter"/>
|
||||
<field name="hole_depth"/>
|
||||
<field name="working_hours"/>
|
||||
<field name="hole_expansion"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hole_duration_action" model="ir.actions.act_window">
|
||||
<field name="name">孔加工</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hole.duration</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
id="hole_duration_menu"
|
||||
name="孔加工"
|
||||
sequence="900"
|
||||
action="hole_duration_action"
|
||||
parent="sf_production_plan_menu"
|
||||
/>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user