ferdinand
14 years ago
committed by
Laurent Mignon (ACSONE)
7 changed files with 201 additions and 0 deletions
-
2__init__.py
-
23__openerp__.py
-
51partner_id_number.py
-
18partner_id_number_demo.xml
-
97partner_id_number_view.xml
-
5security/ir.model.access.csv
-
5security/ir.model.csv
@ -0,0 +1,2 @@ |
|||||
|
import partner_id_number |
||||
|
|
@ -0,0 +1,23 @@ |
|||||
|
{ |
||||
|
"name" : "Partner Identification Numbers", |
||||
|
"version" : "0.2", |
||||
|
"author" : "ChriCar Beteiligungs- und Beratungs GmbH" , |
||||
|
"website" : "http://www.chricar.at/ChriCar", |
||||
|
"description" : """This module allows to manage all sort of identification numbers |
||||
|
and certificates which are assigend to a partner and vary from country to country |
||||
|
* Commercial register |
||||
|
* VAT ID (eventually) |
||||
|
* fiscal ID's |
||||
|
* membership numbers |
||||
|
* .... |
||||
|
|
||||
|
""", |
||||
|
"category" : "Generic Modules/Others", |
||||
|
"depends" : ["base"], |
||||
|
"init_xml" : [], |
||||
|
"demo_xml" : ["partner_id_number_demo.xml"], |
||||
|
"update_xml" : ["partner_id_number_view.xml","security/ir.model.access.csv"], |
||||
|
#"update_xml" : ["partner_id_number_view.xml","security/ir.model.access.csv"], |
||||
|
"active": False, |
||||
|
"installable": True |
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
############################################## |
||||
|
# |
||||
|
# ChriCar Beteiligungs- und Beratungs- GmbH |
||||
|
# Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH |
||||
|
# all rights reserved |
||||
|
# created 2008-07-05 |
||||
|
# |
||||
|
############################################### |
||||
|
import time |
||||
|
from osv import fields,osv |
||||
|
import pooler |
||||
|
|
||||
|
class res_partner_id_category(osv.osv): |
||||
|
_name = "res.partner.id_category" |
||||
|
_columns = { |
||||
|
'code' : fields.char ('Code', size=16, required=True), |
||||
|
'name' : fields.char ('ID Number', size=32, required=True, translate=True), |
||||
|
'active' : fields.boolean ('Active'), |
||||
|
} |
||||
|
_defaults = { |
||||
|
'active': lambda *a: True, |
||||
|
} |
||||
|
_order = "name" |
||||
|
res_partner_id_category() |
||||
|
|
||||
|
|
||||
|
class res_partner_id_number(osv.osv): |
||||
|
_name = "res.partner.id_number" |
||||
|
_columns = { |
||||
|
'category_id' : fields.many2one('res.partner.id_category','ID-Category', required=True), |
||||
|
'name' : fields.char ('ID-Number',size=32,required=True), |
||||
|
'partner_id' : fields.many2one('res.partner','Partner', required=True), |
||||
|
'partner_issued_id' : fields.many2one('res.partner','Issued by', required=True), |
||||
|
'date_issued' : fields.date ('Issued'), |
||||
|
'valid_from' : fields.date ('Valid From'), |
||||
|
'valid_until' : fields.date ('Valid Until'), |
||||
|
'comment' : fields.text ('Notes'), |
||||
|
'active' : fields.boolean ('Active'), |
||||
|
'state' : fields.char ('State', size=16), |
||||
|
} |
||||
|
_defaults = { |
||||
|
'active': lambda *a: True, |
||||
|
} |
||||
|
res_partner_id_number() |
||||
|
|
||||
|
class res_partner(osv.osv): |
||||
|
_inherit = "res.partner" |
||||
|
_columns = { |
||||
|
'id_numbers': fields.one2many('res.partner.id_number','partner_id','Identification Numbers'), |
||||
|
} |
||||
|
res_partner() |
@ -0,0 +1,18 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<openerp> |
||||
|
<data noupdate="1"> |
||||
|
<!-- import fails |
||||
|
|
||||
|
<record record_id="res_partner_id_category_1" model="res.partner.id_category"> |
||||
|
<field name="code">cr</field> |
||||
|
<field name="name">Commercial Register Number</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="res.partner.id_number"> |
||||
|
<field name="category_id" search="[('name','=','Commercial Register Number')]" model="res.partner.id_category"/> |
||||
|
<field name="name">123 this is the number</field> |
||||
|
<field name="partner_id" search="[('name','=','Camptocamp')]" model="res.partner"/> |
||||
|
<field name="partner_issued_id" search="[('name','=','Bank Wealthy and sons')]" model="res.partner"/> |
||||
|
</record> |
||||
|
--></data> |
||||
|
</openerp> |
@ -0,0 +1,97 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
<!-- |
||||
|
======================= |
||||
|
Partner Identification Number Categories |
||||
|
======================= |
||||
|
--> |
||||
|
<record id="view_partner_id_category_form" model="ir.ui.view"> |
||||
|
<field name="name">res.partner.id_category.form</field> |
||||
|
<field name="model">res.partner.id_category</field> |
||||
|
<field name="type">form</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Partner Identification Categories"> |
||||
|
<field name="name" select="1"/> |
||||
|
<field name="code" select="1"/> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="view_partner_id_category_tree" model="ir.ui.view"> |
||||
|
<field name="name">res.partner.id_category.tree</field> |
||||
|
<field name="model">res.partner.id_category</field> |
||||
|
<field name="type">tree</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Partner Identification Categories"> |
||||
|
<field name="name"/> |
||||
|
<field name="code"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="action_partner_id_category" model="ir.actions.act_window"> |
||||
|
<field name="name">Partner ID Categories</field> |
||||
|
<field name="res_model">res.partner.id_category</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
</record> |
||||
|
<menuitem |
||||
|
action="action_partner_id_category" |
||||
|
id="menu_partner_id_category" |
||||
|
parent="base.menu_config_address_book"/> |
||||
|
<!-- |
||||
|
============================================== |
||||
|
Modification of Partner - Adding Tab for Idenification Numbers |
||||
|
============================================== |
||||
|
--> |
||||
|
<record model="ir.ui.view" id="view_partner_form"> |
||||
|
<field name="name">res.partner.form.id_number</field> |
||||
|
<field name="model">res.partner</field> |
||||
|
<field name="inherit_id" ref="base.view_partner_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<notebook position="inside"> |
||||
|
<page string="Ident. Numbers"> |
||||
|
<field name="id_numbers" colspan="4" nolabel="1" widget="one2many_list"/> |
||||
|
</page> |
||||
|
</notebook> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="view_partner_id_numbers_form" model="ir.ui.view"> |
||||
|
<field name="name">res.partner.id_number.form</field> |
||||
|
<field name="model">res.partner.id_number</field> |
||||
|
<field name="type">form</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Partner ID Numbers"> |
||||
|
<field name="category_id" select="1"/> |
||||
|
<field name="name" select="1"/> |
||||
|
<field name="partner_issued_id" select="1"/> |
||||
|
<field name="date_issued" select="1"/> |
||||
|
<field name="valid_from" select="1"/> |
||||
|
<field name="valid_until" select="1"/> |
||||
|
<separator colspan="4" string="Notes"/> |
||||
|
<field name="comment" colspan="4" nolabel="1"/> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="view_partner_id_numbers_tree" model="ir.ui.view"> |
||||
|
<field name="name">res.partner.id_number.tree</field> |
||||
|
<field name="model">res.partner.id_number</field> |
||||
|
<field name="type">tree</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Partner ID Numbers"> |
||||
|
<field name="category_id" select="1"/> |
||||
|
<field name="name" select="1"/> |
||||
|
<field name="partner_issued_id" select="1"/> |
||||
|
<field name="date_issued" select="1"/> |
||||
|
<field name="valid_from" select="1"/> |
||||
|
<field name="valid_until" select="1"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="action_partner_id_numbers_form" model="ir.actions.act_window"> |
||||
|
<field name="name">Partner ID Numbers</field> |
||||
|
<field name="res_model">res.partner.id_number</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,5 @@ |
|||||
|
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" |
||||
|
"access_res_partner_id_number_group_user","res.partner.id_number","model_res_partner_id_number","base.group_user",1,0,0,0 |
||||
|
"access_res_partner_id_number_group_partner_manager","res.partner.id_number","model_res_partner_id_number","base.group_partner_manager",1,1,1,1 |
||||
|
"access_res_partner_id_number_group_user","res.partner.id_category","model_res_partner_id_category","base.group_user",1,0,0,0 |
||||
|
"access_res_partner_id_category_group_partner_manager","res.partner.id_category","model_res_partner_id_category","base.group_partner_manager",1,1,1,1 |
@ -0,0 +1,5 @@ |
|||||
|
^"id"^,^"name"^,^"model_id:id"^,^"group_id:id"^,^"perm_read"^,^"perm_write"^,^"perm_create"^,^"perm_unlink" ^ |
||||
|
^"access_res_partner_id_number_group_user"^,^"res.partner.id_number"^,^"model_res_partner_id_number"^,^"base.group_user"^,1,0,0,0 |
||||
|
^"access_res_partner_id_number_group_partner_manager"^,^"res.partner.id_number"^,^"model_res_partner_id_number"^,^"base.group_partner_manager"^,1,1,1,1 |
||||
|
^"access_res_partner_id_number_group_user"^,^"res.partner.id_category"^,^"model_res_partner_id_category"^,^"base.group_user"^,1,0,0,0 |
||||
|
^"access_res_partner_id_category_group_partner_manager"^,^"res.partner.id_category"^,^"model_res_partner_id_category"^,^"base.group_partner_manager"^,1,1,1,1 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue