1.销售模块的销售页面的订单行展示模型
2.表面工艺及类别菜单的排序
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
id="menu_sf_production_process"
|
||||
name="表面工艺"
|
||||
parent="menu_sf_production_process_1"
|
||||
sequence="1"
|
||||
sequence="2"
|
||||
action="sf_production_process"
|
||||
/>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
id="menu_sf_production_process_category"
|
||||
name="表面工艺类别"
|
||||
parent="menu_sf_production_process_1"
|
||||
sequence="2"
|
||||
sequence="1"
|
||||
action="sf_production_process_category"
|
||||
/>
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
id="menu_sf_processing_technology"
|
||||
name="加工工艺"
|
||||
parent="menu_sf_production_process_1"
|
||||
sequence="1"
|
||||
sequence="3"
|
||||
action="sf_processing_technology"/>
|
||||
|
||||
<!-- <menuitem-->
|
||||
|
||||
@@ -203,12 +203,14 @@ class ResProductTemplate(models.Model):
|
||||
if vals.get('upload_model_file'):
|
||||
if vals.get('is_bfm') is False and vals.get('categ_type') == '成品':
|
||||
for item in vals['upload_model_file']:
|
||||
logging.info('create-attachment:%s' % int(item[2][0]))
|
||||
attachment = self.env['ir.attachment'].sudo().search([('id', '=', int(item[2][0]))])
|
||||
base64_data = base64.b64encode(attachment.datas)
|
||||
base64_datas = base64_data.decode('utf-8')
|
||||
model_code = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
|
||||
report_path = attachment._full_path(attachment.store_fname)
|
||||
vals['model_file'] = self.transition_glb_file(report_path, model_code)
|
||||
logging.info('create-model_file:%s' % len(vals['model_file']))
|
||||
self._sanitize_vals(vals)
|
||||
templates = super(ResProductTemplate, self).create(vals_list)
|
||||
if "create_product_product" not in self._context:
|
||||
@@ -222,7 +224,7 @@ class ResProductTemplate(models.Model):
|
||||
related_vals[field_name] = vals[field_name]
|
||||
if related_vals:
|
||||
template.write(related_vals)
|
||||
|
||||
logging.info('create-model_file:%s' % templates.model_file)
|
||||
return templates
|
||||
|
||||
@api.onchange('upload_model_file')
|
||||
|
||||
@@ -48,5 +48,13 @@ class ReSaleOrder(models.Model):
|
||||
product.materials_id.name),
|
||||
'price_unit': product.list_price,
|
||||
'product_uom_qty': item['number'],
|
||||
# 'model_glb_file': product.model_file,
|
||||
}
|
||||
return self.env['sale.order.line'].create(vals)
|
||||
|
||||
|
||||
class ResaleOrderLine(models.Model):
|
||||
_inherit = 'sale.order.line'
|
||||
|
||||
model_glb_file = fields.Binary('模型的glb文件', related='product_id.model_file')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user