Skip to content

Commit

Permalink
[ADD] Addons: l10n_br_delivery_picking_label
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiago Amaral committed Jun 7, 2024
1 parent 4148947 commit b601071
Show file tree
Hide file tree
Showing 14 changed files with 163 additions and 9 deletions.
7 changes: 4 additions & 3 deletions l10n_br_boleto_usability/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down
35 changes: 35 additions & 0 deletions l10n_br_delivery_picking_label/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
**This file is going to be generated by oca-gen-addon-readme.**

*Manual changes will be overwritten.*

Please provide content in the ``readme`` directory:

* **DESCRIPTION.rst** (required)
* INSTALL.rst (optional)
* CONFIGURE.rst (optional)
* **USAGE.rst** (optional, highly recommended)
* DEVELOP.rst (optional)
* ROADMAP.rst (optional)
* HISTORY.rst (optional, recommended)
* **CONTRIBUTORS.rst** (optional, highly recommended)
* CREDITS.rst (optional)

Content of this README will also be drawn from the addon manifest,
from keys such as name, authors, maintainers, development_status,
and license.

A good, one sentence summary in the manifest is also highly recommended.


Automatic changelog generation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

`HISTORY.rst` can be auto generated using `towncrier <https://pypi.org/project/towncrier>`_.

Just put towncrier compatible changelog fragments into `readme/newsfragments`
and the changelog file will be automatically generated and updated when a new fragment is added.

Please refer to `towncrier` documentation to know more.

NOTE: the changelog will be automatically generated when using `/ocabot merge $option`.
If you need to run it manually, refer to `OCA/maintainer-tools README <https://github.com/OCA/maintainer-tools>`_.
1 change: 1 addition & 0 deletions l10n_br_delivery_picking_label/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions l10n_br_delivery_picking_label/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "L10n Br Delivery Picking Label",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "KMEE",
"website": "https://github.com/KMEE/kmee-odoo-addons",
"depends": [
"delivery_package_number",
"l10n_br_stock_account",
],
"data": [
"report/report_delivery_picking_label.xml",
"data/paperformat.xml",
"data/report_delivery_picking_label.xml",
"views/stock_picking.xml",
],
"demo": [],
}
16 changes: 16 additions & 0 deletions l10n_br_delivery_picking_label/data/paperformat.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="report_qweb_paperformat" model="report.paperformat">
<field name="name">70x62</field>
<field name="default" eval="True" />
<field name="format">custom</field>
<field name="page_height">70</field>
<field name="page_width">62</field>
<field name="orientation">Portrait</field>
<field name="margin_top">1</field>
<field name="margin_bottom">1</field>
<field name="margin_left">1</field>
<field name="margin_right">1</field>
<field name="dpi">50</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="report_delivery_picking_label" model="ir.actions.report">
<field name="name">Delivery Picking Label (PDF)</field>
<field name="model">stock.picking</field>
<field name="report_type">qweb-pdf</field>
<field
name="report_name"
>l10n_br_delivery_picking_label.report_delivery_picking_label_view</field>
<field
name="report_file"
>l10n_br_delivery_picking_label.report_delivery_picking_label</field>
<field name="print_report_name">object.name</field>
<field
name="binding_model_id"
ref="l10n_br_stock_account.model_stock_picking"
/>
<field name="binding_type">report</field>
<field name="paperformat_id" ref="report_qweb_paperformat" />
</record>
</odoo>
1 change: 1 addition & 0 deletions l10n_br_delivery_picking_label/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_picking
11 changes: 11 additions & 0 deletions l10n_br_delivery_picking_label/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import fields, models


class StockPicking(models.Model):
_inherit = "stock.picking"

number_of_volumes = fields.Integer(
string="Number of Volumes",
default=0,
copy=False,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="report_delivery_picking_label_view">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="picking">
<t t-foreach="range(picking.number_of_volumes)" t-as="volume">
<div class="page" style="page-break-before: always">
<p><span t-field="picking.partner_id.legal_name" /> (<span
t-field="picking.partner_id.name"
/>)</p>
<p>SERIE/NF-E: <span
t-field="picking.document_serie"
/>/<span t-field="picking.document_number" /></p>
<t t-set="volume_display" t-value="volume + 1" />
<p><span t-esc="volume_display" />/<span
t-field="picking.number_of_volumes"
/></p>
<p><span t-field="picking.carrier_id" /></p>
</div>
</t>
</t>
</t>

</template>

</odoo>
12 changes: 12 additions & 0 deletions l10n_br_delivery_picking_label/views/stock_picking.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<odoo>
<record id="view_picking_withcarrier_out_form_inherit" model="ir.ui.view">
<field name="model">stock.picking</field>
<field name="inherit_id" ref="delivery.view_picking_withcarrier_out_form" />
<field name="arch" type="xml">
<xpath expr="//notebook" position="before">
<field name="number_of_volumes" string="Number of volumes" />
</xpath>

</field>
</record>
</odoo>
7 changes: 4 additions & 3 deletions purchase_report_hide_date/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down
7 changes: 4 additions & 3 deletions purchase_report_hide_taxes/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down
6 changes: 6 additions & 0 deletions setup/l10n_br_delivery_picking_label/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit b601071

Please sign in to comment.