[IMP] Change res.partner.address 'function' field(many2one to char)
bzr revid: rga@rga-desktop-20100514095741-a6e96zbag79w5iyh
This commit is contained in:
parent
8f0e5e9a81
commit
75681e3efa
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# 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/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -27,21 +27,6 @@ import ir
|
|||
import pooler
|
||||
from tools.translate import _
|
||||
|
||||
class res_partner_function(osv.osv):
|
||||
_name = 'res.partner.function'
|
||||
_description = 'Function of the contact'
|
||||
_columns = {
|
||||
'name': fields.char('Function Name', size=64, required=True),
|
||||
'code': fields.char('Code', size=8, required=True),
|
||||
'ref':fields.char('Notes', size=32,),
|
||||
}
|
||||
_order = 'name'
|
||||
_sql_constraints = [
|
||||
('code_uniq', 'unique (code)', 'The Code of the Partner Function must be unique !')
|
||||
]
|
||||
res_partner_function()
|
||||
|
||||
|
||||
class res_payterm(osv.osv):
|
||||
_description = 'Payment term'
|
||||
_name = 'res.payterm'
|
||||
|
@ -149,12 +134,12 @@ class res_partner(osv.osv):
|
|||
'active': fields.boolean('Active'),
|
||||
'customer': fields.boolean('Customer', help="Check this box if the partner is a customer."),
|
||||
'supplier': fields.boolean('Supplier', help="Check this box if the partner is a supplier. If it's not checked, purchase people will not see it when encoding a purchase order."),
|
||||
'city': fields.related('address', 'city', type='char', string='City'),
|
||||
'phone': fields.related('address', 'phone', type='char', string='Phone'),
|
||||
'city': fields.related('address', 'city', type='char', string='City'),
|
||||
'phone': fields.related('address', 'phone', type='char', string='Phone'),
|
||||
'country': fields.related('address', 'country_id', type='many2one', relation='res.country', string='Country'),
|
||||
'employee': fields.boolean('Employee', help="Check this box if the partner is an Employee."),
|
||||
'email': fields.related('address', 'email', type='char', size=240, string='E-mail'),
|
||||
'company_id': fields.many2one('res.company', 'Company', select=1),
|
||||
'company_id': fields.many2one('res.company', 'Company', select=1),
|
||||
}
|
||||
|
||||
def _default_category(self, cr, uid, context={}):
|
||||
|
@ -291,7 +276,7 @@ class res_partner_address(osv.osv):
|
|||
_columns = {
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', select=True, help="Keep empty for a private address, not related to partner."),
|
||||
'type': fields.selection( [ ('default','Default'),('invoice','Invoice'), ('delivery','Delivery'), ('contact','Contact'), ('other','Other') ],'Address Type', help="Used to select automatically the right address according to the context in sales and purchases documents."),
|
||||
'function': fields.many2one('res.partner.function', 'Function'),
|
||||
'function': fields.char('Function', size=64),
|
||||
'title': fields.selection(_contact_title_get, 'Title', size=32),
|
||||
'name': fields.char('Contact Name', size=64, select=1),
|
||||
'street': fields.char('Street', size=128),
|
||||
|
@ -469,7 +454,7 @@ class res_partner_category(osv.osv):
|
|||
_columns = {
|
||||
'partner_ids': fields.many2many('res.partner', 'res_partner_category_rel', 'category_id', 'partner_id', 'Partners'),
|
||||
}
|
||||
|
||||
|
||||
res_partner_category()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -33,19 +33,6 @@
|
|||
<field name="shortcut">M.</field>
|
||||
</record>
|
||||
|
||||
<record id="function_director" model="res.partner.function">
|
||||
<field name="name">Director</field>
|
||||
<field name="code">CEO</field>
|
||||
</record>
|
||||
<record id="function_it" model="res.partner.function">
|
||||
<field name="name">Chief Technical Officer</field>
|
||||
<field name="code">CTO</field>
|
||||
</record>
|
||||
<record id="function_sale" model="res.partner.function">
|
||||
<field name="name">Salesman</field>
|
||||
<field name="code">SAL</field>
|
||||
</record>
|
||||
|
||||
<!-- Default bank account description -->
|
||||
<record id="bank_normal" model="res.partner.bank.type">
|
||||
<field name="name">Bank account</field>
|
||||
|
|
|
@ -9,41 +9,6 @@
|
|||
<menuitem id="menu_base_config_partner" name="Partners" parent="menu_base_config" sequence="10" groups="base.group_extended"/>
|
||||
<menuitem id="menu_base_config_contact" name="Contacts" parent="menu_base_config" sequence="20" />
|
||||
|
||||
<!--
|
||||
================================
|
||||
Function
|
||||
================================
|
||||
-->
|
||||
<record id="view_partner_function_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.function.form</field>
|
||||
<field name="model">res.partner.function</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Contact Functions">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_partner_function_tree" model="ir.ui.view">
|
||||
<field name="name">res.partner.function.tree</field>
|
||||
<field name="model">res.partner.function</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Contact Functions">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_partner_function_form" model="ir.actions.act_window">
|
||||
<field name="name">Contact Functions</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.partner.function</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
<menuitem action="action_partner_function_form" id="menu_partner_function_form" parent="base.menu_base_config_contact" sequence="20"/>
|
||||
|
||||
<!--
|
||||
=====================
|
||||
Partner Address
|
||||
|
|
Loading…
Reference in New Issue