From 749d6824e0e784d827e2a76c9fe9c657d80ed1de Mon Sep 17 00:00:00 2001 From: Alex Comba Date: Mon, 8 Jul 2013 12:53:57 +0200 Subject: [PATCH 01/20] [ADD] initial draft of l10n_it_bill_of_entry module [FIX] mail author [ADD] advance_customs_vat and wizard/select_template [FIX] Add __init__.py [ADD] button 'Make Bill of Entry' [FIX] Remove pdb [REF] override load_template [ADD] check if invoice.customs_doc_type == 'forwarder_invoice' --- l10n_it_bill_of_entry/AUTHORS.txt | 3 ++ l10n_it_bill_of_entry/__init__.py | 27 ++++++++++ l10n_it_bill_of_entry/__openerp__.py | 37 ++++++++++++++ l10n_it_bill_of_entry/account_invoice.py | 49 +++++++++++++++++++ .../account_invoice_view.xml | 31 ++++++++++++ l10n_it_bill_of_entry/wizard/__init__.py | 26 ++++++++++ .../wizard/select_template.py | 41 ++++++++++++++++ 7 files changed, 214 insertions(+) create mode 100644 l10n_it_bill_of_entry/AUTHORS.txt create mode 100644 l10n_it_bill_of_entry/__init__.py create mode 100644 l10n_it_bill_of_entry/__openerp__.py create mode 100644 l10n_it_bill_of_entry/account_invoice.py create mode 100644 l10n_it_bill_of_entry/account_invoice_view.xml create mode 100644 l10n_it_bill_of_entry/wizard/__init__.py create mode 100644 l10n_it_bill_of_entry/wizard/select_template.py diff --git a/l10n_it_bill_of_entry/AUTHORS.txt b/l10n_it_bill_of_entry/AUTHORS.txt new file mode 100644 index 000000000000..1a7b14ff567e --- /dev/null +++ b/l10n_it_bill_of_entry/AUTHORS.txt @@ -0,0 +1,3 @@ +Alex Comba +Lorenzo Battistini + diff --git a/l10n_it_bill_of_entry/__init__.py b/l10n_it_bill_of_entry/__init__.py new file mode 100644 index 000000000000..4fcb1cc4aea5 --- /dev/null +++ b/l10n_it_bill_of_entry/__init__.py @@ -0,0 +1,27 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2013 Agile Business Group sagl +# () +# Copyright (C) 2013 OpenERP Italian Community +# () +# All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +import account_invoice +import wizard diff --git a/l10n_it_bill_of_entry/__openerp__.py b/l10n_it_bill_of_entry/__openerp__.py new file mode 100644 index 000000000000..89636fd2266c --- /dev/null +++ b/l10n_it_bill_of_entry/__openerp__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2013 Agile Business Group sagl () +# Copyright (C) 2013 OpenERP Italia () +# All Rights Reserved +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + 'name': 'Italian Localisation - Bill of Entry', + 'version': '0.1', + 'category': 'Localisation/Italy', + 'description': """ +""", + 'author': ['Agile Business Group sagl', 'OpenERP Italian Community'], + 'website': ['http://www.agilebg.com', 'http://www.openerp-italia.org'], + 'license': 'AGPL-3', + "depends": ['base', 'account_invoice_template'], + "data": [ + 'account_invoice_view.xml', + ], + "demo": [], + "installable": True +} diff --git a/l10n_it_bill_of_entry/account_invoice.py b/l10n_it_bill_of_entry/account_invoice.py new file mode 100644 index 000000000000..18a70eee18c8 --- /dev/null +++ b/l10n_it_bill_of_entry/account_invoice.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2013 Agile Business Group sagl () +# Copyright (C) 2013 OpenERP Italia () +# All Rights Reserved +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import fields, osv +from openerp.tools.translate import _ + + +class account_invoice(osv.osv): + _inherit = "account.invoice" + + _columns = { + 'customs_doc_type': fields.selection([ + ('bill_of_entry', 'Bill of Entry'), + ('supplier_invoice', 'Supplier Invoice'), + ('forwarder_invoice', 'Forwarder Invoice'), + ], 'Customs Doc Type', readonly=True, states={'draft': [('readonly', False)]}), + 'supplier_bill_of_entry_ids': fields.many2many('account.invoice', 'sboe_invoice_rel', 'sboe_id', 'invoice_id', 'Supplier Bill of Entries'), + 'supplier_invoice_ids': fields.many2many('account.invoice', 'invoice_sbe_rel', 'invoice_id', 'sboe_id', 'Supplier Invoices', readonly=True), + 'forwarder_invoice_id': fields.many2one('account.invoice', 'Forwarder Invoice', readonly=True), + 'forwarder_bill_of_entry_ids': fields.one2many('account.invoice', 'forwarder_invoice_id', 'Forward Bill of Entries', readonly=True), + 'bill_of_entry_cancellation_id': fields.many2one('account.move', 'Bill od Entry Cancellation', readonly=True), + } + + +class account_invoice_line(osv.osv): + _inherit = "account.invoice.line" + + _columns = { + 'advance_customs_vat': fields.boolean("Adavance Customs Vat"), + } diff --git a/l10n_it_bill_of_entry/account_invoice_view.xml b/l10n_it_bill_of_entry/account_invoice_view.xml new file mode 100644 index 000000000000..3b7eb738a167 --- /dev/null +++ b/l10n_it_bill_of_entry/account_invoice_view.xml @@ -0,0 +1,31 @@ + + + + + + account.invoice.supplier.form + account.invoice + + + + + + + + + + + + + + + + + + + - - - - - - - - +
+ + + +
+