1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>)
6
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 3 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>
21
##############################################################################
23
from osv import fields,osv
28
class ups_account_shipping(osv.osv):
29
_name = "ups.account.shipping"
31
'name':fields.char('Name', size=64, required=True, select=1),
32
'atten_name':fields.char('AttentionName', size=64, required=True, select=1),
33
'accesslicensenumber': fields.char('AccessLicenseNumber', size= 64, required=True, select=1),
34
'userid': fields.char('UserId',size=64 , required=True, select=1),
35
'password': fields.char('Password', size=64, required=True, select=1),
36
'active':fields.boolean('Active', size=64,),
37
'acc_no':fields.char('Account Number',size=64 , required=True, select=1, help="Shipper's six digit account number."),
38
'tax_id_no':fields.char('Tax Identification Number',size=64 , select=1, help="Shipper's Tax Identification Number."),
39
'logistic_company_id':fields.many2one('logistic.company','Parent Logistic Company'),
40
'ups_shipping_service_ids':fields.one2many('ups.shipping.service.type','ups_account_id','Shipping Service'),
41
'address':fields.many2one('res.partner.address','Shipper Address'),
42
'trademark':fields.char('Trademark', size=1024, select=1),
47
ups_account_shipping()
50
class ups_account_shipping_service(osv.osv):
51
_name = "ups.shipping.service.type"
52
_rec_name = "description"
54
'description': fields.char('Description', size=32, required=True, select=1),
55
'category': fields.char('Category', size=32, select=1),
56
'shipping_service_code': fields.char('Shipping Service Code', size=8, select=1),
57
'rating_service_code': fields.char('Rating Service Code', size=8, select=1),
58
'ups_account_id':fields.many2one('ups.account.shipping','Parent Shipping Account'),
60
ups_account_shipping_service()
65
class logistic_company(osv.osv):
66
_name = "logistic.company"
67
_inherit="logistic.company"
69
'company_id':fields.many2one('res.company','Company'),
70
'ups_shipping_account_ids': fields.one2many('ups.account.shipping','logistic_company_id','Shipping Account'),
74
def onchange_shipping_number(self, cr, uid, ids, shipping_no,url,context=None):
77
b=url[url.rindex('/'):len(url)]
79
if re.match("^[0-9]*$",b):
80
url=url[0:url.rindex('/')]
81
url+=('/'+shipping_no)
88
class res_company(osv.osv):
89
_inherit = "res.company"
91
'logistic_company_ids': fields.one2many('logistic.company','company_id','Shipping Account'),
97
class shipping_move(osv.osv):
98
_inherit = "shipping.move"
100
'shipper': fields.many2one('ups.account.shipping','Shipper',help='The specific user ID and shipper. Setup in the company configuration.'),
110
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
b'\\ No newline at end of file'