Skip to content

Commit

Permalink
[MIG] base_delivery_carrier_files: Migration to 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mFlayyan authored and thomaspaulb committed May 13, 2019
1 parent 3369d0f commit d3c8e0b
Show file tree
Hide file tree
Showing 21 changed files with 1,233 additions and 247 deletions.
99 changes: 83 additions & 16 deletions base_delivery_carrier_files/README.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,88 @@
**This file is going to be generated by oca-gen-addon-readme.**
===========================
Base Delivery Carrier Files
===========================

*Manual changes will be overwritten.*
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Please provide content in the ``readme`` directory:
.. |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%2Fdelivery--carrier-lightgray.png?logo=github
:target: https://github.com/OCA/delivery-carrier/tree/10.0/base_delivery_carrier_files
:alt: OCA/delivery-carrier
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/delivery-carrier-10-0/delivery-carrier-10-0-base_delivery_carrier_files
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/99/10.0
:alt: Try me on Runbot

* **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)
|badge1| |badge2| |badge3| |badge4| |badge5|

Content of this README will also be drawn from the addon manifest,
from keys such as name, authors, maintainers, development_status,
and license.
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.

A good, one sentence summary in the manifest is also highly recommended.
The delivery orders can be grouped in one file 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 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.

**Table of contents**

.. contents::
:local:

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

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

* Camptocamp

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

* Guewen Baconnier <[email protected]>
* Tom Blauwendraat <[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/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/10.0/base_delivery_carrier_files>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 5 additions & 1 deletion base_delivery_carrier_files/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# 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',
'author': "Camptocamp,Odoo Community Association (OCA)",
'license': 'AGPL-3',
Expand All @@ -24,6 +24,10 @@
'demo/carrier_file_demo.xml',
'demo/carrier_file_demo.yml'
],
'summary': """
Base module for creation of carrier files (La Poste, TNT Express Shipper, ...).
Files are exported as text (csv, ...).
""",
'images': [],
'installable': True,
'auto_install': False,
Expand Down
4 changes: 2 additions & 2 deletions base_delivery_carrier_files/demo/carrier_file_demo.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<odoo>
<data noupdate="1">

<!-- Carrier File -->
Expand Down Expand Up @@ -33,4 +33,4 @@
</record>

</data>
</openerp>
</odoo>
15 changes: 6 additions & 9 deletions base_delivery_carrier_files/models/delivery_carrier_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
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


Expand Down Expand Up @@ -51,7 +50,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
Expand Down Expand Up @@ -91,7 +90,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
Expand All @@ -110,17 +109,15 @@ 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 '
'the delivery order process.')
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 '
Expand Down
2 changes: 1 addition & 1 deletion base_delivery_carrier_files/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions base_delivery_carrier_files/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit d3c8e0b

Please sign in to comment.