Skip to content

Commit

Permalink
Merge pull request #40 from Eficent/11.0-mig-mrp_bom_structure_xlsx_l…
Browse files Browse the repository at this point in the history
…evel_1

[11.0][MIG] mrp_bom_structure_xlsx_level_1
  • Loading branch information
LoisRForgeFlow committed Apr 18, 2018
2 parents b6d707c + 8232e1b commit 88ff325
Show file tree
Hide file tree
Showing 9 changed files with 230 additions and 0 deletions.
61 changes: 61 additions & 0 deletions mrp_bom_structure_xlsx_level_1/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.. image:: https://img.shields.io/badge/license-AGPLv3-blue.png
: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 'Print / 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/11.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.png>`_.

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.
2 changes: 2 additions & 0 deletions mrp_bom_structure_xlsx_level_1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import report
17 changes: 17 additions & 0 deletions mrp_bom_structure_xlsx_level_1/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2018 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': '11.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
}
24 changes: 24 additions & 0 deletions mrp_bom_structure_xlsx_level_1/i18n/de.po
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"
2 changes: 2 additions & 0 deletions mrp_bom_structure_xlsx_level_1/report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import bom_structure_xlsx
26 changes: 26 additions & 0 deletions mrp_bom_structure_xlsx_level_1/report/bom_structure_xlsx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2018 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.addons.mrp_bom_structure_xlsx.report.bom_structure_xlsx import \
BomStructureXlsx

_logger = logging.getLogger(__name__)


class BomStructureXlsxL1(BomStructureXlsx):
_name = 'report.mrp_bom_structure_xlsx_l1.bom_structure_xlsx_l1'

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
16 changes: 16 additions & 0 deletions mrp_bom_structure_xlsx_level_1/report/bom_structure_xlsx.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 Eficent Business and IT Consulting Services S.L.
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>

<report
id="bom_structure_xlsx_l1"
model="mrp.bom"
string="Export BOM Structure (Level 1) to Excel"
report_type="xlsx"
name="mrp_bom_structure_xlsx_l1.bom_structure_xlsx_l1"
file="mrp_bom"
attachment_use="False"
/>

</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 mrp_bom_structure_xlsx_level_1/static/description/index.html
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 'Print > 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 &lt;<a
href="mailto:jordi.ballester@eficent.com">jordi.ballester@eficent.com</a>&gt;</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>

0 comments on commit 88ff325

Please sign in to comment.