Skip to content

Commit

Permalink
Merge pull request OCA#112 from camptocamp/1.2.17
Browse files Browse the repository at this point in the history
1.2.17
  • Loading branch information
CharlineDumontet committed May 31, 2017
2 parents d8e28f7 + 96fd80e commit 2e3df42
Show file tree
Hide file tree
Showing 15 changed files with 825 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
@upgrade_to_1.2.17 @debonix

Feature: upgrade to 1.2.17

Scenario: upgrade application version
Given I update the module list
Given I install the required modules with dependencies:
| name |
| base_delivery_carrier_files |
| specific_function |
| delivery_carrier_file_chronopost |
| delivery_carrier_label_colisprive |
| delivery_carrier_file_colissimo |
Then my modules should have been installed and models reloaded

Given I set the version of the instance to "1.2.17"
2 changes: 2 additions & 0 deletions common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ merges = git origin parts/product-kitting pull/6/head ; Compatibility between sa

git origin parts/odoo-elasticsearch-kibana pull/3/head ; Add elasticsearch_view_export

git origin parts/carrier-delivery pull/134/head ; Allow inherits on get_type_selection

[supervisor]
; number of connector workers when launched from the supervisor
logfile_openerp_connector = ${buildout:directory}/var/log/openerp-connector-stdout.log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class carrier_file(orm.Model):
_inherit = 'delivery.carrier.file'

def _get_type_selection(self, cr, uid, context=None):
def get_type_selection(self, cr, uid, context=None):
result = super(carrier_file, self).get_type_selection(
cr, uid, context=context)
if 'chronopost' not in result:
Expand All @@ -35,7 +35,6 @@ def _get_type_selection(self, cr, uid, context=None):
return result

_columns = {
'type': fields.selection(_get_type_selection, 'Type', required=True),
'subaccount_number':
fields.char('Sub-Account Number',
size=3,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Charline Dumontet
# Copyright 2017 Camptocamp SA
#
# 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 Affero 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 <http://www.gnu.org/licenses/>.
#
##############################################################################

import carrier_file
import generator
import res_company
import stock
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Charline Dumontet
# Copyright 2017 Camptocamp SA
#
# 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 Affero 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 <http://www.gnu.org/licenses/>.
#
##############################################################################

{
'name': 'Delivery Carrier File: Colissimo',
'version': '1.0',
'category': 'Generic Modules/Warehouse',
'description': """
Sub-module for Base Delivery Carrier Files.
Definition of the delivery carrier file for "Colissimo".
""",
'author': 'Camptocamp',
'license': 'AGPL-3',
'website': 'http://www.camptocamp.com',
'depends': ['base_delivery_carrier_files',
'connector_ecommerce',
'import_tracking',
'crm_claim',],
'data': [
'data/colissimo_data.xml',
'carrier_file_view.xml',
'res_company_view.xml'
],
'test': [],
'images': [],
'installable': True,
'auto_install': False,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Charline Dumontet
# Copyright 2017 Camptocamp SA
#
# 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 Affero 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 <http://www.gnu.org/licenses/>.
#
##############################################################################

from openerp.osv import orm, fields


class carrier_file(orm.Model):
_inherit = 'delivery.carrier.file'

def get_type_selection(self, cr, uid, context=None):
"""
Add colissimo type
"""
result = super(carrier_file, self).get_type_selection(
cr, uid, context=context)
if 'colissimo' not in result:
result.append(('colissimo', 'Colissimo'))
return result


class DeliveryCarrier(orm.Model):
_inherit = 'delivery.carrier'

def _get_carrier_type_selection(self, cr, uid, context=None):
""" Add colissimo type """
res = super(DeliveryCarrier, self)._get_carrier_type_selection(
cr, uid, context=context)
if 'colissimo' not in res:
res.append(('colissimo', 'Colissimo'))
return res

_columns = {
'product_code': fields.char('Product code', size=4),
'expeditor_name': fields.char('Expeditor name', size=128),
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<record id="view_delivery_carrier_form_colissimo" model="ir.ui.view">
<field name="name">view_delivery_carrier_form_colissimo</field>
<field name="model">delivery.carrier</field>
<field name="inherit_id" ref="delivery.view_delivery_carrier_form" />
<field name="arch" type="xml">
<xpath expr="/form/group/group[last()]" position="after">
<group name="colissimo_options"
attrs="{'invisible': [('type', '!=', 'colissimo')]}"
colspan="4" col="4">
<separator string="Colissimo Options" colspan="4"/>
<field name="product_code" attrs="{'required': [('type', '=', 'colissimo')]}"/>
<field name="expeditor_name" attrs="{'required': [('type', '=', 'colissimo')]}"/>
</group>
</xpath>
</field>
</record>

</data>
</openerp>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">

<!-- Add colissimo claim category -->
<record model="crm.case.categ" id="categ_claim_colissimo_incident">
<field name="name">Colissimo - Erreur expedition</field>
<field name="section_id" ref="stockit_synchro.section_stockit_error"/>
<field name="object_id" search="[('model','=','crm.claim')]" model="ir.model"/>
</record>

<!-- Add colissimo partner -->
<record id="colissimo_partner" model="res.partner">
<field name="name">COLISSIMO</field>
<field name="country_id" search="[('code','=','FR')]" model="res.country"/>
</record>

<record id="ir_cron_colissimo_tracking_ref_update" model="ir.cron">
<field name="name">Import Colissimo tracking references</field>
<field name="interval_number">6</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
<field eval="'stock.picking'" name="model"/>
<field eval="'import_colissimo_tracking_references'" name="function"/>
<field eval="'()'" name="args"/>
</record>

<!--Colissimo error Email template -->
<record id="colissimo_import_error_template_mail" model="email.template">
<field name="name">Colissimo tracking errors</field>
<field name="email_from">contact@debonix.fr</field>
<field name="email_recipients"></field>
<field name="subject">Error with Colissimo tracking </field>
<field name="email_to">info-dsi@debonix.fr</field>
<field name="model_id" ref="crm_claim.model_crm_claim"/>
<field name="auto_delete" eval="True"/>
<field name="lang">${user.lang or 'fr_FR'}</field>
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
<p>Hello,</p>
<p>There was an error with the colissimo import tracking number</p>
</div>
]]></field>
</record>

</data>
</openerp>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Charline Dumontet
# Copyright 2017 Camptocamp SA
#
# 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 Affero 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 <http://www.gnu.org/licenses/>.
#
##############################################################################

import colissimo_generator
Loading

0 comments on commit 2e3df42

Please sign in to comment.