Skip to content

Commit

Permalink
[ADD] l10n_it_delivery_note_customer_code
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneVagile committed Jun 22, 2021
1 parent 8ceffd0 commit 4717491
Show file tree
Hide file tree
Showing 12 changed files with 602 additions and 0 deletions.
86 changes: 86 additions & 0 deletions l10n_it_delivery_note_customer_code/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
=======================================
Product Customer code for delivery note
=======================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_delivery_note_customer_code
:alt: OCA/l10n-italy
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_delivery_note_customer_code
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/122/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

**English**

This module allows to print product customer code in Italian DDT (Delivery Note) report, replacing product code.

For more information about product customer code field, see :code:`product_supplierinfo_for_customer_picking` module:
https://github.com/OCA/stock-logistics-workflow/tree/14.0/product_supplierinfo_for_customer_picking


**Italiano**

Questo modulo consente di stampare il codice product customer sul report DDT, sostituendo il codice prodotto.

Per maggiori informazioni sul campo codice product customer, guardare il modulo :code:`product_supplierinfo_for_customer_picking`:
https://github.com/OCA/stock-logistics-workflow/tree/14.0/product_supplierinfo_for_customer_picking

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_delivery_note_customer_code%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Agile Business Group

Contributors
~~~~~~~~~~~~

* Simone Vanin <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_delivery_note_customer_code>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions l10n_it_delivery_note_customer_code/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from . import models
18 changes: 18 additions & 0 deletions l10n_it_delivery_note_customer_code/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2021 Simone Vanin - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{
"name": "Product Customer code for delivery note",
"version": "14.0.1.0.0",
"author": "Agile Business Group, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-italy",
"license": "AGPL-3",
"category": "Stock",
"depends": [
"product_supplierinfo_for_customer_picking",
"l10n_it_delivery_note",
],
"data": [
"report/report_delivery_note.xml",
],
"installable": True,
}
3 changes: 3 additions & 0 deletions l10n_it_delivery_note_customer_code/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from . import delivery_note_line
18 changes: 18 additions & 0 deletions l10n_it_delivery_note_customer_code/models/delivery_note_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2016 Lorenzo Battistini - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from odoo import fields, models


class StockDeliveryNoteLine(models.Model):

_inherit = "stock.delivery.note.line"
product_customer_code = fields.Char(
"Product Customer Code", compute="_compute_customer_code"
)

def _compute_customer_code(self):
for line in self:
line.product_customer_code = line.product_id.default_code
if line.move_id and line.move_id.product_customer_code:
line.product_customer_code = line.move_id.product_customer_code
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Simone Vanin <[email protected]>
14 changes: 14 additions & 0 deletions l10n_it_delivery_note_customer_code/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**English**

This module allows to print product customer code in Italian DDT (Delivery Note) report, replacing product code.

For more information about product customer code field, see :code:`product_supplierinfo_for_customer_picking` module:
https://github.com/OCA/stock-logistics-workflow/tree/14.0/product_supplierinfo_for_customer_picking


**Italiano**

Questo modulo consente di stampare il codice product customer sul report DDT, sostituendo il codice prodotto.

Per maggiori informazioni sul campo codice product customer, guardare il modulo :code:`product_supplierinfo_for_customer_picking`:
https://github.com/OCA/stock-logistics-workflow/tree/14.0/product_supplierinfo_for_customer_picking
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<template
id="delivery_note_report_template_customer_code"
inherit_id="l10n_it_delivery_note.delivery_note_report_template"
>
<xpath
expr="//div[hasclass('page')]/table/thead/tr/th[1]"
position="replace"
>
<th class="text-left">
Customer Code
</th>
</xpath>
<xpath
expr="//div[hasclass('page')]/table/tbody/t/tr/t/td[1]"
position="replace"
>
<td>
<span t-esc="line.product_customer_code or ''" />
</td>
</xpath>
</template>
</data>
</openerp>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4717491

Please sign in to comment.