Skip to content

Commit

Permalink
Merge d21f727 into 23921fb
Browse files Browse the repository at this point in the history
  • Loading branch information
David Dufresne committed Mar 17, 2015
2 parents 23921fb + d21f727 commit a8e8f25
Show file tree
Hide file tree
Showing 9 changed files with 275 additions and 0 deletions.
48 changes: 48 additions & 0 deletions crm_reason_to_export/README.rst
@@ -0,0 +1,48 @@
Reason To Export
================

This module adds a selection field named x_reason (Reason to export for
customs purpose) in the sale order forms.


Configuration
=============

To configure this module, you need to:

* Go to Sales -> Configuration -> Sales -> Reasons to Export
* Add reasons to export


Credits
=======

Contributors
------------

* Jean-Philippe JOBIN <jobinrobotiq@gmail.com>
* David DUFRESNE <david.dufresne@savoirfairelinux.com>
* Jordi RIERA <jordi.riera@savoirfairelinux.com>
* Bruno JOLIVEAU <bruno.joliveau@savoirfairelinux.com>


Maintainer
----------

.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://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 http://odoo-community.org.


* Module exported by the Module Prototyper module for version 8.0.
* If you have any questions, please contact Savoir-faire Linux
(support@savoirfairelinux.com)
"""
24 changes: 24 additions & 0 deletions crm_reason_to_export/__init__.py
@@ -0,0 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# This module copyright (C) 2015 JPJ
# ( http://www.savoirfairelinux.com).
#
# 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 . import models

47 changes: 47 additions & 0 deletions crm_reason_to_export/__openerp__.py
@@ -0,0 +1,47 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# This module copyright (C) 2015 JPJ
# ( http://www.savoirfairelinux.com).
#
# 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': 'CRM Reason to Export',
'version': '0.1',
'author': 'Jean-Philippe Jobin',
'maintainer': 'Savoir-faire Linux',
'website': ' http://www.savoirfairelinux.com',
'license': '',
'category': 'CRM',
'summary': 'Reason to export in Sales Order',
'depends': [
'sale_crm',
],
'external_dependencies': {
'python': [],
},

'data': [
'views/sale_order_view.xml',
'views/crm_reason_to_export_view.xml',
],

'installable': True,
'auto_install': False,
'application': False,
}
26 changes: 26 additions & 0 deletions crm_reason_to_export/models/__init__.py
@@ -0,0 +1,26 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# This module copyright (C) 2015 JPJ
# ( http://www.savoirfairelinux.com).
#
# 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 . import (
sale_order,
reason_to_export,
)
33 changes: 33 additions & 0 deletions crm_reason_to_export/models/reason_to_export.py
@@ -0,0 +1,33 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# This module copyright (C) 2015 JPJ
# ( http://www.savoirfairelinux.com).
#
# 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 import models, fields


class CrmReasonToExport(models.Model):
_name = "crm.reason_to_export"
_description = "Reason to Export"

name = fields.Char(translate=True, required=True)
active = fields.Boolean(default=True)

_order = 'name'
32 changes: 32 additions & 0 deletions crm_reason_to_export/models/sale_order.py
@@ -0,0 +1,32 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# This module copyright (C) 2015 JPJ
# ( http://www.savoirfairelinux.com).
#
# 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 import models, fields


class SaleOrder(models.Model):
_inherit = "sale.order"

reason_to_export_id = fields.Many2one(
comodel_name="crm.reason_to_export",
string="Reason to Export",
)
3 changes: 3 additions & 0 deletions crm_reason_to_export/security/ir.model.access.csv
@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_crm_reason_to_export_user,crm.reason_to_export.user,model_crm_reason_to_export,base.group_sale_salesman,1,0,0,0
access_crm_reason_to_export_manager,crm.reason_to_export.manager,model_crm_reason_to_export,base.group_sale_manager,1,1,1,1
40 changes: 40 additions & 0 deletions crm_reason_to_export/views/crm_reason_to_export_view.xml
@@ -0,0 +1,40 @@
<?xml version="1.0"?>
<openerp>
<data>

<record id="view_reason_to_export_tree" model="ir.ui.view">
<field name="name">crm.reason_to_export.tree</field>
<field name="model">crm.reason_to_export</field>
<field name="arch" type="xml">
<tree editable="top">
<field name="name"/>
<field name="active"/>
</tree>
</field>
</record>

<record id="view_crm_reason_to_export_filter" model="ir.ui.view">
<field name="name">CRM - Reasons to Export</field>
<field name="model">crm.reason_to_export</field>
<field name="arch" type="xml">
<search string="Search Reasons to Export">
<field name="name"/>
</search>
</field>
</record>

<record id="action_crm_reason_to_export_view" model="ir.actions.act_window">
<field name="name">Reasons to Export</field>
<field name="res_model">crm.reason_to_export</field>
<field name="view_id" eval="view_reason_to_export_tree"/>
<field name="search_view_id" ref="view_crm_reason_to_export_filter"/>
</record>

<menuitem
action="action_crm_reason_to_export_view" id="menu_crm_reason_to_export_act"
name="Reasons to Export" sequence="0"
parent="base.menu_sale_config_sales"
groups="base.group_sale_manager"/>

</data>
</openerp>
22 changes: 22 additions & 0 deletions crm_reason_to_export/views/sale_order_view.xml
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<openerp>
<data>

<record id="view_sale_order_form" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<group name="sale_total" position="after">
<group col="4">
<group>
<field name="reason_to_export_id"/>
</group>
<group></group>
</group>
</group>
</field>
</record>

</data>
</openerp>

0 comments on commit a8e8f25

Please sign in to comment.