质量模块和库存扫码

This commit is contained in:
qihao.gong@jikimo.com
2023-07-24 11:42:15 +08:00
parent 8d024ad625
commit 3c89404543
228 changed files with 142596 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import worksheet_custom_reports

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="worksheet_page">
<div class="page">
<h1 class="mt-4 mb-4">
Quality Check: <span t-field="doc.name"/>
<span style="float:right" t-field="doc.quality_state"/>
</h1>
<t name="origin">
<div name="picking" t-if="doc.picking_id">
<strong>Transfer : </strong>
<span t-field="doc.picking_id.display_name"/>
</div>
</t>
<div>
<strong>Product : </strong>
<span t-field="doc.product_id.display_name"/>
</div>
<div name="lot" t-if="doc.lot_id">
<strong>Lot/Serial Number : </strong>
<span t-field="doc.lot_id.display_name"/>
</div>
<div t-if="doc.user_id">
<strong>Tested by : </strong>
<span t-field="doc.user_id.display_name"/>
</div>
<div t-if="doc.control_date">
<strong>Tested on : </strong>
<span t-field="doc.control_date"/>
</div>
<div>
<strong>Test Type : </strong>
<span t-field="doc.test_type_id.display_name"/>
</div>
<div t-if="doc.additional_note">
<strong>Notes : </strong>
<span t-field="doc.additional_note"/>
</div>
<t name="qc_content">
<div t-if="doc.test_type == 'measure'">
<hr/>
<div>
<strong>Measure : </strong>
<span t-field="doc.result"/>
</div>
<div t-if="doc.warning_message">
<strong>Warning : </strong>
<span t-field="doc.warning_message"/>
</div>
</div>
<div t-if="doc.test_type == 'picture'">
<hr/>
<img width="750" t-attf-src="#{image_data_uri(doc.picture)}" alt="Quality Check Picture"/>
</div>
</t>
</div>
</template>
<template id="quality_worksheet">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="web.external_layout">
<t t-call="quality_control.worksheet_page" t-lang="doc.partner_id.lang"/>
</t>
</t>
</t>
</template>
<template id="quality_worksheet_internal">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="web.internal_layout">
<t t-call="quality_control.worksheet_page"/>
</t>
</t>
</t>
</template>
</data>
</odoo>

View File

@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class QualityCustomReport(models.AbstractModel):
_name = 'report.quality_control.quality_worksheet'
_description = 'Quality Worksheet Report'
@api.model
def _get_report_values(self, docids, data=None):
docs = self.env['quality.check'].browse(docids).sudo()
return {
'doc_ids': docids,
'doc_model': 'quality.check',
'docs': docs,
}
class QualityCustomInternalReport(models.AbstractModel):
_name = 'report.quality_control.quality_worksheet_internal'
_description = 'Quality Worksheet Internal Report'
_inherit = 'report.quality_control.quality_worksheet'

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="quality_check_report" model="ir.actions.report">
<field name="name">Worksheet Report - External (PDF)</field>
<field name="model">quality.check</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">quality_control.quality_worksheet</field>
<field name="report_file">quality_control.quality_worksheet</field>
<field name="print_report_name">'Worksheet_%s' % object.name</field>
<field name="binding_model_id" ref="model_quality_check"/>
<field name="binding_type">report</field>
</record>
<record id="quality_check_report_internal" model="ir.actions.report">
<field name="name">Worksheet Report - Internal (PDF)</field>
<field name="model">quality.check</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">quality_control.quality_worksheet_internal</field>
<field name="report_file">quality_control.quality_worksheet_internal</field>
<field name="print_report_name">'Worksheet_%s' % object.name</field>
<field name="binding_model_id" ref="model_quality_check"/>
<field name="binding_type">report</field>
</record>
</data>
</odoo>