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

[ADD] [sale_partner_contact] #253

Closed
wants to merge 5 commits into from
Closed
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
65 changes: 65 additions & 0 deletions sale_partner_contact/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.. 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

====================
Sale partner contact
====================

This module allows to add to a quotation or sales order the contact person.


Usage
=====

To use this module, you need to:

* Go to to the quotation or sales order and enter the contact. You can enter a contact that
is related to the company, or enter another one if needed.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/167/8.0


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

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/167/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/
167/issues/new?body=module:%20
sale_partner_contact%0Aversion:%20
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A
%0A**Expected%20behavior**>`_.

Credits
=======

Images
------

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

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

* Jordi Ballester - Eficent Business and IT Consulting Services S.L. <jordi.ballester@eficent.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.
5 changes: 5 additions & 0 deletions sale_partner_contact/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services, S.L. -
# Jordi Ballester Alomar
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models
22 changes: 22 additions & 0 deletions sale_partner_contact/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services, S.L. -
# Jordi Ballester Alomar
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
"name": "Sale partner contact",
"summary": "Add contact person to the quotation or sales order",
"version": "8.0.1.0.0",
"category": "Sales Management",
"website": "https://odoo-community.org/",
"author": "Eficent, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"sale"
],
"data": [
"views/sale_view.xml",
],
}
5 changes: 5 additions & 0 deletions sale_partner_contact/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services, S.L. -
# Jordi Ballester Alomar
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import sale
17 changes: 17 additions & 0 deletions sale_partner_contact/models/sale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# © 2015 Eficent Business and IT Consulting Services, S.L. -
# Jordi Ballester Alomar
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp import api, fields, models


class SaleOrder(models.Model):

_inherit = 'sale.order'

partner_contact_id = fields.Many2one(
'res.partner', 'Contact person', readonly=True,
states={'draft': [('readonly', False)],
'sent': [('readonly', False)]},
help="Contact person of the customer for this quotation "
"sales order.")
28 changes: 28 additions & 0 deletions sale_partner_contact/views/sale_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="view_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">
<field name="partner_shipping_id" position="after">
<field name="partner_contact_id"
context="{'default_type':'contact', 'default_is_company': False, 'default_parent_id':partner_id, 'default_use_parent_address':True, 'search_default_parent_id':partner_id}"/>
</field>
</field>
</record>

<record id="view_sales_order_filter" model="ir.ui.view">
<field name="name">sale.order.list.select</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="partner_contact_id"/>
</field>
</field>
</record>

</data>
</openerp>