配送空料架开放新建
This commit is contained in:
@@ -1332,6 +1332,8 @@ class WorkPieceDelivery(models.Model):
|
|||||||
def create(self, vals):
|
def create(self, vals):
|
||||||
if vals.get('name', '/') == '/' or vals.get('name', '/') is False:
|
if vals.get('name', '/') == '/' or vals.get('name', '/') is False:
|
||||||
vals['name'] = self.env['ir.sequence'].next_by_code('sf.workpiece.delivery') or '/'
|
vals['name'] = self.env['ir.sequence'].next_by_code('sf.workpiece.delivery') or '/'
|
||||||
|
else:
|
||||||
|
vals['type'] = '运送空料架'
|
||||||
obj = super(WorkPieceDelivery, self).create(vals)
|
obj = super(WorkPieceDelivery, self).create(vals)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import os
|
|||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
from OCC.Extend.DataExchange import read_step_file
|
# from OCC.Extend.DataExchange import read_step_file
|
||||||
from OCC.Extend.DataExchange import write_stl_file
|
# from OCC.Extend.DataExchange import write_stl_file
|
||||||
|
|
||||||
|
|
||||||
class ResProductMo(models.Model):
|
class ResProductMo(models.Model):
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<tree editable="bottom">
|
<tree editable="bottom">
|
||||||
<field name="name" required="1"/>
|
<field name="name" required="1"/>
|
||||||
<field name="type" readonly="1" string="任务类型"/>
|
<field name="type" readonly="1" string="任务类型"/>
|
||||||
<field name="route_type" string="类型"/>
|
<field name="route_type" string="类型" required="1"/>
|
||||||
<field name="start_site_id" required="1" options="{'no_create': True}" string="起点接驳站"/>
|
<field name="start_site_id" required="1" options="{'no_create': True}" string="起点接驳站"/>
|
||||||
<field name="end_site_id" required="1" options="{'no_create': True}" string="终点接驳站"/>
|
<field name="end_site_id" required="1" options="{'no_create': True}" string="终点接驳站"/>
|
||||||
<field name="destination_production_line_id" required="1" options="{'no_create': True}"/>
|
<field name="destination_production_line_id" required="1" options="{'no_create': True}"/>
|
||||||
|
|||||||
@@ -668,14 +668,18 @@
|
|||||||
<field name="name">空料架配送</field>
|
<field name="name">空料架配送</field>
|
||||||
<field name="model">sf.workpiece.delivery</field>
|
<field name="model">sf.workpiece.delivery</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="工件配送" class="center" create="0" edit="0" delete="0">
|
<tree string="工件配送" editable="bottom" class="center" delete="0">
|
||||||
<header>
|
<header>
|
||||||
<button name="button_delivery" type="object" string="配送" class="oe_highlight"/>
|
<button name="button_delivery" type="object" string="配送" class="oe_highlight"/>
|
||||||
</header>
|
</header>
|
||||||
<field name="name" string="路线名称" readonly="1"/>
|
<field name="name" string="路线名称" attrs="{'readonly': [('id', '!=', False)]}"
|
||||||
<field name="route_id" options="{'no_create': True}"/>
|
placeholder="例如:运送空料架路线:G01-A01" required="1" force_save="1"/>
|
||||||
<field name="feeder_station_start_id" readonly="1"/>
|
<field name="route_id" options="{'no_create': True}" required="1"
|
||||||
<field name="feeder_station_destination_id" readonly="1"/>
|
attrs="{'readonly': [('id', '!=', False)]}" domain="[('route_type', '=', '运送空料架')]"
|
||||||
|
force_save="1"/>
|
||||||
|
<field name="feeder_station_start_id" readonly="1" force_save="1"/>
|
||||||
|
<!-- <field name="type" readonly="1"/>-->
|
||||||
|
<field name="feeder_station_destination_id" readonly="1" force_save="1"/>
|
||||||
<button name="action_delivery_history" type="object" class="btn btn-link text-info" icon="fa-history"
|
<button name="action_delivery_history" type="object" class="btn btn-link text-info" icon="fa-history"
|
||||||
string="历史"/>
|
string="历史"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import os
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from stl import mesh
|
from stl import mesh
|
||||||
# from OCC.Core.GProp import GProp_GProps
|
# from OCC.Core.GProp import GProp_GProps
|
||||||
from OCC.Extend.DataExchange import read_step_file
|
# from OCC.Extend.DataExchange import read_step_file
|
||||||
from OCC.Extend.DataExchange import write_stl_file
|
# from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
|
|||||||
Reference in New Issue
Block a user