Skip to content

Commit

Permalink
Merge pull request #15 from kmee/add/delivery_picking_label
Browse files Browse the repository at this point in the history
[ADD] Addons: l10n_br_delivery_picking_label
  • Loading branch information
mileo authored Jun 14, 2024
2 parents 527f4bb + b4ba3e8 commit 66c46b9
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest
- container: ghcr.io/oca/oca-ci/py3.8-ocb14.0:latest
name: test with OCB
makepot: "true"
services:
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>`_.
Empty file.
20 changes: 20 additions & 0 deletions l10n_br_delivery_picking_label/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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": [
"l10n_br_stock_account",
"l10n_br_delivery_nfe",
],
"data": [
"report/report_delivery_picking_label.xml",
"data/paperformat.xml",
"data/report_delivery_picking_label.xml",
],
"demo": [],
}
15 changes: 15 additions & 0 deletions l10n_br_delivery_picking_label/data/paperformat.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="report_qweb_paperformat" model="report.paperformat">
<field name="name">70x62</field>
<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">70</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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="report_delivery_picking_label_view">
<!-- <t t-call="web.html_container"> -->
<t t-call="web.basic_layout">
<t t-foreach="docs" t-as="picking">
<t t-foreach="range(picking.number_of_volumes)" t-as="volume">
<div class="page" style="page-break-after: 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>
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,
)
4 changes: 4 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vcrpy # Needed by payment_pagseguro
odoo-test-helper # Needed by spec_driven_model
signxml<3.1.0
xmldiff

0 comments on commit 66c46b9

Please sign in to comment.