Rucha (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-server/trunk-configuration-rework-imp4-rpa into 
lp:~openerp-dev/openobject-server/trunk-configuration-rework.

Requested reviews:
  qdp (OpenERP) (qdp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-configuration-rework-imp4-rpa/+merge/66610
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-configuration-rework-imp4-rpa/+merge/66610
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/trunk-configuration-rework.
=== modified file 'openerp/addons/base/res/res_company.py'
--- openerp/addons/base/res/res_company.py	2011-06-30 13:18:18 +0000
+++ openerp/addons/base/res/res_company.py	2011-07-01 13:48:01 +0000
@@ -79,15 +79,16 @@
     _description = 'Companies'
     _order = 'name'
 
-    def _get_address_data(self, cr, uid, ids, name, arg, context=None):
+    def _get_address_datas(self, cr, uid, ids, name, arg, context=None):
+        "Retrieves address datas of the partner related to the company"
         result = {}
+        part_obj = self.pool.get('res.partner')
+        address_obj = self.pool.get('res.partner.address')
         for company in self.browse(cr, uid, ids, context=context):
             result[company.id] = {}
             for field in name:
                 result[company.id][field] = False
             if company.partner_id:
-                part_obj = self.pool.get('res.partner')
-                address_obj = self.pool.get('res.partner.address')
                 address_data = part_obj.address_get(cr, uid, [company.partner_id.id], adr_pref=['default'])
                 if address_data['default']:
                     address = address_obj.read(cr, uid, address_data['default'], [], context=context)
@@ -95,7 +96,8 @@
                         result[company.id][field] = address[field] or False
         return result
 
-    def _set_address_data(self, cr, uid, company_id, name, value, arg, context=None):
+    def _set_address_datas(self, cr, uid, company_id, name, value, arg, context=None):
+        "Retrieves address datas of the partner related to the company"
         company = self.browse(cr, uid, company_id, context=context)
         if company.partner_id:
             part_obj = self.pool.get('res.partner')
@@ -124,14 +126,14 @@
         'currency_ids': fields.one2many('res.currency', 'company_id', 'Currency'),
         'user_ids': fields.many2many('res.users', 'res_company_users_rel', 'cid', 'user_id', 'Accepted Users'),
         'account_no':fields.char('Account No.', size=64),
-        'street' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=128, type='char',  method=True, string="Street", multi='address'), 
-        'street2' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=128, type='char',  method=True, string="Street2", multi='address'), 
-        'zip' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=24, type='char',  method=True, string="Zip", multi='address'), 
-        'city' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=24, type='char',  method=True, string="City", multi='address'),         
-        'state_id' : fields.function(_get_address_data, fnct_inv=_set_address_data, type='many2one', domain="[('country_id', '=', country_id)]", relation='res.country.state', method=True, string="State", multi='address'), 
-        'country_id' : fields.function(_get_address_data, fnct_inv=_set_address_data, type='many2one', relation='res.country',  method=True, string="Country", multi='address'), 
-        'email' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=64, type='char',  method=True, string="Email", multi='address'), 
-        'phone' : fields.function(_get_address_data, fnct_inv=_set_address_data, size=64, type='char',  method=True, string="Phone", multi='address'), 
+        'street' : fields.function(_get_address_datas, fnct_inv=_set_address_datas, size=128, type='char',  method=True, string="Street", multi='address'), 
+        'street2' : fields.function(_get_address_datas, fnct_inv=_set_address_datas, size=128, type='char',  method=True, string="Street2", multi='address'), 
+        'zip' : fields.function(_get_address_datas, fnct_inv=_set_address_datas, size=24, type='char',  method=True, string="Zip", multi='address'), 
+        'city' : fields.function(_get_address_datas, fnct_inv=_set_address_datas, size=24, type='char',  method=True, string="City", multi='address'),         
+        'state_id' : fields.function(_get_address_datas, fnct_inv=_set_address_datas, type='many2one', domain="[('country_id', '=', country_id)]", relation='res.country.state', method=True, string="State", multi='address'), 
+        'country_id' : fields.function(_get_address_datas, fnct_inv=_set_address_datas, type='many2one', relation='res.country',  method=True, string="Country", multi='address'), 
+        'email' : fields.function(_get_address_datas, fnct_inv=_set_address_datas, size=64, type='char',  method=True, string="Email", multi='address'), 
+        'phone' : fields.function(_get_address_datas, fnct_inv=_set_address_datas, size=64, type='char',  method=True, string="Phone", multi='address'), 
     }
 
     def _search(self, cr, uid, args, offset=0, limit=None, order=None,
@@ -349,8 +351,7 @@
         fp.write(header_xml)
         fp.close()
 
-        if netsvc.Service._services.get('report.company.report'):
-            netsvc.Service._services.pop('report.company.report')
+        netsvc.Service._services.pop('report.company.report', False)
 
         myreport = report_sxw.report_sxw('report.company.report', 'res.company', tempfilename, parser=company_parser)
         return {

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to