Skip to content

Commit

Permalink
[ADD] Aggiunto modulo ddt avanzato
Browse files Browse the repository at this point in the history
  • Loading branch information
Borruso committed Oct 26, 2020
1 parent 3ec822c commit c71f702
Show file tree
Hide file tree
Showing 48 changed files with 7,607 additions and 0 deletions.
168 changes: 168 additions & 0 deletions l10n_it_delivery_note/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
============================
ITA - Documento di Trasporto
============================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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/github-OCA%2Fl10n_it_delivery_note-lightgray.png?logo=github
:target: https://github.com/OCA/l10n_it_delivery_note/tree/12.0/l10n_it_delivery_note
:alt: OCA/l10n_it_delivery_note
.. |badge3| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n_it_delivery_note-12-0/l10n_it_delivery_note-12-0-l10n_it_delivery_note
:alt: Translate me on Weblate

|badge1| |badge2| |badge3|

**English**

This module manage the Italian DDT (Delivery note).

From a Picking is possible to generate a Delivery note, group more picking in one delivery note. Is possible to invoice from the Delivery note form.

This module is alternative to DDT :code:`l10n_it_ddt` it follow the odoo way to process sale order, picking and invoice.


**Italiano**

Questo modulo consente di gestire i DDT.

Questo modulo è un alternativa al modulo DDT :code:`l10n_it_ddt` segue la modalità di odoo di gestire ordini di vendita, picking e fatture.
Non è possibile avere installato contemporaneamente :code:`l10n_it_ddt` e :code:`l10n_it_delivery_note`.

Ci sono due impostazioni possibili:
Base di default un picking un DDT.
Avanzato più picking in un DDT.


**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:
- Inventory -> Configuration -> Settings - Delivery note

Use the advanced delivery notes behaviour allow to menage more picking on one delivery note.
- Inventory -> Configuration -> Warehouse Management -> Delivery note types

is possible to indicate in delivery note type if the product price have to be printed in the delivery note report/slip
- Inventory -> Configuration -> Delivery notes -> Condition of trasport
- Inventory -> Configuration -> Delivery notes -> Appearances of goods
- Inventory -> Configuration -> Delivery notes -> Reasons of trasport
- Inventory -> Configuration -> Delivery notes -> Methods of trasport

- Settings -> User & Companies -> Users - "Show product information in the delivery note lines" allow to show the price in the form

Usage
=====

Funzionalità base.

Quando un picking è validato si visualizza un tab DdT.
Dal tab "Crea nuovo" si apre un wizard dove scegliere il tipo di DDT e poi conferma. Immettere i dati richiesti poi "Valida" per numerare il DDT.
Una volta Validato il DDT è possibile emettere fattura direttamente dal DDT, se il DDT è di tipo consegna a cliente (outgoing) e si hanno i permessi sull'utente.
E' possibile annullare il DDT reimpostarlo in bozza e poi modificarlo. Se il DDT è fatturato il numero e data non sono modificabili.
per i trasferimenti tra magazzini creare un picking di tipo interno, con le ubicazioni relative, validare il picking e il tab DDT viene visualizzato.
è possibile anche avere i ddt in ingresso ovvero validato il picking si apre il tab DDT per indicare il numero DDT fornitore e data .

Funzionalità Avanzata.

vengono attivate varie funzionalità aggiuntive:
- più picking per un DDT
- selezione multipla di picking e generazione di DDT
- aggiunta righe note e righe sezione descrittive.
- lista dei DDT.

Il report DDT stampa in righe aggiuntive i lotti/ seriali scadenze del prodotto.

Il prezzo può essere indicato anche nel report DDT se il tiipo DDT è indicata la stampa prezzi.
La visibilità dei prezzi è sui permessi dell'utente.

Le fatture generate dai DDT hanno nelle righe note i riferimenti al DDT.


Se è installato :code: “l10n_it_ddt” seguire i seguenti passi.

Migrazione dei dati da “l10n_it_ddt”
Il modulo presenta una funzione di migrazione dei dati dal modulo OCA “l10n_it_ddt” da eseguire manualmente.
Al momento, non è ancora presente un menù oppure una voce in interfaccia che permetta di eseguire questa operazione; bensì, è stato definito un CLI da eseguire all’avvio di Odoo.
Di seguito, una piccola lista di passi da seguire per portare a termine la migrazione:

Eseguire un back-up del database.
Questa procedura di migrazione dei dati è stata, sì, sviluppata e testata MA solamente per un numero limitato di casi.
NON mi sento, assolutamente, confidente nel definirla una feature production-ready.


Installare il modulo “l10n_it_delivery_note” SENZA prima disinstallare il modulo OCA “l10n_it_ddt”.

NON iniziare ad usare il modulo “l10n_it_delivery_note” senza aver prima migrato i dati.
Potrebbero verificarsi, in prima battuta, problemi legati alla numerazione dei documenti creati.
Inoltre, la procedura di migrazione stessa, è progettata affinché verifichi non siano presenti documenti di “l10n_it_delivery_note”; qualora ne rilevi alcuni, si interromperà non eseguendo alcuna migrazione.


Terminata l’installazione del modulo, terminate in sicurezza il processo di Odoo.
Lanciare, nella maniera in cui si è soliti fare, Odoo aggiungendo alcuni parametri al comando d’avvio:

./odoo-bin migrate_ddt_data --database <nome_database> [...]

Una volta terminata l’esecuzione della procedura, verificare che tutti i documenti siano stati migrati con successo e nella maniera in cui ci si aspetterebbe.
Verificata l’esattezza dei dati migrati, disinstallare il modulo “l10n_it_ddt”.
È possibile iniziare ad utilizzare “l10n_it_delivery_note”.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n_it_delivery_note/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_it_delivery_note/issues/new?body=module:%20l10n_it_delivery_note%0Aversion:%2012.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
~~~~~~~

* Marco Calcagni
* Gianmarco Conte
* Link IT Europe Srl

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

* Riccardo Bellanova <[email protected]>
* Matteo Bilotta <[email protected]>
* Giuseppe Borruso <[email protected]>
* Marco Calcagni <[email protected]>
* Marco Colombo <[email protected]>
* Gianmarco Conte <[email protected]>
* Letizia Freda <[email protected]>
* Andrea Piovesana <[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_it_delivery_note <https://github.com/OCA/l10n_it_delivery_note/tree/12.0/l10n_it_delivery_note>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions l10n_it_delivery_note/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import cli
from . import mixins
from . import models
from . import wizard
52 changes: 52 additions & 0 deletions l10n_it_delivery_note/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2014-2019 Dinamiche Aziendali srl
# (http://www.dinamicheaziendali.it/)
# @author: Marco Calcagni <[email protected]>
# @author: Gianmarco Conte <[email protected]>
# Copyright (c) 2019, Link IT Europe Srl
# @author: Matteo Bilotta <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

# noinspection PyStatementEffect
{
'name': "ITA - Documento di trasporto",
'summary': "Crea, gestisce e fattura i DDT partendo dalle consegne",

'author': "Marco Calcagni, Gianmarco Conte, Link IT Europe Srl, "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/l10n-italy/tree/12.0/'
'l10n_it_delivery_note',
'version': '12.0.1.0.0',
'category': "Localization",
'license': 'AGPL-3',
'maintainers': ['As400it', 'Byloth'],

'depends': [
'delivery',
'l10n_it_delivery_note_base',
'mail',
'sale_stock',
'stock_account'
],

'data': [
'security/ir.model.access.csv',
'security/ir_rule.xml',
'security/res_groups.xml',
'security/res_users.xml',

'report/report_delivery_note.xml',

'views/account_invoice.xml',
'views/assets.xml',
'views/res_config_settings.xml',
'views/res_partner.xml',
'views/sale_order.xml',
'views/stock_delivery_note.xml',
'views/stock_picking.xml',

'wizard/delivery_note_create.xml',
'wizard/delivery_note_select.xml',
'wizard/delivery_note_template.xml',
'wizard/sale_advance_payment_inv.xml'
]
}
3 changes: 3 additions & 0 deletions l10n_it_delivery_note/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import core

from . import migrate_l10n_it_ddt
99 changes: 99 additions & 0 deletions l10n_it_delivery_note/cli/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Copyright (c) 2020, Link IT Europe Srl
# @author: Matteo Bilotta <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import argparse
import functools
import logging
import odoo

from odoo import SUPERUSER_ID
from odoo.cli import Command

_logger = logging.getLogger(__name__)


def environment(funct=None, parser_args_method=None):
if not funct:
return functools.partial(environment,
parser_args_method=parser_args_method)

@functools.wraps(funct)
def env_enabler(self, args):
command_args = unknown_args = args

if parser_args_method:
command_args, unknown_args = parser_args_method(self, args)

odoo.tools.config._parse_config(unknown_args)
odoo.netsvc.init_logger()

config = odoo.tools.config

with odoo.api.Environment.manage():
cr = odoo.registry(config['db_name']).cursor()
env = odoo.api.Environment(cr, SUPERUSER_ID, {})

funct(self, command_args, env)

return env_enabler


class EasyCommand(Command):
args = None
env = None

is_debugging = None

def __init__(self):
self.is_debugging = False

def _commit(self):
self.env.cr.commit() # pylint: disable=invalid-commit

def _rollback(self):
self.env.cr.rollback()

def _close(self):
self.env.cr.close()

def initialize(self, args, env):
self.args = args
self.env = env

if args:
self.is_debugging = args.debug

def execute(self):
raise NotImplementedError("This method hasn't yet been implemented.")

# noinspection PyMethodMayBeStatic
def get_args_parser(self):
args_parser = argparse.ArgumentParser()
args_parser.add_argument('--debug', action='store_true', default=False)

return args_parser

def parse_args(self, args):
arg_parser = self.get_args_parser()

return arg_parser.parse_known_args(args)

@environment(parser_args_method=parse_args)
def run(self, args, env):
try:
self.initialize(args, env)
self.execute()

_logger.info("Execution completed successfully! Committing...")

self._commit()

except:
_logger.exception("Something went wrong during command execution. "
"Rolling back...")

self._rollback()

finally:
self._close()
Loading

0 comments on commit c71f702

Please sign in to comment.