Rename relationship into party

Use party full_xxx
This commit is contained in:
Cédric Krier
2008-10-22 20:13:23 +02:00
parent 974d63c90d
commit 431ca5b03e
6 changed files with 25 additions and 20 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
{
'name': 'Stock Management',
'version': '0.1',
@@ -10,7 +11,7 @@
'depends': [
'ir',
'workflow',
'relationship',
'party',
'product',
'company',
'currency',
+2 -2
View File
@@ -17,7 +17,7 @@ class Location(OSV):
name = fields.Char("Name", size=None, required=True, states=STATES)
code = fields.Char("Code", size=None, states=STATES, select=1)
active = fields.Boolean('Active', select=1)
address = fields.Many2One("relationship.address", "Address",
address = fields.Many2One("party.address", "Address",
states={
'invisible': "type != 'warehouse'",
'readonly': "not active",
@@ -131,7 +131,7 @@ Location()
class Party(OSV):
_name = 'relationship.party'
_name = 'party.party'
supplier_location = fields.Property(type='many2one',
relation='stock.location', string='Supplier Location',
group_name='Stock Properties', view_load=True,
+4 -3
View File
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="location_view_form">
@@ -187,14 +188,14 @@
<record model="ir.property" id="property_supplier_location">
<field name="name">supplier_location</field>
<field name="field"
search="[('model.model', '=', 'relationship.party'),
search="[('model.model', '=', 'party.party'),
('name', '=', 'supplier_location')]"/>
<field name="value" eval="'stock.location,' + str(ref('location_supplier'))"/>
</record>
<record model="ir.property" id="property_customer_location">
<field name="name">customer_location</field>
<field name="field"
search="[('model.model', '=', 'relationship.party'),
search="[('model.model', '=', 'party.party'),
('name', '=', 'customer_location')]"/>
<field name="value" eval="'stock.location,' + str(ref('location_customer'))"/>
</record>
+10 -8
View File
@@ -1,4 +1,5 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
"Packing"
from trytond.osv import fields, OSV
from trytond.netsvc import LocalService
@@ -22,11 +23,11 @@ class PackingIn(OSV):
reference = fields.Char(
"Reference", size=None, select=1,
states={'readonly': "state != 'draft'",})
supplier = fields.Many2One('relationship.party', 'Supplier',
supplier = fields.Many2One('party.party', 'Supplier',
states={
'readonly': "state != 'draft' or bool(incoming_moves)",
}, on_change=['supplier'], required=True)
contact_address = fields.Many2One('relationship.address', 'Contact Address',
contact_address = fields.Many2One('party.address', 'Contact Address',
states={
'readonly': "state != 'draft'",
}, domain="[('party', '=', supplier)]")
@@ -86,7 +87,7 @@ class PackingIn(OSV):
def on_change_supplier(self, cursor, user, ids, values, context=None):
if not values.get('supplier'):
return {}
party_obj = self.pool.get("relationship.party")
party_obj = self.pool.get("party.party")
address_id = party_obj.address_get(cursor, user, values['supplier'],
context=context)
return {'contact_address': address_id}
@@ -269,11 +270,11 @@ class PackingOut(OSV):
states={
'readonly': "state != 'draft'",
})
customer = fields.Many2One('relationship.party', 'Customer', required=True,
customer = fields.Many2One('party.party', 'Customer', required=True,
states={
'readonly': "state != 'draft'",
}, on_change=['customer'])
delivery_address = fields.Many2One('relationship.address',
delivery_address = fields.Many2One('party.address',
'Delivery Address', required=True,
states={
'readonly': "state != 'draft'",
@@ -327,7 +328,7 @@ class PackingOut(OSV):
def on_change_customer(self, cursor, user, ids, values, context=None):
if not values.get('customer'):
return {}
party_obj = self.pool.get("relationship.party")
party_obj = self.pool.get("party.party")
address_id = party_obj.address_get(cursor, user, values['customer'],
type='delivery', context=context)
party = party_obj.browse(cursor, user, values['customer'], context=context)
@@ -751,8 +752,9 @@ class PackingInternal(OSV):
PackingInternal()
class Address(OSV):
_name = 'relationship.address'
_name = 'party.address'
delivery = fields.Boolean('Delivery')
Address()
+6 -5
View File
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
@@ -801,8 +802,8 @@
<!-- Add delivery field on address -->
<record model="ir.ui.view" id="address_view_tree">
<field name="model">relationship.address</field>
<field name="inherit" ref="relationship.address_view_tree"/>
<field name="model">party.address</field>
<field name="inherit" ref="party.address_view_tree"/>
<field name="arch" type="xml">
<![CDATA[
<data>
@@ -815,8 +816,8 @@
</field>
</record>
<record model="ir.ui.view" id="address_view_form">
<field name="model">relationship.address</field>
<field name="inherit" ref="relationship.address_view_form"/>
<field name="model">party.address</field>
<field name="inherit" ref="party.address_view_form"/>
<field name="arch" type="xml">
<![CDATA[
<data>
BIN
View File
Binary file not shown.