diff --git a/base_delivery_carrier_files/README.rst b/base_delivery_carrier_files/README.rst
index 21cd7854d5..f383cb3c5f 100644
--- a/base_delivery_carrier_files/README.rst
+++ b/base_delivery_carrier_files/README.rst
@@ -1,21 +1,33 @@
-**This file is going to be generated by oca-gen-addon-readme.**
+.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
+ :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
-*Manual changes will be overwritten.*
+===========================
+base_delivery_carrier_files
+===========================
-Please provide content in the ``readme`` directory:
+This module was written to extend the functionality of picking to support generating one or more files according to carrier_file configuration for all pickings
+and writes this file to a configurable location on your computer eg. /opt/data/carrier_files
-* **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)
+Discription:
+Base module for creation of carrier files (La Poste, TNT Express Shipper, ...).
+Files are exported as text (csv, ...).
+It contains :
+- the base structure to handle the export of files on Delivery Orders
+- an API to ease the generation of the files for the developers in sub-modules.
-Content of this README will also be drawn from the addon manifest,
-from keys such as name, authors, maintainers, development_status,
-and license.
+The delivery orders can be grouped in one files
+or be exported each one in a separate file.
+The files can be generated automatically
+on the shipment of a Delivery Order or from a manual action.
+They are exported to a defined path or
+in a document directory of your choice if the "document" module is installed.
-A good, one sentence summary in the manifest is also highly recommended.
+A generic carrier file is included in the module.
+It can also be used as a basis to create your own sub-module.
+
+Sub-modules already exist to generate file according to specs of :
+ - La Poste (France) : delivery_carrier_file_laposte
+ - TNT Express Shipper (France) : delivery_carrier_file_tnt
+ - Make your own ! Look at the code of the modules above,
+ it's trivial to create a sub-module for a carrier.
diff --git a/base_delivery_carrier_files/__manifest__.py b/base_delivery_carrier_files/__manifest__.py
index 30f3247880..e84081d959 100644
--- a/base_delivery_carrier_files/__manifest__.py
+++ b/base_delivery_carrier_files/__manifest__.py
@@ -4,26 +4,24 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Base Delivery Carrier Files',
- 'version': '8.0.1.2.4',
+ 'version': '10.0.1.0.1',
'category': 'Generic Modules/Warehouse',
+ 'summary': """
+Base module for creation of carrier files (La Poste, TNT Express Shipper, ...).
+Files are exported as text (csv, ...).
+""",
'author': "Camptocamp,Odoo Community Association (OCA)",
'license': 'AGPL-3',
'website': 'http://www.camptocamp.com',
- 'depends': [
- 'base',
- 'stock',
- 'delivery'
- ],
- 'data': [
- 'views/carrier_file_view.xml',
- 'views/stock_view.xml',
- 'wizards/generate_carrier_files_view.xml',
- 'security/ir.model.access.csv'
- ],
- 'demo': [
- 'demo/carrier_file_demo.xml',
- 'demo/carrier_file_demo.yml'
- ],
+ 'depends': ['base',
+ 'stock',
+ 'delivery'],
+ 'data': ['carrier_file_view.xml',
+ 'stock_view.xml',
+ 'wizard/generate_carrier_files_view.xml',
+ 'security/ir.model.access.csv'],
+ 'demo': ['carrier_file_demo.xml', 'carrier_file_demo.yml'],
+ 'test': [ '../account/test/account_minimal_test.xml'],
'images': [],
'installable': True,
'auto_install': False,
diff --git a/base_delivery_carrier_files/demo/carrier_file_demo.xml b/base_delivery_carrier_files/demo/carrier_file_demo.xml
index 5f88c0f6b6..d49ad7a240 100644
--- a/base_delivery_carrier_files/demo/carrier_file_demo.xml
+++ b/base_delivery_carrier_files/demo/carrier_file_demo.xml
@@ -1,5 +1,5 @@
-
+
@@ -33,4 +33,4 @@
-
+
diff --git a/base_delivery_carrier_files/models/delivery_carrier_file.py b/base_delivery_carrier_files/models/delivery_carrier_file.py
index 9fd828282c..4216146ab4 100644
--- a/base_delivery_carrier_files/models/delivery_carrier_file.py
+++ b/base_delivery_carrier_files/models/delivery_carrier_file.py
@@ -6,8 +6,9 @@
import os
import logging
-from openerp import models, fields, api, exceptions
-from openerp.tools.translate import _
+from odoo import api, exceptions, fields, models
+from odoo.tools.translate import _
+from .generator import new_file_generator
from ..generator import new_file_generator
@@ -51,7 +52,7 @@ def _write_file(self, filename, file_content):
file_handle.write(file_content)
return True
- @api.multi
+ @api.model
def _generate_files(self, picking_ids):
"""
Generate one or more files according to carrier_file configuration
@@ -91,7 +92,7 @@ def _generate_files(self, picking_ids):
picking_ids, e)
return True
- @api.multi
+ @api.model
def generate_files(self, picking_ids):
"""
Generate one or more files according to carrier_file
@@ -110,8 +111,7 @@ def generate_files(self, picking_ids):
name = fields.Char('Name', size=64, required=True)
type = fields.Selection(selection='get_type_selection',
string='Type', required=True)
- group_pickings = fields.Boolean('Group all pickings in one file',
- help='All the pickings will be '
+ group_pickings = fields.Boolean(help='All the pickings will be '
'grouped in the same file. '
'Has no effect when the files '
'are automatically exported at '
@@ -119,8 +119,7 @@ def generate_files(self, picking_ids):
write_mode = fields.Selection(selection='get_write_mode_selection',
string='Write on', required=True)
export_path = fields.Char('Export Path', size=256)
- auto_export = fields.Boolean('Export at delivery order process',
- help='The file will be automatically '
+ auto_export = fields.Boolean(help='The file will be automatically '
'generated when a delivery order '
'is processed. If activated, each '
'delivery order will be exported '
diff --git a/base_delivery_carrier_files/models/stock_picking.py b/base_delivery_carrier_files/models/stock_picking.py
index f9a7dbe763..570b4efb1b 100644
--- a/base_delivery_carrier_files/models/stock_picking.py
+++ b/base_delivery_carrier_files/models/stock_picking.py
@@ -3,7 +3,7 @@
# Author: Guewen Baconnier
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from openerp import models, fields, api
+from odoo import models, fields, api
class StockPicking(models.Model):
diff --git a/base_delivery_carrier_files/security/ir.model.access.csv b/base_delivery_carrier_files/security/ir.model.access.csv
index 3934ead744..c3913b75a8 100644
--- a/base_delivery_carrier_files/security/ir.model.access.csv
+++ b/base_delivery_carrier_files/security/ir.model.access.csv
@@ -1,4 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_delivery_carrier_file,delivery.carrier.file,model_delivery_carrier_file,base.group_sale_salesman,1,0,0,0
-access_delivery_carrier_file_manager,delivery.carrier.file manager,model_delivery_carrier_file,base.group_sale_manager,1,1,1,1
+access_delivery_carrier_file,delivery.carrier.file,model_delivery_carrier_file,sales_team.group_sale_salesman,1,0,0,0
+access_delivery_carrier_file_manager,delivery.carrier.file manager,model_delivery_carrier_file,sales_team.group_sale_manager,1,1,1,1
access_delivery_carrier_file_partner_manager,delivery.carrier.file partner_manager,model_delivery_carrier_file,base.group_partner_manager,1,0,0,0
diff --git a/base_delivery_carrier_files/views/carrier_file_view.xml b/base_delivery_carrier_files/views/carrier_file_view.xml
index 1833b67dc7..49992e672c 100644
--- a/base_delivery_carrier_files/views/carrier_file_view.xml
+++ b/base_delivery_carrier_files/views/carrier_file_view.xml
@@ -1,64 +1,61 @@
-
-
+
+
+ delivery.carrier.file.tree
+ delivery.carrier.file
+
+
+
+
+
+
+
+
+
-
- delivery.carrier.file.tree
- delivery.carrier.file
-
-
-
-
+
+ delivery.carrier.file.form
+ delivery.carrier.file
+
+
-
-
-
-
- delivery.carrier.file.form
- delivery.carrier.file
-
-
-
-
+
+
+
+
-
- Carrier File
- ir.actions.act_window
- delivery.carrier.file
- form
- tree,form
-
+
+ Carrier File
+ ir.actions.act_window
+ delivery.carrier.file
+ form
+ tree,form
+
-
+
-
- delivery.carrier.form.file
- delivery.carrier
-
-
-
-
-
-
-
-
-
+
+ delivery.carrier.form.file
+ delivery.carrier
+
+
+
+
+
+
+
+
+
-
-
+
diff --git a/base_delivery_carrier_files/views/stock_view.xml b/base_delivery_carrier_files/views/stock_view.xml
index 320b93df1f..742ea5ff4f 100644
--- a/base_delivery_carrier_files/views/stock_view.xml
+++ b/base_delivery_carrier_files/views/stock_view.xml
@@ -1,39 +1,37 @@
-
-
-
- stock.picking.form
- stock.picking
-
-
-
-
-
-
-
-
-
-
-
+
+
+ stock.picking.form
+ stock.picking
+
+
+
+
+
+
+
+
+
+
+
-
- stock.picking.search
- stock.picking
-
-
-
-
-
-
-
-
-
-
-
-
+
+ stock.picking.search
+ stock.picking
+
+
+
+
+
+
+
+
+
+
+
diff --git a/base_delivery_carrier_files/wizards/generate_carrier_files.py b/base_delivery_carrier_files/wizards/generate_carrier_files.py
index 80523a67c3..31efc64fe1 100644
--- a/base_delivery_carrier_files/wizards/generate_carrier_files.py
+++ b/base_delivery_carrier_files/wizards/generate_carrier_files.py
@@ -3,8 +3,8 @@
# Author: Guewen Baconnier
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from openerp import models, fields, exceptions, api
-from openerp.tools.translate import _
+from odoo import models, fields, exceptions, api
+from odoo.tools.translate import _
class DeliveryCarrierFileGenerate(models.TransientModel):
diff --git a/base_delivery_carrier_files/wizards/generate_carrier_files_view.xml b/base_delivery_carrier_files/wizards/generate_carrier_files_view.xml
index 0ca8eb98b8..f3e72639b1 100644
--- a/base_delivery_carrier_files/wizards/generate_carrier_files_view.xml
+++ b/base_delivery_carrier_files/wizards/generate_carrier_files_view.xml
@@ -1,52 +1,49 @@
-
-
-
-
- delivery.carrier.file.generate.form
- delivery.carrier.file.generate
-
-
+
+
-
- Generate Carrier Files
- delivery.carrier.file.generate
- form
- form
-
-
- new
-
+
+ Generate Carrier Files
+ delivery.carrier.file.generate
+ form
+ form
+
+
+ new
+
-
- Generate Carrier Files
- client_action_multi
-
- action
- stock.picking
-
+
+ Generate Carrier Files
+ client_action_multi
+
+ action
+ stock.picking
+
-
-
+
diff --git a/base_delivery_carrier_files_document/README.rst b/base_delivery_carrier_files_document/README.rst
index 21cd7854d5..5f8a7f102f 100644
--- a/base_delivery_carrier_files_document/README.rst
+++ b/base_delivery_carrier_files_document/README.rst
@@ -1,21 +1,9 @@
-**This file is going to be generated by oca-gen-addon-readme.**
+.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
+ :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
-*Manual changes will be overwritten.*
+====================================
+base_delivery_carrier_files_document
+====================================
-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.
+This module was written to extend the functionality of picking to support generating one or more files according to carrier_file configuration for all pickings and puts the file into the Odoo filestore as an attachment in a certain configurable Odoo Data directory (eg. Carrier files)
diff --git a/base_delivery_carrier_files_document/__manifest__.py b/base_delivery_carrier_files_document/__manifest__.py
index e0c147bb0b..e7c5d6e579 100644
--- a/base_delivery_carrier_files_document/__manifest__.py
+++ b/base_delivery_carrier_files_document/__manifest__.py
@@ -4,9 +4,14 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Base module for picking carrier files creation for document',
- 'version': '8.0.1.0.1',
+ 'version': '10.0.1.0.0',
'category': 'Generic Modules/Warehouse',
- 'author': 'Camptocamp,Odoo Community Association (OCA)',
+ 'summary': """
+Allow to store the carrier files in a Document directory.
+Auto-install when the module Document and
+Base Delivery Carrier Files are installed.
+ """,
+ 'author': "Camptocamp,Odoo Community Association (OCA)",
'license': 'AGPL-3',
'website': 'http://www.camptocamp.com',
'depends': [
diff --git a/base_delivery_carrier_files_document/demo/carrier_file_demo.xml b/base_delivery_carrier_files_document/demo/carrier_file_demo.xml
index 3f4822e68e..ddf42b96fb 100644
--- a/base_delivery_carrier_files_document/demo/carrier_file_demo.xml
+++ b/base_delivery_carrier_files_document/demo/carrier_file_demo.xml
@@ -1,5 +1,5 @@
-
+
@@ -15,4 +15,4 @@
-
+
diff --git a/base_delivery_carrier_files_document/views/carrier_file_view.xml b/base_delivery_carrier_files_document/views/carrier_file_view.xml
index 37d097274b..1dc55e51b9 100644
--- a/base_delivery_carrier_files_document/views/carrier_file_view.xml
+++ b/base_delivery_carrier_files_document/views/carrier_file_view.xml
@@ -1,17 +1,15 @@
-
-
-
- delivery.carrier.file.form
- delivery.carrier.file
-
-
-
-
-
-
-
-
-
-
-
+
+
+ delivery.carrier.file.form
+ delivery.carrier.file
+
+
+
+
+
+
+
+
+
+
diff --git a/delivery_carrier_file_tnt/README.rst b/delivery_carrier_file_tnt/README.rst
new file mode 100644
index 0000000000..ec311f859e
--- /dev/null
+++ b/delivery_carrier_file_tnt/README.rst
@@ -0,0 +1,18 @@
+.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
+ :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
+
+=========================
+delivery_carrier_file_tnt
+=========================
+
+This module was written to set tnt carrier files according to carrier_file configuration for all pickings
+
+discription:
+Sub-module for Base Delivery Carrier Files.
+
+Definition of the delivery carrier file for "TNT Express Shipper".
+
+File specifications on :
+http://www.tnt.com/express/fr_fr/site/home/support/downloads.html
+Chapter : "Guide d’importation d’un carnet d’adresses"
diff --git a/delivery_carrier_file_tnt/__manifest__.py b/delivery_carrier_file_tnt/__manifest__.py
index 72435f76e3..2d21c8f8ad 100644
--- a/delivery_carrier_file_tnt/__manifest__.py
+++ b/delivery_carrier_file_tnt/__manifest__.py
@@ -21,16 +21,12 @@
{
'name': 'Delivery Carrier File: TNT',
- 'version': '1.0',
+ 'version': '10.0.1.0.0',
'category': 'Generic Modules/Warehouse',
- 'description': """
+ 'summary': """
Sub-module for Base Delivery Carrier Files.
Definition of the delivery carrier file for "TNT Express Shipper".
-
-File specifications on :
-http://www.tnt.com/express/fr_fr/site/home/support/downloads.html
-Chapter : "Guide d’importation d’un carnet d’adresses"
""",
'author': "Camptocamp,Odoo Community Association (OCA)",
'license': 'AGPL-3',
@@ -41,6 +37,6 @@
'demo_xml': [],
'test': [],
'images': [],
- 'installable': False,
+ 'installable': True,
'auto_install': False,
}
diff --git a/delivery_carrier_file_tnt/carrier_file.py b/delivery_carrier_file_tnt/carrier_file.py
index 168e3d100c..befaa5b943 100644
--- a/delivery_carrier_file_tnt/carrier_file.py
+++ b/delivery_carrier_file_tnt/carrier_file.py
@@ -19,22 +19,21 @@
#
##############################################################################
-from osv import osv, fields
+from odoo import api, fields, models
-class carrier_file(osv.osv):
+class CarrierFile(models.Model):
_inherit = 'delivery.carrier.file'
- def get_type_selection(self, cr, uid, context=None):
- result = super(carrier_file, self
- ).get_type_selection(cr, uid, context=context)
+ @api.model
+ def get_type_selection(self):
+ result = super(CarrierFile, self
+ ).get_type_selection()
if 'tnt_express_shipper' not in result:
result.append(('tnt_express_shipper', 'TNT Express Shipper'))
return result
- _columns = {
- 'type': fields.selection(get_type_selection, 'Type', required=True),
- 'tnt_account': fields.char('TNT Account', size=9),
- }
+ type = fields.Selection(get_type_selection, 'Type', required=True)
+ tnt_account = fields.Char('TNT Account', size=9)
-carrier_file()
+CarrierFile()
diff --git a/delivery_carrier_file_tnt/carrier_file_view.xml b/delivery_carrier_file_tnt/carrier_file_view.xml
index 13f66d4a8f..3ea0fe2fc8 100644
--- a/delivery_carrier_file_tnt/carrier_file_view.xml
+++ b/delivery_carrier_file_tnt/carrier_file_view.xml
@@ -1,21 +1,19 @@
-
-
-
- delivery.carrier.file.form.tnt
- delivery.carrier.file
-
- form
-
-
-
-
-
-
-
-
+
+
+ delivery.carrier.file.form.tnt
+ delivery.carrier.file
+
+ form
+
+
+
+
+
+
+
diff --git a/delivery_carrier_file_tnt/generator/tnt_generator.py b/delivery_carrier_file_tnt/generator/tnt_generator.py
index 2858b4f6d3..9370bd164b 100644
--- a/delivery_carrier_file_tnt/generator/tnt_generator.py
+++ b/delivery_carrier_file_tnt/generator/tnt_generator.py
@@ -21,11 +21,11 @@
import csv
-from openerp.addons.base_delivery_carrier_files.generator import (
+from odoo.addons.base_delivery_carrier_files.generator import (
CarrierFileGenerator
)
-from openerp.addons.base_delivery_carrier_files.generator import BaseLine
-from openerp.addons.base_delivery_carrier_files.csv_writer import UnicodeWriter
+from odoo.addons.base_delivery_carrier_files.generator import BaseLine
+from odoo.addons.base_delivery_carrier_files.csv_writer import UnicodeWriter
class TNTLine(BaseLine):