1.修复工件配送向导制造订单号能显示5个
2工件配送向导页面优化 3.生成制造订单同时工件配送默认路线
This commit is contained in:
@@ -8,8 +8,8 @@ from datetime import datetime
|
||||
import requests
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
from odoo import models, fields, api
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
|
||||
@@ -6,8 +6,8 @@ import os
|
||||
from datetime import datetime
|
||||
from stl import mesh
|
||||
# from OCC.Core.GProp import GProp_GProps
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
from odoo import models, fields, api
|
||||
from odoo.modules import get_resource_path
|
||||
|
||||
@@ -85,7 +85,8 @@ class ReSaleOrder(models.Model):
|
||||
self.check_status = 'pending'
|
||||
|
||||
def get_customer(self):
|
||||
partner_tag = self.env['res.partner.category'].sudo().search([('name', '=', '业务平台')], limit=1, order='id asc')
|
||||
partner_tag = self.env['res.partner.category'].sudo().search([('name', '=', '业务平台')], limit=1,
|
||||
order='id asc')
|
||||
if not partner_tag:
|
||||
partner_tag = self.env['res.partner.category'].sudo().create({'name': '平台客户'})
|
||||
customer = self.env['res.partner'].search([('name', '=', '业务平台')], limit=1, order='id asc')
|
||||
@@ -139,9 +140,19 @@ class ResaleOrderLine(models.Model):
|
||||
_inherit = 'sale.order.line'
|
||||
|
||||
model_glb_file = fields.Binary('模型的glb文件')
|
||||
# product_template_id = fields.Many2one(
|
||||
# string="产品",
|
||||
# comodel_name='product.template',
|
||||
# compute='_compute_product_template_id',
|
||||
# readonly=False,
|
||||
# search='_search_product_template_id',
|
||||
# # previously related='product_id.product_tmpl_id'
|
||||
# # not anymore since the field must be considered editable for product configurator logic
|
||||
# # without modifying the related product_id when updated.
|
||||
# domain=[('sale_ok', '=', True), ('categ_type', '=', '成品')])
|
||||
check_status = fields.Selection(related='order_id.check_status')
|
||||
|
||||
@api.onchange('product_id')
|
||||
@api.onchange('product_template_id')
|
||||
def _compute_model_glb_file(self):
|
||||
for line in self:
|
||||
if line.product_template_id:
|
||||
|
||||
@@ -117,6 +117,10 @@
|
||||
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before">
|
||||
<field name="model_glb_file" widget="Viewer3D" optional="show"
|
||||
string="模型文件" attrs="{'readonly': [('state', 'in', ['draft'])]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/tree/field[@name='product_template_id']" position="attributes">
|
||||
<attribute name="options">{'no_create': True}</attribute>
|
||||
<attribute name="context">{'is_sale_order_line': True }</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||
|
||||
Reference in New Issue
Block a user