Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10] delivery carrier b2c #116

Merged
merged 3 commits into from
Mar 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions delivery_carrier_b2c/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=====================
Delivery Carrier B2C
=====================

* This module adds specific fields to partner for delivery purposes. Some carrier services offer to deliver packages to any place in a country (e.g. 'So Colissimo' in France). In this case addition fields are required with a more complete view on partner

.. figure:: path/to/local/image.png
:alt: alternative description
:width: 600 px



.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/delivery_carrier_b2c/{branch}



Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------
* Chafique DELLI <chafique.delli@akretion.com>
* David BEAL <david.beal@akretion.com>
* Monsieur B <monsieurb@saaslys.com>
----


Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.
42 changes: 3 additions & 39 deletions delivery_carrier_b2c/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,58 +1,22 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Chafique DELLI <chafique.delli@akretion.com>
# Copyright 2014 Akretion
#
# 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/>.
#
##############################################################################
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

{
'name': 'Delivery Carrier Business To Customer',
'version': '8.0.0.2.0',
'version': '10.0.0.1.0',
'author': "Akretion,Odoo Community Association (OCA)",
'maintainer': 'Akretion',
'category': '',
'depends': [
'base_delivery_carrier_label',
'partner_helper',
],
'description': """
Delivery Carrier Business To Customer
=====================================

Description
-----------
* Add specific fields to partner for delivery purpose


Contributors
------------
* Chafique DELLI <chafique.delli@akretion.com>
* David BEAL <david.beal@akretion.com>

----


""",
'website': 'http://www.akretion.com/',
'data': [
'partner_view.xml',
],
'tests': [],
'installable': False,
'installable': True,
'auto_install': False,
'license': 'AGPL-3',
'application': False,
Expand Down
48 changes: 11 additions & 37 deletions delivery_carrier_b2c/partner.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,18 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Chafique DELLI <chafique.delli@akretion.com>
# Copyright 2014 Akretion
#
# 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/>.
#
##############################################################################
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openerp.osv import orm, fields

from odoo import models, fields

class res_partner(orm.Model):
_inherit = "res.partner"

_columns = {
'use_b2c_info': fields.boolean(
'Advanced address',
help="Display additional information for home delivery (b2c)"),
'door_code': fields.char(
'Door Code'),
'door_code2': fields.char(
'Door Code 2',),
'intercom': fields.char(
'Intercom',
help="Informations for Intercom such as name "
"or number on the intercom"),
}
class ResPartner(models.Model):
_inherit = "res.partner"

_defaults = {
'use_b2c_info': False,
}
use_b2c_info = fields.Boolean('Advanced address',
help="Display additional information for "
"home delivery (b2c)")
door_code = fields.Char('Door Code')
door_code2 = fields.Char('Door Code 2')
intercom = fields.Char('Intercom', help="Informations for Intercom such as"
" name or number on the intercom")
28 changes: 10 additions & 18 deletions delivery_carrier_b2c/partner_view.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>

<!--
delivery_carrier_tnt for OpenERP
Copyright (C) 2013 Akretion Chafique DELLI <chafique.dellil@akretion.com>
The licence is in the file __openerp__.py
-->

<!-- INHERITED VIEW FOR THE OBJECT : res.partner -->

<record id="view_partner_form" model="ir.ui.view">
<record id="view_partner_form" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<field name="comment" position="before">
<xpath expr="//page[@name='internal_notes']//field[@name='comment']" position="before">
<group>
<field name="use_b2c_info"/>
</group>
<group colspan="4" attrs="{'invisible': [('use_b2c_info','=', False)]}">
<group name="address" col="4">
<group>
<field name="door_code"/>
<field name="door_code2"/>
</group>
<group>
<field name="intercom"/>
</group>
</group>
</group>
</field>
</xpath>
</field>
</record>
</record>

</data>
</openerp>
</odoo>