Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/commercially_launched
This commit is contained in:
@@ -4,15 +4,15 @@ from odoo import fields, models, api, _
|
|||||||
class StatusChange(models.Model):
|
class StatusChange(models.Model):
|
||||||
_inherit = 'sale.order'
|
_inherit = 'sale.order'
|
||||||
|
|
||||||
def action_confirm(self):
|
# def action_confirm(self):
|
||||||
res = super(StatusChange, self).action_confirm()
|
# res = super(StatusChange, self).action_confirm()
|
||||||
# 采购申请自动确认
|
# # 采购申请自动确认
|
||||||
pr_ids = self.env["purchase.request"].sudo().search(
|
# pr_ids = self.env["purchase.request"].sudo().search(
|
||||||
[('origin', 'like', self.name), ('rule_new_add', '=', True)])
|
# [('origin', 'like', self.name), ('rule_new_add', '=', True)])
|
||||||
if pr_ids:
|
# if pr_ids:
|
||||||
pr_ids.write({'need_validation': False})
|
# pr_ids.write({'need_validation': False})
|
||||||
pr_ids.write({"state": "approved"})
|
# pr_ids.write({"state": "approved"})
|
||||||
return res
|
# return res
|
||||||
|
|
||||||
purchase_request_purchase_order_count = fields.Integer('采购申请单数量', compute='_compute_purchase_request_count',
|
purchase_request_purchase_order_count = fields.Integer('采购申请单数量', compute='_compute_purchase_request_count',
|
||||||
store=True)
|
store=True)
|
||||||
|
|||||||
@@ -42,3 +42,15 @@ class StockRule(models.Model):
|
|||||||
request_line_data = rule._prepare_purchase_request_line(pr, procurement)
|
request_line_data = rule._prepare_purchase_request_line(pr, procurement)
|
||||||
request_line_data.update({'origin': procurement.origin})
|
request_line_data.update({'origin': procurement.origin})
|
||||||
purchase_request_line_model.create(request_line_data)
|
purchase_request_line_model.create(request_line_data)
|
||||||
|
|
||||||
|
def _run_buy(self, procurements):
|
||||||
|
res = super(StockRule, self)._run_buy(procurements)
|
||||||
|
# 判断是否根据规则生成新的采购申请单据,如果生成则修改状态为 approved
|
||||||
|
origins = list(set([procurement[0].origin for procurement in procurements]))
|
||||||
|
for origin in origins:
|
||||||
|
pr_ids = self.env["purchase.request"].sudo().search(
|
||||||
|
[('origin', 'like', origin), ('rule_new_add', '=', True), ('state', '=', 'draft')])
|
||||||
|
if pr_ids:
|
||||||
|
pr_ids.write({'need_validation': False})
|
||||||
|
pr_ids.write({"state": "approved", 'need_validation': True, 'rule_new_add': False})
|
||||||
|
return res
|
||||||
|
|||||||
@@ -332,12 +332,12 @@
|
|||||||
<!-- 测量page内有一个添加测量值按钮,点击可以新增一行测量值,新增的行在tree视图中显示,显示的列有:序号、检测项目、测量值1、测量值2、测量值3、测量值4、测量值5、判定、备注。其中检测项目、测量值1、测量值2、测量值3、测量值4、测量值5为必填项,判定为下拉框,默认选中合格,备注为文本框。 -->
|
<!-- 测量page内有一个添加测量值按钮,点击可以新增一行测量值,新增的行在tree视图中显示,显示的列有:序号、检测项目、测量值1、测量值2、测量值3、测量值4、测量值5、判定、备注。其中检测项目、测量值1、测量值2、测量值3、测量值4、测量值5为必填项,判定为下拉框,默认选中合格,备注为文本框。 -->
|
||||||
<page string="测量" name="measure" attrs="{'invisible': [('is_out_check', '=', False)]}">
|
<page string="测量" name="measure" attrs="{'invisible': [('is_out_check', '=', False)]}">
|
||||||
<div class="o_row">
|
<div class="o_row">
|
||||||
<button name="add_measure_line" type="object" class="btn-primary" string="添加测量值"/>
|
<button name="add_measure_line" type="object" class="btn-primary" string="添加测量值" attrs="{'invisible': [('publish_status', '=', 'published')]}"/>
|
||||||
<button name="remove_measure_line" type="object" class="btn-primary" string="删除测量值"/>
|
<button name="remove_measure_line" type="object" class="btn-primary" string="删除测量值" attrs="{'invisible': [('publish_status', '=', 'published')]}"/>
|
||||||
<button name="%(quality_control.import_complex_model_wizard)d" string="上传"
|
<button name="%(quality_control.import_complex_model_wizard)d" string="上传"
|
||||||
type="action"
|
type="action"
|
||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
attrs="{'force_show':1}"
|
attrs="{'force_show':1, 'invisible': [('publish_status', '=', 'published')]}"
|
||||||
context="{'default_model_name': 'quality.check.measure.line', 'default_check_id': id}"/>
|
context="{'default_model_name': 'quality.check.measure.line', 'default_check_id': id}"/>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<!-- 定义页脚模板 -->
|
<!-- 定义页脚模板 -->
|
||||||
<template id="report_quality_footer">
|
<template id="report_quality_footer">
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div style="border-top: 2px solid black;"></div>
|
<div style="border-top: 3px solid black;"></div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
@@ -44,10 +44,10 @@
|
|||||||
<p>加工工厂: <span t-field="o.company_id.factory_name"/></p>
|
<p>加工工厂: <span t-field="o.company_id.factory_name"/></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="border-top: 2px solid black;"></div>
|
<!-- <div style="border-top: 2px solid black;"></div> -->
|
||||||
<!-- <div class="text-center">
|
<div class="text-center">
|
||||||
<span>第<span class="page"/> 页/共 <span class="topage"/>页</span>
|
<span>第<span class="page"/> 页/共 <span class="topage"/>页</span>
|
||||||
</div> -->
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template id="report_quality_inspection">
|
<template id="report_quality_inspection">
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<t t-call="sf_quality.report_quality_header"/>
|
<t t-call="sf_quality.report_quality_header"/>
|
||||||
|
|
||||||
|
|
||||||
<div class="page">
|
<div class="page" style="min-height: 800px; position: relative; padding-bottom: 150px;">
|
||||||
|
|
||||||
<table class="table table-sm o_main_table mt-4" style="border: 1px solid black;">
|
<table class="table table-sm o_main_table mt-4" style="border: 1px solid black;">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -117,36 +117,35 @@
|
|||||||
<img src="/sf_quality/static/img/pass.png" style="width: 200px; height: 200px;position: absolute; bottom: 20px; right: 20%;"/>
|
<img src="/sf_quality/static/img/pass.png" style="width: 200px; height: 200px;position: absolute; bottom: 20px; right: 20%;"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row mt-4">
|
<div style="clear: both; margin-top: 30px; padding-top: 10px;">
|
||||||
<div class="col-12">
|
<div style="display: inline-block;">
|
||||||
<h5 style="font-size: 18px;">检验结论:
|
<span style="font-size: 18px; font-weight: bold;">检验结论: </span>
|
||||||
<span t-if="o.report_result == 'OK'" style="margin-left: 30px;">
|
<span t-if="o.report_result == 'OK'" style="margin-left: 30px; display: inline-block;">
|
||||||
<svg width="20" height="20" style="vertical-align: -3px;">
|
<svg width="20" height="20" style="vertical-align: middle;">
|
||||||
<rect x="1" y="1" width="18" height="18" fill="none" stroke="black" stroke-width="1.5"/>
|
<rect x="1" y="1" width="18" height="18" fill="none" stroke="black" stroke-width="1.5"/>
|
||||||
<path d="M4 10 L9 15 L16 6" stroke="black" stroke-width="2" fill="none"/>
|
<path d="M4 10 L9 15 L16 6" stroke="black" stroke-width="2" fill="none"/>
|
||||||
</svg>
|
</svg>
|
||||||
<span style="margin-left: 5px;">合格</span>
|
<span style="margin-left: 5px;">合格</span>
|
||||||
</span>
|
</span>
|
||||||
<span t-else="" style="margin-left: 30px;">
|
<span t-else="" style="margin-left: 30px; display: inline-block;">
|
||||||
<svg width="20" height="20" style="vertical-align: -3px;">
|
<svg width="20" height="20" style="vertical-align: middle;">
|
||||||
<rect x="1" y="1" width="18" height="18" fill="none" stroke="black" stroke-width="1.5"/>
|
<rect x="1" y="1" width="18" height="18" fill="none" stroke="black" stroke-width="1.5"/>
|
||||||
</svg>
|
</svg>
|
||||||
<span style="margin-left: 5px;">合格</span>
|
<span style="margin-left: 5px;">合格</span>
|
||||||
</span>
|
</span>
|
||||||
<span t-if="o.report_result == 'NG'" style="margin-left: 50px;">
|
<span t-if="o.report_result == 'NG'" style="margin-left: 50px; display: inline-block;">
|
||||||
<svg width="20" height="20" style="vertical-align: -3px;">
|
<svg width="20" height="20" style="vertical-align: middle;">
|
||||||
<rect x="1" y="1" width="18" height="18" fill="none" stroke="black" stroke-width="1.5"/>
|
<rect x="1" y="1" width="18" height="18" fill="none" stroke="black" stroke-width="1.5"/>
|
||||||
<path d="M4 10 L9 15 L16 6" stroke="black" stroke-width="2" fill="none"/>
|
<path d="M4 10 L9 15 L16 6" stroke="black" stroke-width="2" fill="none"/>
|
||||||
</svg>
|
</svg>
|
||||||
<span style="margin-left: 5px;">不合格</span>
|
<span style="margin-left: 5px;">不合格</span>
|
||||||
</span>
|
</span>
|
||||||
<span t-else="" style="margin-left: 50px;">
|
<span t-else="" style="margin-left: 50px; display: inline-block;">
|
||||||
<svg width="20" height="20" style="vertical-align: -3px;">
|
<svg width="20" height="20" style="vertical-align: middle;">
|
||||||
<rect x="1" y="1" width="18" height="18" fill="none" stroke="black" stroke-width="1.5"/>
|
<rect x="1" y="1" width="18" height="18" fill="none" stroke="black" stroke-width="1.5"/>
|
||||||
</svg>
|
</svg>
|
||||||
<span style="margin-left: 5px;">不合格</span>
|
<span style="margin-left: 5px;">不合格</span>
|
||||||
</span>
|
</span>
|
||||||
</h5>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -158,17 +157,20 @@
|
|||||||
<p><strong>质检员: </strong> <span t-field="o.quality_manager"/></p>
|
<p><strong>质检员: </strong> <span t-field="o.quality_manager"/></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="border-top: 3px solid black;"></div>
|
||||||
|
|
||||||
<!-- 添加合格标签 -->
|
<!-- 添加合格标签 -->
|
||||||
|
|
||||||
<!-- <div class="row mt-5">
|
<!-- <div class="row mt-5">
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 text-center">
|
||||||
<p>(以下空白)</p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<!-- 调用自定义页脚 -->
|
<!-- 页脚固定在底部 -->
|
||||||
|
<!-- <div style="position: absolute; bottom: 0; left: 0; right: 0;"> -->
|
||||||
<t t-call="sf_quality.report_quality_footer"/>
|
<t t-call="sf_quality.report_quality_footer"/>
|
||||||
|
<!-- </div> -->
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
|
|||||||
Reference in New Issue
Block a user