10 changed files with 267 additions and 0 deletions
-
18partner_blacklist/README.rst
-
18partner_blacklist/__init__.py
-
39partner_blacklist/__openerp__.py
-
61partner_blacklist/i18n/fr.po
-
BINpartner_blacklist/images/customer.png
-
BINpartner_blacklist/images/customer_tree.png
-
BINpartner_blacklist/images/sale_order.png
-
56partner_blacklist/partner_listing.py
-
75partner_blacklist/partner_listing.xml
-
BINpartner_blacklist/static/src/img/icon.png
@ -0,0 +1,18 @@ |
|||||
|
.. image httpsimg.shields.iobadgelicence-AGPL--3-blue.svg |
||||
|
alt License AGPL-3 |
||||
|
|
||||
|
{ Blacklist partner} |
||||
|
============== |
||||
|
|
||||
|
This module allows you to add a category 'blacklist' in the form of your customers. If a customer is in this category it will appear in red in OpenERP. |
||||
|
|
||||
|
Credits |
||||
|
======= |
||||
|
|
||||
|
Contributors |
||||
|
------------ |
||||
|
BHC SPRL |
||||
|
Guillaume Leclercq guillaume.leclercq@bhc.be |
||||
|
Rudy valentin rudy.valentin@bhc.be |
||||
|
Nicolas Doclot nicolas.doclot@bhc.be |
||||
|
|
@ -0,0 +1,18 @@ |
|||||
|
###################################################################################################### |
||||
|
# |
||||
|
# Copyright (C) B.H.C. sprl - All Rights Reserved, http://www.bhc.be |
||||
|
# |
||||
|
# 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. |
||||
|
# |
||||
|
# Unless required by applicable law or agreed to in writing, software |
||||
|
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, |
||||
|
# including but not limited to the implied warranties |
||||
|
# of merchantability and/or fitness for a particular purpose |
||||
|
# |
||||
|
# 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 partner_listing |
@ -0,0 +1,39 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
###################################################################################################### |
||||
|
# |
||||
|
# Copyright (C) B.H.C. sprl - All Rights Reserved, http://www.bhc.be |
||||
|
# |
||||
|
# 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. |
||||
|
# |
||||
|
# Unless required by applicable law or agreed to in writing, software |
||||
|
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, |
||||
|
# including but not limited to the implied warranties |
||||
|
# of merchantability and/or fitness for a particular purpose |
||||
|
# |
||||
|
# 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': 'blacklist partner', |
||||
|
'version': '1.0', |
||||
|
'category': 'Generic Modules/Others', |
||||
|
'description': """ |
||||
|
This module allows you to add a category 'blacklist' in the form of your customers. |
||||
|
If a customer is in this category it will appear in red in OpenERP. |
||||
|
""", |
||||
|
'author': 'BHC', |
||||
|
'website': 'www.bhc.com/', |
||||
|
'depends': ['base','sale','warning'], |
||||
|
'images': ['images/customer.png','images/customer_tree.png','images/sale_order.png'], |
||||
|
'init_xml': [], |
||||
|
'update_xml': ['partner_listing.xml'], |
||||
|
'demo_xml': [], |
||||
|
'installable': True, |
||||
|
'active': False, |
||||
|
} |
||||
|
|
@ -0,0 +1,61 @@ |
|||||
|
# Translation of OpenERP Server. |
||||
|
# This file contains the translation of the following modules: |
||||
|
# * crm_blacklist |
||||
|
# |
||||
|
msgid "" |
||||
|
msgstr "" |
||||
|
"Project-Id-Version: OpenERP Server 7.0-20130825-231127\n" |
||||
|
"Report-Msgid-Bugs-To: \n" |
||||
|
"POT-Creation-Date: 2013-11-18 08:53+0000\n" |
||||
|
"PO-Revision-Date: 2013-11-18 08:53+0000\n" |
||||
|
"Last-Translator: <>\n" |
||||
|
"Language-Team: \n" |
||||
|
"MIME-Version: 1.0\n" |
||||
|
"Content-Type: text/plain; charset=UTF-8\n" |
||||
|
"Content-Transfer-Encoding: \n" |
||||
|
"Plural-Forms: \n" |
||||
|
|
||||
|
#. module: crm_blacklist |
||||
|
#: view:res.partner:0 |
||||
|
msgid "Contacts" |
||||
|
msgstr "Contacts" |
||||
|
|
||||
|
#. module: crm_blacklist |
||||
|
#: view:product.product:0 |
||||
|
msgid "Warnings" |
||||
|
msgstr "Avertissements" |
||||
|
|
||||
|
#. module: crm_blacklist |
||||
|
#: view:res.partner:0 |
||||
|
msgid "Warning on the Picking" |
||||
|
msgstr "Avertissement sur les Colisages" |
||||
|
|
||||
|
#. module: crm_blacklist |
||||
|
#: view:res.partner:0 |
||||
|
msgid "Warning on the Purchase Order" |
||||
|
msgstr "Avertissement sur les commandes d'achat" |
||||
|
|
||||
|
#. module: crm_blacklist |
||||
|
#: code:addons/crm_blacklist/partner_listing.py:27 |
||||
|
#: code:addons/crm_blacklist/partner_listing.py:35 |
||||
|
#: field:res.partner,blacklist:0 |
||||
|
#: field:res.partner.category,blacklist:0 |
||||
|
#: model:res.partner.category,name:crm_blacklist.category_bl |
||||
|
#, python-format |
||||
|
msgid "Blacklist" |
||||
|
msgstr "Liste noire" |
||||
|
|
||||
|
#. module: crm_blacklist |
||||
|
#: view:res.partner:0 |
||||
|
msgid "Warning on the Invoice" |
||||
|
msgstr "Avertissement sur la Facture" |
||||
|
|
||||
|
#. module: crm_blacklist |
||||
|
#: model:ir.model,name:crm_blacklist.model_res_partner_category |
||||
|
msgid "Partner Categories" |
||||
|
msgstr "Catégories de partenaires" |
||||
|
|
||||
|
#. module: crm_blacklist |
||||
|
#: model:ir.model,name:crm_blacklist.model_res_partner |
||||
|
msgid "Partner" |
||||
|
msgstr "Partenaire" |
After Width: 809 | Height: 750 | Size: 39 KiB |
After Width: 1161 | Height: 140 | Size: 4.4 KiB |
After Width: 787 | Height: 545 | Size: 26 KiB |
@ -0,0 +1,56 @@ |
|||||
|
###################################################################################################### |
||||
|
# |
||||
|
# Copyright (C) B.H.C. sprl - All Rights Reserved, http://www.bhc.be |
||||
|
# |
||||
|
# 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. |
||||
|
# |
||||
|
# Unless required by applicable law or agreed to in writing, software |
||||
|
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, |
||||
|
# including but not limited to the implied warranties |
||||
|
# of merchantability and/or fitness for a particular purpose |
||||
|
# |
||||
|
# 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/> |
||||
|
# -*- coding: utf-8 -*- |
||||
|
import datetime |
||||
|
from lxml import etree |
||||
|
import math |
||||
|
import pytz |
||||
|
import urlparse |
||||
|
|
||||
|
import openerp |
||||
|
from openerp import tools, api |
||||
|
from openerp.osv import osv, fields |
||||
|
from openerp.osv.expression import get_unaccent_wrapper |
||||
|
from openerp.tools.translate import _ |
||||
|
|
||||
|
class res_partner(osv.Model): |
||||
|
_inherit = "res.partner" |
||||
|
|
||||
|
def _check_categ(self, cr, uid, ids, name, args, context): |
||||
|
res={} |
||||
|
bl=self.pool.get('res.partner.category').search(cr,uid,[('blacklist','=',True)]) |
||||
|
if bl and len(ids)==1: |
||||
|
for i in self.browse(cr,uid,ids): |
||||
|
for j in i.category_id: |
||||
|
if j.blacklist==True: |
||||
|
res[i.id]=1 |
||||
|
else: |
||||
|
res[i.id]=0 |
||||
|
return res |
||||
|
|
||||
|
_columns = { |
||||
|
'blacklist': fields.function(_check_categ, method=True, string=_('Blacklist'), type='boolean', store=True ), |
||||
|
} |
||||
|
res_partner() |
||||
|
|
||||
|
class category(osv.Model): |
||||
|
_inherit = "res.partner.category" |
||||
|
_columns = { |
||||
|
'blacklist': fields.boolean(_('Blacklist')), |
||||
|
} |
||||
|
category() |
@ -0,0 +1,75 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<openerp> |
||||
|
<data noupdate="1"> |
||||
|
<record id="category_bl" model="res.partner.category"> |
||||
|
<field name="name">Blacklist</field> |
||||
|
<field name="blacklist" eval="True"/> |
||||
|
</record> |
||||
|
</data> |
||||
|
<data> |
||||
|
<record id="view_partner_tree_list" model="ir.ui.view"> |
||||
|
<field name="name">res.partner.tree</field> |
||||
|
<field name="model">res.partner</field> |
||||
|
<field name="inherit_id" ref="base.view_partner_tree"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Contacts" position="replace"> |
||||
|
<tree string="Contacts" colors="red:blacklist==True"> |
||||
|
<field name="display_name"/> |
||||
|
<field name="function" invisible="1"/> |
||||
|
<field name="phone"/> |
||||
|
<field name="email"/> |
||||
|
<field name="user_id" invisible="1"/> |
||||
|
<field name="is_company" invisible="1"/> |
||||
|
<field name="country_id" invisible="1"/> |
||||
|
<field name="parent_id" invisible="1"/> |
||||
|
<field name="blacklist" invisible="True"/> |
||||
|
</tree> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="view_partner_warning_form_in" model="ir.ui.view"> |
||||
|
<field name="name">res.partner.warning.form.inherit.in</field> |
||||
|
<field name="model">res.partner</field> |
||||
|
<field name="inherit_id" ref="warning.view_partner_warning_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="sale_warn_msg" colspan="3" nolabel="1" attrs="{'required':[('sale_warn','!=','no-message')],'readonly':[('sale_warn','=','no-message')]}" position="replace"> |
||||
|
<field name="blacklist" invisible="True"/> |
||||
|
<field name="sale_warn_msg" colspan="3" nolabel="1" attrs="{'required':['|',('sale_warn','!=','no-message'),('blacklist','=',True)],'readonly':[('sale_warn','=','no-message'),('blacklist','!=',True)]}" /> |
||||
|
</field> |
||||
|
<separator string="Warning on the Purchase Order" colspan="4" position="replace"/> |
||||
|
<field name="purchase_warn" nolabel="1" position="replace"/> |
||||
|
<field name="purchase_warn_msg" colspan="3" nolabel="1" |
||||
|
attrs="{'required':[('purchase_warn','!=','no-message')],'readonly':[('purchase_warn','=','no-message')]}" position="replace"/> |
||||
|
<separator string="Warning on the Picking" colspan="4" position="replace"/> |
||||
|
<field name="picking_warn" nolabel="1" position="replace"/> |
||||
|
<field name="picking_warn_msg" colspan="3" nolabel="1" |
||||
|
attrs="{'required':[('picking_warn','!=','no-message')],'readonly':[('picking_warn','=','no-message')]}" position="replace"/> |
||||
|
<separator string="Warning on the Invoice" colspan="4" position="replace"/> |
||||
|
<field name="invoice_warn" nolabel="1" position="replace"/> |
||||
|
<field name="invoice_warn_msg" colspan="3" nolabel="1" |
||||
|
attrs="{'required':[('invoice_warn','!=','no-message')],'readonly':[('invoice_warn','=','no-message')]}" position="replace"/> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="product_warning_form_view1" model="ir.ui.view"> |
||||
|
<field name="name">product.warning.form.inherit</field> |
||||
|
<field name="model">product.product</field> |
||||
|
<field name="inherit_id" ref="warning.product_warning_form_view"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<page string="Warnings" position="replace"/> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="view_partner_category_form" model="ir.ui.view"> |
||||
|
<field name="name">Partner Categories</field> |
||||
|
<field name="model">res.partner.category</field> |
||||
|
<field name="inherit_id" ref="base.view_partner_category_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="parent_id" position="after"> |
||||
|
<field name="blacklist" /> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</openerp> |
After Width: 64 | Height: 64 | Size: 16 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue