-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from Eficent/10.0-mig-mrp_bom_structure_xlsx_l…
…evel_1 [10.0][MIG] mrp_bom_structure_xlsx_level_1
- Loading branch information
Showing
9 changed files
with
258 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
.. image:: https://img.shields.io/badge/license-AGPLv3-blue.svg | ||
:target: https://www.gnu.org/licenses/agpl.html | ||
:alt: License: AGPL-3 | ||
|
||
===================================== | ||
MRP BOM Structure Report XLSX Level 1 | ||
===================================== | ||
|
||
This module extends the functionality of the MRP capabilities of Odoo, | ||
and allows you to export to level 1 of the BOM structure to MS Excel .XLSX format. | ||
|
||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
#. Go to 'Manufacturing / Products / Bill of Materials' | ||
#. Select a BOM or more BOMS | ||
#. Go to 'Action / Export BOM Structure (Level 1) to Excel'. | ||
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/131/10.0 | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/manufacture-reporting/issues>`_. In case of trouble, | ||
please check there if your issue has already been reported. If you spotted it | ||
first, help us smash it by providing detailed and welcomed feedback. | ||
|
||
Credits | ||
======= | ||
|
||
Images | ||
------ | ||
|
||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. | ||
|
||
Contributors | ||
------------ | ||
|
||
* Jordi Ballester <jordi.ballester@eficent.com> | ||
* Miquel Raïch <miquel.raich@eficent.com> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
To contribute to this module, please visit https://odoo-community.org. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016-2017 Eficent Business and IT Consulting Services S.L. | ||
# (http://www.eficent.com) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from . import report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2017 Eficent Business and IT Consulting Services S.L. | ||
# (http://www.eficent.com) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
'name': "Export BOM Structure (Level 1) to Excel .XLSX", | ||
'version': '10.0.1.0.0', | ||
'category': 'Manufacturing', | ||
'author': "Eficent, Odoo Community Association (OCA)", | ||
'website': 'https://github.com/OCA/manufacture-reporting', | ||
'license': 'AGPL-3', | ||
"depends": ['mrp_bom_structure_xlsx'], | ||
"data": [ | ||
'report/bom_structure_xlsx.xml', | ||
], | ||
"installable": True | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_bom_structure_xlsx_level_1 | ||
# | ||
# Translators: | ||
# Rudolf Schnapka <rs@techno-flex.de>, 2017 | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 9.0c\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2017-03-28 05:21+0000\n" | ||
"PO-Revision-Date: 2017-03-28 05:21+0000\n" | ||
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>, 2017\n" | ||
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Language: de\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
|
||
#. module: mrp_bom_structure_xlsx_level_1 | ||
#: model:ir.actions.report.xml,name:mrp_bom_structure_xlsx_level_1.action_bom_structure_xlsx_l1 | ||
msgid "Export BOM Structure (Level 1) to Excel" | ||
msgstr "Exportiere SL-Hierarchie (Stufe 1) nach Excel" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016-2017 Eficent Business and IT Consulting Services S.L. | ||
# (http://www.eficent.com) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from . import bom_structure_xlsx |
40 changes: 40 additions & 0 deletions
40
mrp_bom_structure_xlsx_level_1/report/bom_structure_xlsx.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016-2017 Eficent Business and IT Consulting Services S.L. | ||
# (http://www.eficent.com) | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
import logging | ||
|
||
from odoo.report import report_sxw | ||
from odoo.addons.mrp_bom_structure_xlsx.report.bom_structure_xlsx import \ | ||
BomStructureXlsx | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
try: | ||
from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx | ||
except ImportError: | ||
_logger.debug("report_xlsx not installed, Excel export non functional") | ||
|
||
class ReportXlsx(object): | ||
def __init__(self, *args, **kwargs): | ||
pass | ||
|
||
|
||
class BomStructureXlsxL1(BomStructureXlsx): | ||
|
||
def print_bom_children(self, ch, sheet, row, level): | ||
i, j = row, level | ||
j += 1 | ||
sheet.write(i, 1, '> '*j) | ||
sheet.write(i, 2, ch.product_id.default_code or '') | ||
sheet.write(i, 3, ch.product_id.display_name or '') | ||
sheet.write(i, 4, ch.product_qty) | ||
sheet.write(i, 5, ch.product_uom_id.name or '') | ||
sheet.write(i, 6, ch.bom_id.code or '') | ||
i += 1 | ||
return i | ||
|
||
|
||
BomStructureXlsxL1('report.bom.structure.xlsx.l1', 'mrp.bom', | ||
parser=report_sxw.rml_parse) |
23 changes: 23 additions & 0 deletions
23
mrp_bom_structure_xlsx_level_1/report/bom_structure_xlsx.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L. | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
|
||
<record id="action_bom_structure_xlsx_l1" model="ir.actions.report.xml"> | ||
<field name="name">Export BOM Structure (Level 1) to Excel</field> | ||
<field name="model">mrp.bom</field> | ||
<field name="type">ir.actions.report.xml</field> | ||
<field name="report_name">bom.structure.xlsx.l1</field> | ||
<field name="report_type">xlsx</field> | ||
<field name="auto" eval="False"/> | ||
</record> | ||
|
||
<record model="ir.values" id="action_bom_structure_xlsx_l1_values"> | ||
<field name="name">Export BOM Structure (Level 1) to Excel</field> | ||
<field name="key2">client_action_multi</field> | ||
<field name="value" | ||
eval="'ir.actions.report.xml,' +str(ref('action_bom_structure_xlsx_l1'))" /> | ||
<field name="model">mrp.bom</field> | ||
</record> | ||
|
||
</odoo> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions
82
mrp_bom_structure_xlsx_level_1/static/description/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<section class="oe_container"> | ||
<div class="oe_row oe_spaced"> | ||
<div class="oe_span12"> | ||
<h2 class="oe_slogan">Export BOM Structure (Level 1) to Excel</h2> | ||
<p> | ||
This module extends the functionality of the MRP capabilities of Odoo, | ||
and allows you to export to level 1 of the BOM structure to MS Excel .XLSX format. | ||
</p> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section class="oe_container oe_dark"> | ||
<div class="oe_row oe_spaced"> | ||
<div class="oe_span12"> | ||
<h2 class="oe_slogan">Installation</h2> | ||
</div> | ||
<div class="oe_span6"> | ||
<p class="oe_mt32">No additional installation instructions are required.</p> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section class="oe_container"> | ||
<div class="oe_row oe_spaced"> | ||
<div class="oe_span12"> | ||
<h2 class="oe_slogan">Configuration</h2> | ||
</div> | ||
<div class="oe_span6"> | ||
<p class="oe_mt32">This module does not require any additional configuration.</p> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section class="oe_container oe_dark"> | ||
<div class="oe_row oe_spaced"> | ||
<div class="oe_span12"> | ||
<h2 class="oe_slogan">Usage</h2> | ||
</div> | ||
<div class="oe_span6"> | ||
<p class="oe_mt32"> | ||
In the Bill of Materials form or list views, press 'More > Export BOM | ||
Structure to Excel (Level 1)'. | ||
</p> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section class="oe_container"> | ||
<div class="oe_row oe_spaced"> | ||
<div class="oe_span12"> | ||
<h2 class="oe_slogan">Known issues / Roadmap</h2> | ||
</div> | ||
<div class="oe_span6"> | ||
<p class="oe_mt32">No issues have been identified.</p> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section class="oe_container oe_dark"> | ||
<div class="oe_row"> | ||
<div class="oe_span12"> | ||
<h2 class="oe_slogan">Credits</h2> | ||
</div> | ||
<div class="oe_span12"> | ||
<h3>Contributors</h3> | ||
<ul> | ||
<li>Jordi Ballester Alomar <<a | ||
href="mailto:jordi.ballester@eficent.com">jordi.ballester@eficent.com</a>></li> | ||
</ul> | ||
</div> | ||
<div class="oe_span12"> | ||
<h3>Maintainer</h3> | ||
<p> | ||
This module is maintained by the OCA.<br/> | ||
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.<br/> | ||
To contribute to this module, please visit <a href="http://odoo-community.org">http://odoo-community.org</a>.<br/> | ||
<a href="http://odoo-community.org"><img class="oe_picture oe_centered" src="http://odoo-community.org/logo.png"></a> | ||
</p> | ||
</div> | ||
</div> | ||
</section> |