21 changed files with 238 additions and 267 deletions
@ -1,11 +1,6 @@ |
|||||
## Module <manufacturing_reports> |
## Module <manufacturing_reports> |
||||
|
|
||||
#### 17.02.2023 |
#### 17.02.2023 |
||||
#### Version 15.0.1.0.0 |
#### Version 14.0.1.0.0 |
||||
##### ADD |
##### ADD |
||||
- Initial commit for Manufacturing Reports |
- Initial commit |
||||
|
|
||||
#### 10.07.2023 |
|
||||
#### Version 15.0.1.0.0 |
|
||||
#### UPDT |
|
||||
- Bug Fix for the xlsx report not printing issue in Manufacturing Reports |
|
||||
|
@ -0,0 +1,44 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<template id="report_mrp_order"> |
||||
|
<t t-call="web.html_container"> |
||||
|
<t t-call="web.external_layout"> |
||||
|
<div class="page"> |
||||
|
<h1><strong>MRP Order Report</strong></h1> |
||||
|
<t t-if="date_from"><p><strong>Date From : </strong> |
||||
|
<t t-esc="date_from"/></p></t> |
||||
|
<t t-if="stage"><p><strong>State : </strong> |
||||
|
<t t-esc="stage"/></p></t> |
||||
|
<table class="table table-sm table-striped mt-4"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>Reference</th> |
||||
|
<th>Image</th> |
||||
|
<th>Product</th> |
||||
|
<th>Quantity</th> |
||||
|
<th>Unit</th> |
||||
|
<th>Responsible</th> |
||||
|
<th>Start Date</th> |
||||
|
<th>State</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<tr t-foreach="mrp" t-as="rec"> |
||||
|
<td><t t-esc="rec['name']"/></td> |
||||
|
<td> <img t-attf-src="data:image/png;base64,{{rec['image']}}" style="width:70%;" margin="right"/></td> |
||||
|
<td><t t-esc="rec['product']"/></td> |
||||
|
<td><t t-esc="rec['quantity']"/></td> |
||||
|
<td><t t-esc="rec['unit']"/></td> |
||||
|
<td><t t-esc="rec['responsible']"/></td> |
||||
|
<td><t t-esc="rec['start_date']"/></td> |
||||
|
<td><t t-esc="rec['state']"/></td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</template> |
||||
|
|
||||
|
</odoo> |
@ -1,70 +0,0 @@ |
|||||
<?xml version="1.0"?> |
|
||||
<odoo> |
|
||||
<!-- Template for the manufacturing report.--> |
|
||||
<template id="report_mrp_order"> |
|
||||
<t t-call="web.html_container"> |
|
||||
<t t-call="web.external_layout"> |
|
||||
<div class="page"> |
|
||||
<h1> |
|
||||
<strong>MRP Order Report</strong> |
|
||||
</h1> |
|
||||
<t t-if="date_from"> |
|
||||
<p> |
|
||||
<strong>Date From :</strong> |
|
||||
<t t-esc="date_from"/> |
|
||||
</p> |
|
||||
</t> |
|
||||
<t t-if="stage"> |
|
||||
<p> |
|
||||
<strong>State :</strong> |
|
||||
<t t-esc="stage"/> |
|
||||
</p> |
|
||||
</t> |
|
||||
<table class="table table-sm table-striped mt-4"> |
|
||||
<thead> |
|
||||
<tr> |
|
||||
<th>Reference</th> |
|
||||
<th>Image</th> |
|
||||
<th>Product</th> |
|
||||
<th>Quantity</th> |
|
||||
<th>Unit</th> |
|
||||
<th>Responsible</th> |
|
||||
<th>Start Date</th> |
|
||||
<th>State</th> |
|
||||
</tr> |
|
||||
</thead> |
|
||||
<tbody> |
|
||||
<tr t-foreach="mrp" t-as="rec"> |
|
||||
<td> |
|
||||
<t t-esc="rec['name']"/> |
|
||||
</td> |
|
||||
<td> |
|
||||
<img t-attf-src="data:image/png;base64,{{rec['image']}}" |
|
||||
style="width:70%;" margin="right"/> |
|
||||
</td> |
|
||||
<td> |
|
||||
<t t-esc="rec['product']"/> |
|
||||
</td> |
|
||||
<td> |
|
||||
<t t-esc="rec['quantity']"/> |
|
||||
</td> |
|
||||
<td> |
|
||||
<t t-esc="rec['unit']"/> |
|
||||
</td> |
|
||||
<td> |
|
||||
<t t-esc="rec['responsible']"/> |
|
||||
</td> |
|
||||
<td> |
|
||||
<t t-esc="rec['start_date']"/> |
|
||||
</td> |
|
||||
<td> |
|
||||
<t t-esc="rec['state']"/> |
|
||||
</td> |
|
||||
</tr> |
|
||||
</tbody> |
|
||||
</table> |
|
||||
</div> |
|
||||
</t> |
|
||||
</t> |
|
||||
</template> |
|
||||
</odoo> |
|
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
@ -1,23 +1,31 @@ |
|||||
/** @odoo-module */ |
odoo.define('manufacturing_reports .action_manager', function (require) { |
||||
import { registry } from "@web/core/registry"; |
"use strict"; |
||||
import { download } from "@web/core/network/download"; |
|
||||
import framework from 'web.framework'; |
|
||||
import session from 'web.session'; |
|
||||
/** |
/** |
||||
* @override |
* The purpose of this file is to add the actions of type |
||||
* Add 'xlsx' report type to the report handler |
* 'ir_actions_xlsx_download' to the ActionManager. |
||||
*/ |
*/ |
||||
registry.category("ir.actions.report handlers").add("xlsx", async (action) => { |
var ActionManager = require('web.ActionManager'); |
||||
if (action.report_type === 'xlsx') { |
var framework = require('web.framework'); |
||||
framework.blockUI(); |
var session = require('web.session'); |
||||
var def = $.Deferred(); |
ActionManager.include({ |
||||
session.get_file({ |
_executexlsxReportDownloadAction: function (action) { |
||||
url: '/xlsx_reports', |
framework.blockUI(); |
||||
data: action.data, |
var def = $.Deferred(); |
||||
success: def.resolve.bind(def), |
session.get_file({ |
||||
error: (error) => this.call('crash_manager', 'rpc_error', error), |
url: '/xlsx_reports', |
||||
complete: framework.unblockUI, |
data: action.data, |
||||
}); |
success: def.resolve.bind(def), |
||||
return def; |
error: (error) => this.call('crash_manager', 'rpc_error', error), |
||||
} |
complete: framework.unblockUI, |
||||
}); |
}); |
||||
|
return def; |
||||
|
}, |
||||
|
_handleAction: function (action, options) { |
||||
|
if (action.report_type === 'xlsx') { |
||||
|
return this._executexlsxReportDownloadAction(action, options); |
||||
|
} |
||||
|
return this._super.apply(this, arguments); |
||||
|
|
||||
|
}, |
||||
|
}); |
||||
|
}); |
@ -0,0 +1,10 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
<template id="assets_backend" name="xls_assets" inherit_id="web.assets_backend"> |
||||
|
<xpath expr="." position="inside"> |
||||
|
<script type="text/javascript" src="manufacturing_reports/static/src/js/action_manager.js"/> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</data> |
||||
|
</odoo> |
@ -1,10 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8" ?> |
|
||||
<odoo> |
|
||||
<!-- Menu for manufacturing report--> |
|
||||
<menuitem id="menu_mrp_reports" |
|
||||
parent="mrp.menu_mrp_reporting" |
|
||||
name="Manufacturing Reports" |
|
||||
action="manufacturing_reports.mrp_report_action" |
|
||||
sequence="5"/> |
|
||||
|
|
||||
</odoo> |
|
@ -0,0 +1,9 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
|
||||
|
<menuitem id="menu_mrp_reports" parent="mrp.menu_mrp_reporting" name="Manufacturing Reports" |
||||
|
action="mrp_wizard_action" sequence="5"/> |
||||
|
|
||||
|
</data> |
||||
|
</odoo> |
Loading…
Reference in new issue