|
-
+
|
diff --git a/addons/account_voucher/report/report_voucher_amount.py b/addons/account_voucher/report/report_voucher_amount.py
index 819c59b4391..7c0cfffe317 100644
--- a/addons/account_voucher/report/report_voucher_amount.py
+++ b/addons/account_voucher/report/report_voucher_amount.py
@@ -23,7 +23,6 @@ import time
from report import report_sxw
from tools import amount_to_text_en
-
class report_voucher_amount(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(report_voucher_amount, self).__init__(cr, uid, name, context)
@@ -42,4 +41,4 @@ report_sxw.report_sxw(
'account.voucher',
'addons/account_voucher/report/report_voucher_amount.rml',
parser=report_voucher_amount,header=False
-)
\ No newline at end of file
+)
diff --git a/addons/account_voucher/voucher_report.xml b/addons/account_voucher/voucher_report.xml
new file mode 100644
index 00000000000..56353628bd1
--- /dev/null
+++ b/addons/account_voucher/voucher_report.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
diff --git a/addons/account_voucher/voucher_view.xml b/addons/account_voucher/voucher_view.xml
index a4a789a6e5e..956d9e533a0 100644
--- a/addons/account_voucher/voucher_view.xml
+++ b/addons/account_voucher/voucher_view.xml
@@ -7,12 +7,15 @@
tree
+
+
+
-
-
+
+
@@ -24,7 +27,7 @@
-
+
+
+ account.voucher.select
+ account.voucher
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Vouchers
account.voucher
diff --git a/addons/account_voucher/wizard/account_voucher_open_view.xml b/addons/account_voucher/wizard/account_voucher_open_view.xml
index 0d67c455c3f..11ab3d1ca8a 100644
--- a/addons/account_voucher/wizard/account_voucher_open_view.xml
+++ b/addons/account_voucher/wizard/account_voucher_open_view.xml
@@ -1,24 +1,24 @@
-
+
Open Vouchers
account.open.voucher
form
-
+
-
+
Open Vouchers
@@ -28,15 +28,15 @@
tree,form
{'record_id':active_id}
- new
+ new
-
+
-
-
\ No newline at end of file
+
+
diff --git a/addons/auction/__openerp__.py b/addons/auction/__openerp__.py
index 8918a6394aa..cd27c60fdb7 100644
--- a/addons/auction/__openerp__.py
+++ b/addons/auction/__openerp__.py
@@ -50,8 +50,10 @@
'wizard/auction_payer_sel_view.xml',
'wizard/auction_lots_sms_send_view.xml',
'wizard/auction_catalog_flagey_view.xml',
+# 'wizard/auction_aie_send_view.xml',
# 'wizard/auction_aie_send_result_view.xml',
'wizard/auction_lots_buyer_map_view.xml',
+# 'wizard/auction_lots_numerotate_view.xml',
'auction_view.xml',
'auction_report.xml',
diff --git a/addons/auction/wizard/__init__.py b/addons/auction/wizard/__init__.py
index 957ab02b053..41ada315889 100644
--- a/addons/auction/wizard/__init__.py
+++ b/addons/auction/wizard/__init__.py
@@ -31,8 +31,10 @@ import auction_lots_sms_send
import auction_catalog_flagey_report
#import auction_lots_cancel
#import auction_transfer_unsold_object
+#import auction_aie_send
#import auction_aie_send_result
import auction_lots_buyer_map
+#import auction_lots_numerotate
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auction/wizard/auction_aie_send.py b/addons/auction/wizard/auction_aie_send.py
new file mode 100644
index 00000000000..51368349a98
--- /dev/null
+++ b/addons/auction/wizard/auction_aie_send.py
@@ -0,0 +1,223 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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 .
+#
+##############################################################################
+
+#
+# Does not properly work concurrently !!!
+#
+import base64
+import mimetypes
+import httplib
+import threading
+from tools.translate import _
+from osv import fields,osv
+
+class auction_lots_send_aie(osv.osv_memory):
+ _name = 'auction.lots.send.aie'
+ _descritption = 'Send to website'
+
+ def _date_get(self, cr, uid, context={}):
+ selection = context and context.get('selection')
+ if selection:
+ return [('','')] + selection
+ return [('','')]
+
+ _columns = {
+ 'uname': fields.char('Login', size=64),
+ 'password': fields.char('Password', size=64),
+ 'objects': fields.integer('# of objects', readonly=True),
+ 'lang': fields.selection([('fr','fr'),('ned','ned'),('eng','eng'),('de','de')],'Language'),
+ 'numerotation': fields.selection([('prov','Provisoire'),('definite','Definitive (ordre catalogue)')],'Numerotation'),
+ 'dates': fields.selection(_date_get,'Auction Date'),
+ 'img_send': fields.boolean('Send Image also ?'),
+ }
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
+ """
+ res = super(auction_lots_send_aie, self).default_get(cr, uid, fields, context=context)
+ if 'uname' in fields and context.get('uname',False):
+ res['uname'] = context.get('uname')
+ if 'password' in fields and context.get('password',False):
+ res['password'] = context.get('password')
+ return res
+
+ def _catalog_send(uname, passwd, lang, did, catalog):
+ def post_multipart(host, selector, fields, files):
+ def encode_multipart_formdata(fields, files):
+ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'
+ CRLF = '\r\n'
+ L = []
+ for (key, value) in fields:
+ L.append('--' + BOUNDARY)
+ L.append('Content-Disposition: form-data; name="%s"' % key)
+ L.append('')
+ L.append(value)
+ for (key,value) in files:
+ L.append('--' + BOUNDARY)
+ L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, key+'.pickle'))
+ L.append('Content-Type: application/octet-stream')
+ L.append('')
+ L.append(value)
+ L.append('--' + BOUNDARY + '--')
+ L.append('')
+ body = CRLF.join(L)
+ content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
+ return content_type, body
+ content_type, body = encode_multipart_formdata(fields, files)
+ import httplib
+
+ headers = {"Content-type": content_type, "Accept": "*/*"}
+ conn = httplib.HTTPConnection(host)
+ conn.request("POST", '/bin/catalog.cgi', body, headers = headers)
+ response = conn.getresponse()
+ val = response.status
+ conn.close()
+ return val
+ return post_multipart('auction-in-europe.com', "/bin/catalog.cgi", (('uname',uname),('password',passwd),('did',did),('lang',lang)),(('file',catalog),))
+
+ def _photo_bin_send(uname, passwd, ref, did, photo_name, photo_data):
+ def get_content_type(filename):
+ return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
+
+ def post_multipart(host, selector, fields, files):
+ def encode_multipart_formdata(fields, files):
+ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'
+ CRLF = '\r\n'
+ L = []
+ for (key, value) in fields:
+ L.append('--' + BOUNDARY)
+ L.append('Content-Disposition: form-data; name="%s"' % key)
+ L.append('')
+ L.append(value)
+ for (key, filename, data) in files:
+ L.append('--' + BOUNDARY)
+ L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename))
+ L.append('Content-Type: %s' % get_content_type(filename))
+ L.append('')
+ L.append(data)
+ L.append('--' + BOUNDARY + '--')
+ L.append('')
+ body = CRLF.join(L)
+ content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
+ return content_type, body
+ content_type, body = encode_multipart_formdata(fields, files)
+
+ headers = {"Content-type": content_type, "Accept": "*/*"}
+ conn = httplib.HTTPConnection(host)
+ conn.request("POST", '/bin/photo.cgi', body, headers = headers)
+ response = conn.getresponse()
+ val = response.status
+ conn.close()
+ return val
+ return post_multipart('auction-in-europe.com', "/bin/photo.cgi", (('uname',uname),('ref',ref),('passwd',passwd),('did',did)),(('file',photo_name,photo_data),))
+
+
+ def _photos_send(cr, uid, uname, passwd, did, ids):
+ service = netsvc.LocalService("object_proxy")
+ for (ref,id) in ids:
+
+ # ids_attach = service.execute(db_name,uid, 'ir.attachment', 'search', [('res_model','=','auction.lots'), ('res_id', '=',id)])
+ datas = service.execute(cr.db_name,uid, 'auction.lots', 'read',[id], ['name','image'])
+ if len(datas):
+ bin = base64.decodestring(datas[0]['image'])
+ fname = datas[0]['name']
+ _photo_bin_send(uname, passwd, ref, did, fname, bin)
+
+ def get_dates(self, cr, uid, ids, context={}):
+ import httplib
+ data_obj = self.pool.get('ir.model.data')
+ conn = httplib.HTTPConnection('www.auction-in-europe.com')
+ datas = self.read(cr, uid, ids[0],['uname','password'])
+ conn.request("GET", "/aie_upload/dates_get.php?uname=%s&passwd=%s" % (datas['uname'], datas['password']))
+ response = conn.getresponse()
+ if response.status == 200:
+ def _date_decode(x):
+ return (x.split(' - ')[0], (' - '.join(x.split(' - ')[1:]).decode('latin1','replace').encode('utf-8','replace')))
+ context['selection'] = map(_date_decode, response.read().split('\n'))
+ self._date_get(cr, uid, context=context)
+ else:
+ raise osv.except_osv(_('Error'), _("Connection to WWW.Auction-in-Europe.com failed !"))
+ id1 = data_obj._get_id(cr, uid, 'auction', 'view_auction_lots_send')
+ res_id = data_obj.browse(cr, uid, id1, context=context).res_id
+ context.update(datas)
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'auction.lots.send.aie',
+ 'views': [(res_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target':'new',
+ 'context': context
+ }
+
+ def _send(self, cr, uid, ids, context={}):
+ import pickle, thread, sql_db
+ cr.execute('select name,aie_categ from auction_lot_category')
+ vals = dict(cr.fetchall())
+ cr.close()
+
+ service = netsvc.LocalService("object_proxy")
+ lots = service.execute(cr.dbname, uid, 'auction.lots', 'read', context['active_ids'], ['obj_num','lot_num','obj_desc','bord_vnd_id','lot_est1','lot_est2','artist_id','lot_type','aie_categ'])
+ lots_ids = []
+ datas = self.read(cr, uid, ids[0],['uname','login','lang','numerotation','dates'])
+ for l in lots:
+ if datas['numerotation']=='prov':
+ l['ref']='%s%03d' % (l['bord_vnd_id'][1],l['lot_num'])
+ l['ref2']='%s%03d' % (l['bord_vnd_id'][1],l['lot_num'])
+ else:
+ l['ref']='%04d' % (l['obj_num'],)
+ l['ref2']='%s%03d' % (l['bord_vnd_id'][1],l['lot_num'])
+ if l['artist_id']:
+ l['artist_id'] = l['artist_id'][1]
+ else:
+ l['artist_id'] = ''
+ for n in ('obj_desc','artist_id','lot_type'):
+ try:
+ l[n]=l[n].decode('utf-8','replace').encode('latin1','replace')
+ except:
+ l[n]=''
+ del l['lot_num']
+ del l['obj_num']
+ del l['bord_vnd_id']
+ l['aie_categ'] = vals.get(l['lot_type'], False)
+ lots_ids.append((l['ref'], l['id']))
+ args = pickle.dumps(lots)
+ thread.start_new_thread(_catalog_send, (datas['uname'],datas['password'],datas['lang'],datas['dates'], args))
+ if(datas['form']['img_send']==True):
+ thread.start_new_thread(_photos_send, (cr.dbname, uid, datas['uname'], datas['password'],datas['dates'], lots_ids))
+ return {}
+
+ def send_pdf(self, cr, uid, ids, context):
+ threaded_calculation = threading.Thread(target=self._send, args=(cr, uid, ids, context))
+ threaded_calculation.start()
+ return {}
+
+auction_lots_send_aie()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/auction/wizard/auction_aie_send_result.py b/addons/auction/wizard/auction_aie_send_result.py
new file mode 100644
index 00000000000..404881b2d6b
--- /dev/null
+++ b/addons/auction/wizard/auction_aie_send_result.py
@@ -0,0 +1,139 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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 .
+#
+##############################################################################
+
+#
+# Does not properly work concurrently !!!
+#
+
+import netsvc
+from tools.translate import _
+from osv import fields, osv
+
+class auction_lots_pay(osv.osv_memory):
+ _name = 'auction.lots.send.aie.results'
+ _description = 'Send results to Auction-in-europe.com'
+
+
+ def _date_get(self, cr, uid, context={}):
+ selection = context and context.get('selection')
+ if selection:
+ return [('','')] + selection
+ return [('','')]
+
+ _columns = {
+ 'uname': fields.char('Login', size=64),
+ 'password': fields.char('Password', size=64),
+ 'objects': fields.integer('# of objects'),
+ 'dates': fields.selection(_date_get,'Auction Date'),
+ }
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
+ """
+ res = super(auction_lots_pay, self).default_get(cr, uid, fields, context=context)
+ if 'uname' in fields and context.get('uname',False):
+ res['uname'] = context.get('uname')
+ if 'password' in fields and context.get('password',False):
+ res['password'] = context.get('password')
+ return res
+
+ def _catalog_send(self, uname, passwd, did, catalog):
+ def post_multipart(host, selector, fields, files):
+ def encode_multipart_formdata(fields, files):
+ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'
+ CRLF = '\r\n'
+ L = []
+ for (key, value) in fields:
+ L.append('--' + BOUNDARY)
+ L.append('Content-Disposition: form-data; name="%s"' % key)
+ L.append('')
+ L.append(value)
+ for (key,value) in files:
+ L.append('--' + BOUNDARY)
+ L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, key+'.pickle'))
+ L.append('Content-Type: application/octet-stream')
+ L.append('')
+ L.append(value)
+ L.append('--' + BOUNDARY + '--')
+ L.append('')
+ body = CRLF.join(L)
+ content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
+ return content_type, body
+ content_type, body = encode_multipart_formdata(fields, files)
+ import httplib
+
+ headers = {"Content-type": content_type, "Accept": "*/*"}
+ conn = httplib.HTTPConnection(host)
+ conn.request("POST", '/bin/catalog_result.cgi', body, headers = headers)
+ response = conn.getresponse()
+ val = response.status
+ conn.close()
+ return val
+ return post_multipart('auction-in-europe.com', "/bin/catalog_result.cgi", (('uname',uname),('password',passwd),('did',did)),(('file',catalog),))
+
+ def get_dates(self, cr, uid, ids, context):
+ import httplib
+ conn = httplib.HTTPConnection('www.auction-in-europe.com')
+ data_obj = self.pool.get('ir.model.data')
+ datas = self.read(cr, uid, ids[0],['uname','password'])
+ conn.request("GET", "/aie_upload/dates_get_result.php?uname=%s&passwd=%s" % (datas['uname'], datas['password']))
+ response = conn.getresponse()
+ if response.status == 200:
+ def _date_decode(x):
+ return (x.split(' - ')[0], (' - '.join(x.split(' - ')[1:]).decode('latin1').encode('utf-8')))
+ context['selection'] = map(_date_decode, response.read().split('\n'))
+ self._date_get(cr, uid, context=context)
+ else:
+ raise osv.except_osv(_('Error'),
+ _("Connection to WWW.Auction-in-Europe.com failed !"))
+ id1 = data_obj._get_id(cr, uid, 'auction', 'view_auction_lots_send_result_send')
+ res_id = data_obj.browse(cr, uid, id1, context=context).res_id
+ context.update(datas)
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'auction.lots.send.aie.results',
+ 'views': [(res_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target':'new',
+ 'context': context
+ }
+
+ def send(self, cr, uid, ids, context):
+ import pickle
+ service = netsvc.LocalService("object_proxy")
+ datas = self.read(cr, uid, ids[0],['uname','password','dates'])
+ lots = service.execute(cr.dbname, uid, 'auction.lots', 'read', context['active_ids'], ['obj_num','obj_price'])
+ args = pickle.dumps(lots)
+ self._catalog_send(datas['uname'], datas['password'], datas['dates'], args)
+ return {}
+
+auction_lots_pay()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/auction/wizard/auction_aie_send_result_view.xml b/addons/auction/wizard/auction_aie_send_result_view.xml
new file mode 100644
index 00000000000..7056e88b20e
--- /dev/null
+++ b/addons/auction/wizard/auction_aie_send_result_view.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+ Auction lots send result - Login
+ auction.lots.send.aie.results
+ form
+
+
+
+
+
+
+
+
+ Auction lots send result - Send
+ auction.lots.send.aie.results
+ form
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_aie_send_view.xml b/addons/auction/wizard/auction_aie_send_view.xml
new file mode 100644
index 00000000000..b26aaaf8bc4
--- /dev/null
+++ b/addons/auction/wizard/auction_aie_send_view.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+ Auction lots send - Login
+ auction.lots.send.aie
+ form
+
+
+
+
+
+
+
+
+ Auction lots - Send
+ auction.lots.send.aie
+ form
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_lots_numerotate.py b/addons/auction/wizard/auction_lots_numerotate.py
new file mode 100644
index 00000000000..b464ba49a28
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_numerotate.py
@@ -0,0 +1,184 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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 .
+#
+##############################################################################
+
+import netsvc
+import sql_db
+from osv import osv, fields
+from tools.translate import _
+
+class auction_lots_numerotate_per_lot(osv.osv_memory):
+ _name = 'auction.lots.numerotate'
+ _description = 'Numerotation (per lot)'
+
+ _columns = {
+ 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True),
+ 'lot_num': fields.integer('Inventory Number', readonly=True),
+ 'lot_est1': fields.float('Minimum Estimation', readonly=True),
+ 'lot_est2': fields.float('Maximum Estimation', readonly=True),
+ 'name': fields.char('Short Description', size=64, readonly=True),
+ 'obj_desc': fields.text('Description', readonly=True),
+ 'obj_num': fields.integer('Catalog Number', required=True)
+ }
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
+ """
+ res = super(auction_lots_numerotate_per_lot, self).default_get(cr, uid, fields, context=context)
+ active_id = context.get('active_id',False)
+ active_model = context.get('active_model')
+ if active_id and (active_model and active_model!='auction.lots'):
+ return res
+ lots_obj = self.pool.get('auction.lots')
+ lots = lots_obj.browse(cr, uid, active_id)
+ if 'bord_vnd_id' in fields and context.get('bord_vnd_id',False):
+ res['bord_vnd_id'] = context.get('bord_vnd_id')
+ if 'lot_num' in fields and context.get('lot_num',False):
+ res['lot_num'] = context.get('lot_num')
+ if 'lot_est1' in fields:
+ res['lot_est1'] = lots.lot_est1
+ if 'lot_est2' in fields:
+ res['lot_est2'] = lots.lot_est2
+ if 'name' in fields:
+ res['name'] = lots.name
+ if 'obj_desc' in fields:
+ res['obj_desc'] = lots.obj_desc
+ if 'obj_num' in fields:
+ res['obj_num'] = lots.obj_num
+ return res
+
+ def open_init_form(self, cr, uid, ids, context={}):
+ record_ids = context and context.get('active_ids',False) or False
+ assert record_ids, _('Active IDs not Found')
+ data_obj = self.pool.get('ir.model.data')
+ view_id = data_obj._get_id(cr, uid, 'auction', 'view_auction_numerotate')
+ if view_id:
+ res_id = data_obj.browse(cr, uid, view_id, context=context).res_id
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'auction.lots.numerotate',
+ 'res_id' : False,
+ 'views': [(res_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target':'new',
+ 'context': context
+ }
+
+ def numerotate(self, cr, uid, ids, context={}):
+ record_ids = context and context.get('active_ids',False) or False
+ assert record_ids, _('Active IDs not Found')
+ datas = self.read(cr, uid, ids[0], ['bord_vnd_id','lot_num','obj_num'])
+ data_obj = self.pool.get('ir.model.data')
+ lots_obj = self.pool.get('auction.lots')
+ res = lots_obj.search(cr,uid,[('bord_vnd_id','=',datas['bord_vnd_id']),
+ ('lot_num','=',int(datas['lot_num']))])
+ found = [r for r in res if r in record_ids]
+ if len(found)==0:
+ raise osv.except_osv('UserError', 'This record does not exist !')
+ lots_obj.write(cr, uid, found, {'obj_num':int(datas['obj_num'])} )
+ view_id = data_obj._get_id(cr, uid, 'auction', 'view_auction_numerotate')
+ if view_id:
+ res_id = data_obj.browse(cr, uid, view_id, context=context).res_id
+ context.update(datas)
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'auction.lots.numerotate',
+ 'res_id' : False,
+ 'views': [(res_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target':'new',
+ 'context': context
+ }
+
+ def read_record(self, cr, uid, ids, context={}):
+ record_ids = context and context.get('active_ids',False) or False
+ assert record_ids, _('Active IDs not Found')
+ datas = self.read(cr, uid, ids[0], ['bord_vnd_id','lot_num'])
+ lots_obj = self.pool.get('auction.lots')
+ res = lots_obj.search(cr, uid, [('bord_vnd_id','=',datas['bord_vnd_id']),
+ ('lot_num','=',int(datas['lot_num']))])
+ found = [r for r in res if r in record_ids]
+ if len(found)==0:
+ raise osv.except_osv('UserError', 'This record does not exist !')
+ lots_datas = lots_obj.read(cr, uid, found,
+ ['obj_num', 'name', 'lot_est1',
+ 'lot_est2', 'obj_desc'])
+ return lots_datas[0]
+
+ def test_exist(self, cr, uid, ids, context={}):
+ record_ids = context and context.get('active_ids',False) or False
+ assert record_ids, _('Active IDs not Found')
+ data_obj = self.pool.get('ir.model.data')
+ datas = self.read(cr, uid, ids[0], ['bord_vnd_id','lot_num'])
+ res = self.pool.get('auction.lots').search(cr, uid,
+ [('bord_vnd_id','=',datas['bord_vnd_id']),
+ ('lot_num','=',int(datas['lot_num']))])
+ found = [r for r in res if r in record_ids]
+ if len(found)==0:
+ raise osv.except_osv('Error', 'This lot does not exist !')
+ view_id = data_obj._get_id(cr, uid, 'auction', 'view_auction_lots_numerotate_second')
+ if view_id:
+ res_id = data_obj.browse(cr, uid, view_id, context=context).res_id
+ context.update(datas)
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'auction.lots.numerotate',
+ 'res_id' : False,
+ 'views': [(res_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target':'new',
+ 'context' : context
+ }
+
+auction_lots_numerotate_per_lot()
+
+class auction_lots_numerotate(osv.osv_memory):
+ _name = 'auction.lots.numerotate_cont'
+ _description = 'Numerotation (automatic)'
+
+ _columns = {
+ 'number': fields.integer('First Number', required=True)
+ }
+
+ def numerotate_cont(self, cr, uid, ids, context={}):
+ record_ids = context and context.get('active_ids',False) or False
+ assert record_ids, _('Active IDs not Found')
+ datas = self.read(cr, uid, ids[0], ['number'])
+ nbr = int(datas['number'])
+ lots_obj = self.pool.get('auction.lots')
+ rec_ids = lots_obj.browse(cr, uid, record_ids)
+ for rec_id in rec_ids:
+ lots_obj.write(cr, uid, [rec_id.id], {'obj_num':nbr})
+ nbr+=1
+ return {}
+
+auction_lots_numerotate()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auction/wizard/auction_lots_numerotate_view.xml b/addons/auction/wizard/auction_lots_numerotate_view.xml
new file mode 100644
index 00000000000..6c7775dfbb6
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_numerotate_view.xml
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+ auction.lots.numerotate.open
+ auction.lots.numerotate
+ form
+
+
+
+
+
+
+
+
+ auction.lots.numerotate.second
+ auction.lots.numerotate
+ form
+
+
+
+
+
+
+ Numerotation (per lot)
+ ir.actions.act_window
+ auction.lots.numerotate
+ form
+ form
+
+ new
+
+
+
+ auction.lots.numerotate.not_exist
+ auction.lots.numerotate
+ form
+
+
+
+
+
+
+ Numerotation - Not Exist
+ ir.actions.act_window
+ auction.lots.numerotate
+ form
+ form
+
+ new
+
+
+
+ Numerotation (automatic)
+ auction.lots.numerotate_cont
+ form
+
+
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/wizard_aie_send.py b/addons/auction/wizard/wizard_aie_send.py
deleted file mode 100644
index 2d9c444cba1..00000000000
--- a/addons/auction/wizard/wizard_aie_send.py
+++ /dev/null
@@ -1,232 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# 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 .
-#
-##############################################################################
-
-#
-# Does not properly work concurently !!!
-#
-import pooler
-import wizard
-import netsvc
-import base64
-import mimetypes
-import httplib
-import threading
-from tools.translate import _
-
-login_form = '''
-'''
-
-
-send_form = '''
-'''
-
-login_fields = {
- 'uname': {'string':'Login', 'type':'char'},
- 'password': {'string':'Password', 'type':'char'},
- 'numerotation': {'string':'Numerotation', 'type':'selection', 'selection':[('prov','Provisoire'),('definite','Definitive (ordre catalogue)')]},
- 'dates': {'string':'Auction Date', 'type':'selection', 'selection':[]}
-}
-
-send_fields = {
- 'uname': {'string':'Login', 'type':'char', 'readonly':True},
- 'password': {'string':'Password', 'type':'char', 'readonly':True},
- 'objects': {'string':'# of objects', 'type':'integer', 'readonly':True},
- 'lang': {'string':'Langage', 'type':'selection', 'selection':[('fr','fr'),('ned','ned'),('eng','eng'),('de','de')]},
- 'numerotation': {'string':'Numerotation', 'type':'selection', 'selection':[('prov','Provisoire'),('definite','Definitive (ordre catalogue)')]},
- 'dates': {'string':'Auction Date', 'type':'selection', 'selection':[]},
- 'img_send': {'string':'Send Image also ?', 'type':'boolean'}
-}
-
-def _catalog_send(uname, passwd, lang, did, catalog):
- def post_multipart(host, selector, fields, files):
- def encode_multipart_formdata(fields, files):
- BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'
- CRLF = '\r\n'
- L = []
- for (key, value) in fields:
- L.append('--' + BOUNDARY)
- L.append('Content-Disposition: form-data; name="%s"' % key)
- L.append('')
- L.append(value)
- for (key,value) in files:
- L.append('--' + BOUNDARY)
- L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, key+'.pickle'))
- L.append('Content-Type: application/octet-stream')
- L.append('')
- L.append(value)
- L.append('--' + BOUNDARY + '--')
- L.append('')
- body = CRLF.join(L)
- content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
- return content_type, body
- content_type, body = encode_multipart_formdata(fields, files)
- import httplib
-
- headers = {"Content-type": content_type, "Accept": "*/*"}
- conn = httplib.HTTPConnection(host)
- conn.request("POST", '/bin/catalog.cgi', body, headers = headers)
- response = conn.getresponse()
- val = response.status
- conn.close()
- return val
- return post_multipart('auction-in-europe.com', "/bin/catalog.cgi", (('uname',uname),('password',passwd),('did',did),('lang',lang)),(('file',catalog),))
-
-def _photo_bin_send(uname, passwd, ref, did, photo_name, photo_data):
- def get_content_type(filename):
- return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
-
- def post_multipart(host, selector, fields, files):
- def encode_multipart_formdata(fields, files):
- BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'
- CRLF = '\r\n'
- L = []
- for (key, value) in fields:
- L.append('--' + BOUNDARY)
- L.append('Content-Disposition: form-data; name="%s"' % key)
- L.append('')
- L.append(value)
- for (key, filename, data) in files:
- L.append('--' + BOUNDARY)
- L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename))
- L.append('Content-Type: %s' % get_content_type(filename))
- L.append('')
- L.append(data)
- L.append('--' + BOUNDARY + '--')
- L.append('')
- body = CRLF.join(L)
- content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
- return content_type, body
- content_type, body = encode_multipart_formdata(fields, files)
-
- headers = {"Content-type": content_type, "Accept": "*/*"}
- conn = httplib.HTTPConnection(host)
- conn.request("POST", '/bin/photo.cgi', body, headers = headers)
- response = conn.getresponse()
- val = response.status
- conn.close()
- return val
- return post_multipart('auction-in-europe.com', "/bin/photo.cgi", (('uname',uname),('ref',ref),('passwd',passwd),('did',did)),(('file',photo_name,photo_data),))
-
-
-def _photos_send(cr,uid, uname, passwd, did, ids):
- for (ref,id) in ids:
- service = netsvc.LocalService("object_proxy")
-# ids_attach = service.execute(db_name,uid, 'ir.attachment', 'search', [('res_model','=','auction.lots'), ('res_id', '=',id)])
- datas = service.execute(cr.db_name,uid, 'auction.lots', 'read',[id], ['name','image'])
- if len(datas):
- bin = base64.decodestring(datas[0]['image'])
- fname = datas[0]['name']
- _photo_bin_send(uname, passwd, ref, did, fname, bin)
-
-def _get_dates(self,cr,uid, datas,context={}):
- global send_fields
- import httplib
- conn = httplib.HTTPConnection('www.auction-in-europe.com')
- conn.request("GET", "/aie_upload/dates_get.php?uname=%s&passwd=%s" % (datas['form']['uname'], datas['form']['password']))
- response = conn.getresponse()
- if response.status == 200:
- def _date_decode(x):
- return (x.split(' - ')[0], (' - '.join(x.split(' - ')[1:]).decode('latin1','replace').encode('utf-8','replace')))
- send_fields['dates']['selection'] = map(_date_decode, response.read().split('\n'))
- else:
- raise wizard.except_wizard(_('Error'), _("Connection to WWW.Auction-in-Europe.com failed !"))
- return {'objects':len(datas['ids'])}
-
-def _send(self,db_name,uid, datas,context={}):
- import pickle, thread, sql_db
- #cr = pooler.get_db(cr.dbname).cursor()
-
-# cr=sql_db.db.cursor()
- cr = pooler.get_db(db_name).cursor()
-
- cr.execute('select name,aie_categ from auction_lot_category')
- vals = dict(cr.fetchall())
- cr.close()
-
- service = netsvc.LocalService("object_proxy")
- lots = service.execute(cr.dbname,uid, 'auction.lots', 'read', datas['ids'], ['obj_num','lot_num','obj_desc','bord_vnd_id','lot_est1','lot_est2','artist_id','lot_type','aie_categ'])
- ids = []
- for l in lots:
- if datas['form']['numerotation']=='prov':
- l['ref']='%s%03d' % (l['bord_vnd_id'][1],l['lot_num'])
- l['ref2']='%s%03d' % (l['bord_vnd_id'][1],l['lot_num'])
- else:
- l['ref']='%04d' % (l['obj_num'],)
- l['ref2']='%s%03d' % (l['bord_vnd_id'][1],l['lot_num'])
- if l['artist_id']:
- l['artist_id'] = l['artist_id'][1]
- else:
- l['artist_id'] = ''
- for n in ('obj_desc','artist_id','lot_type'):
- try:
- l[n]=l[n].decode('utf-8','replace').encode('latin1','replace')
- except:
- l[n]=''
- del l['lot_num']
- del l['obj_num']
- del l['bord_vnd_id']
- l['aie_categ'] = vals.get(l['lot_type'], False)
- ids.append((l['ref'], l['id']))
- args = pickle.dumps(lots)
- thread.start_new_thread(_catalog_send, (datas['form']['uname'],datas['form']['password'],datas['form']['lang'],datas['form']['dates'], args))
- if(datas['form']['img_send']==True):
- thread.start_new_thread(_photos_send, (cr.dbname,uid, datas['form']['uname'],datas['form']['password'],datas['form']['dates'], ids))
- return {}
-
-def _send_pdf(self, cr, uid, data, context):
- threaded_calculation = threading.Thread(target=_send, args=(self, cr.dbname, uid, data, context))
- threaded_calculation.start()
- return {}
-
-class wiz_auc_lots_pay(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':login_form, 'fields': login_fields, 'state':[('date_ask','Continue'),('end','Cancel')]}
- },
- 'date_ask': {
- 'actions': [_get_dates],
- 'result': {'type': 'form', 'arch':send_form, 'fields': send_fields, 'state':[('send','Send on your website'),('end','Cancel')]}
- },
- 'send': {
- 'actions': [_send_pdf],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
-wiz_auc_lots_pay('auction.lots.send.aie');
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/auction/wizard/wizard_aie_send_result.py b/addons/auction/wizard/wizard_aie_send_result.py
deleted file mode 100644
index 30b6b82c124..00000000000
--- a/addons/auction/wizard/wizard_aie_send_result.py
+++ /dev/null
@@ -1,137 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# 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 .
-#
-##############################################################################
-
-#
-# Does not properly work concurently !!!
-#
-
-import wizard
-import netsvc
-from tools.translate import _
-
-login_form = '''
-'''
-
-
-send_form = '''
-'''
-
-login_fields = {
- 'uname': {'string':'Login', 'type':'char'},
- 'password': {'string':'Password', 'type':'char'},
- 'dates': {'string':'Auction Date', 'type':'selection', 'selection':[]}
-}
-
-send_fields = {
- 'uname': {'string':'Login', 'type':'char', 'readonly':True},
- 'password': {'string':'Password', 'type':'char', 'readonly':True},
- 'objects': {'string':'# of objects', 'type':'integer', 'readonly':True},
- 'dates': {'string':'Auction Date', 'type':'selection', 'selection':[]}
-}
-
-def _catalog_send(uname, passwd, did, catalog):
- def post_multipart(host, selector, fields, files):
- def encode_multipart_formdata(fields, files):
- BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'
- CRLF = '\r\n'
- L = []
- for (key, value) in fields:
- L.append('--' + BOUNDARY)
- L.append('Content-Disposition: form-data; name="%s"' % key)
- L.append('')
- L.append(value)
- for (key,value) in files:
- L.append('--' + BOUNDARY)
- L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, key+'.pickle'))
- L.append('Content-Type: application/octet-stream')
- L.append('')
- L.append(value)
- L.append('--' + BOUNDARY + '--')
- L.append('')
- body = CRLF.join(L)
- content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
- return content_type, body
- content_type, body = encode_multipart_formdata(fields, files)
- import httplib
-
- headers = {"Content-type": content_type, "Accept": "*/*"}
- conn = httplib.HTTPConnection(host)
- conn.request("POST", '/bin/catalog_result.cgi', body, headers = headers)
- response = conn.getresponse()
- val = response.status
- conn.close()
- return val
- return post_multipart('auction-in-europe.com', "/bin/catalog_result.cgi", (('uname',uname),('password',passwd),('did',did)),(('file',catalog),))
-
-def _get_dates(self,cr,uid, datas, context):
- global send_fields
- import httplib
- conn = httplib.HTTPConnection('www.auction-in-europe.com')
- conn.request("GET", "/aie_upload/dates_get_result.php?uname=%s&passwd=%s" % (datas['form']['uname'], datas['form']['password']))
- response = conn.getresponse()
- if response.status == 200:
- def _date_decode(x):
- return (x.split(' - ')[0], (' - '.join(x.split(' - ')[1:]).decode('latin1').encode('utf-8')))
- send_fields['dates']['selection'] = map(_date_decode, response.read().split('\n'))
- else:
- raise wizard.except_wizard(_('Error'),
- _("Connection to WWW.Auction-in-Europe.com failed !"))
- return {'objects':len(datas['ids'])}
-
-def _send(self,cr,uid, datas, context):
- import pickle
- service = netsvc.LocalService("object_proxy")
- lots = service.execute(cr.dbname,uid, 'auction.lots', 'read', datas['ids'], ['obj_num','obj_price'])
- args = pickle.dumps(lots)
- _catalog_send(datas['form']['uname'],datas['form']['password'], datas['form']['dates'], args)
- return {}
-
-class wiz_auc_lots_pay(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':login_form, 'fields': login_fields, 'state':[('date_ask','Continue'),('end','Cancel')]}
- },
- 'date_ask': {
- 'actions': [_get_dates],
- 'result': {'type': 'form', 'arch':send_form, 'fields': send_fields, 'state':[('send','Send on your website'),('end','Cancel')]}
- },
- 'send': {
- 'actions': [_send],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
-wiz_auc_lots_pay('auction.lots.send.aie.results');
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/auction/wizard/wizard_lots_numerotate.py b/addons/auction/wizard/wizard_lots_numerotate.py
deleted file mode 100644
index 1232a559e4d..00000000000
--- a/addons/auction/wizard/wizard_lots_numerotate.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# 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 .
-#
-##############################################################################
-
-import wizard
-import netsvc
-import pooler
-import sql_db
-
-numerotate_form_cont = '''
-''' % ('Continuous Numerotation','First Number')
-
-numerotate_fields_cont = {
- 'number': {'string':'First Number', 'type':'integer', 'required':True}
-}
-
-numerotate_not_exist = '''
-''' % ('Catalog Numerotation',)
-
-
-numerotate_form = '''
-''' % ('Catalog Numerotation','Object Reference')
-
-numerotate_fields = {
- 'bord_vnd_id': {'string':'Depositer Inventory', 'type':'many2one', 'required':True, 'relation':'auction.deposit'},
- 'lot_num': {'string':'Lot Number', 'type':'integer', 'required':True},
-}
-
-numerotate_form2 = '''
-''' % ('Catalog Numerotation','Object Reference','Object Reference')
-
-numerotate_fields2 = {
- 'bord_vnd_id': {'string':'Object Inventory', 'type':'many2one', 'relation':'auction.deposit', 'readonly':True},
- 'lot_num': {'string':'Inventory Number', 'type':'integer', 'readonly':True},
- 'lot_est1': {'string':'Minimum Estimation', 'type':'float', 'readonly':True},
- 'lot_est2': {'string':'Maximum Estimation', 'type':'float', 'readonly':True},
- 'name': {'string':'Short Description', 'type':'char', 'size':64, 'readonly':True},
- 'obj_desc': {'string':'Description', 'type':'text', 'readonly':True},
- 'obj_num': {'string':'Catalog Number', 'type':'integer', 'required':True}
-}
-
-def _read_record(self,cr,uid,datas,context={}):
- form = datas['form']
- res = pooler.get_pool(cr.dbname).get('auction.lots').search(cr,uid,[('bord_vnd_id','=',form['bord_vnd_id']), ('lot_num','=',int(form['lot_num']))])
- found = [r for r in res if r in datas['ids']]
- if len(found)==0:
- raise wizard.except_wizard('UserError', 'This record does not exist !')
- datas = pooler.get_pool(cr.dbname).get('auction.lots').read(cr,uid,found,['obj_num', 'name', 'lot_est1', 'lot_est2', 'obj_desc'])
- return datas[0]
-
-def _test_exist(self,cr,uid,datas,context={}):
- form = datas['form']
- res = pooler.get_pool(cr.dbname).get('auction.lots').search(cr,uid,[('bord_vnd_id','=',form['bord_vnd_id']), ('lot_num','=',int(form['lot_num']))])
- found = [r for r in res if r in datas['ids']]
- if len(found)==0:
- return 'not_exist'
- return 'search'
-
-def _numerotate(self,cr,uid,datas,context={}):
- form = datas['form']
- res = pooler.get_pool(cr.dbname).get('auction.lots').search(cr,uid,[('bord_vnd_id','=',form['bord_vnd_id']), ('lot_num','=',int(form['lot_num']))])
- found = [r for r in res if r in datas['ids']]
- if len(found)==0:
- raise wizard.except_wizard('UserError', 'This record does not exist !')
- pooler.get_pool(cr.dbname).get('auction.lots').write(cr,uid,found,{'obj_num':int(form['obj_num'])} )
- return {'lot_inv':'', 'lot_num':''}
-
-def _numerotate_cont(self,cr,uid,datas,context={}):
- nbr = int(datas['form']['number'])
- refs = pooler.get_pool(cr.dbname).get('auction.lots')
- rec_ids = refs.browse(cr,uid,datas['ids'])
- for rec_id in rec_ids:
- refs.write(cr,uid,[rec_id.id],{'obj_num':nbr})
- nbr+=1
- return {}
-
-class wiz_auc_lots_numerotate(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':numerotate_form, 'fields': numerotate_fields, 'state':[('end','Cancel'),('choice','Continue')]}
- },
- 'search': {
- 'actions': [_read_record],
- 'result': {'type': 'form', 'arch':numerotate_form2, 'fields': numerotate_fields2, 'state':[('end','Exit'),('init','Back'),('set_number','Numerotate')]}
- },
- 'choice' : {
- 'actions' : [],
- 'result' : {'type' : 'choice', 'next_state': _test_exist }
- },
- 'not_exist' : {
- 'actions': [],
- 'result': {'type': 'form', 'arch':numerotate_not_exist, 'fields': {}, 'state':[('end','Exit'),('init','Retry')]}
- },
- 'set_number': {
- 'actions': [_numerotate],
- 'result': {'type': 'state', 'state':'init'}
- }
- }
-wiz_auc_lots_numerotate('auction.lots.numerotate');
-
-
-class wiz_auc_lots_numerotate(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':numerotate_form_cont, 'fields': numerotate_fields_cont, 'state':[('end','Exit'),('set_number','Numerotation')]}
- },
- 'set_number': {
- 'actions': [_numerotate_cont],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
-wiz_auc_lots_numerotate('auction.lots.numerotate_cont');
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/base_setup/i18n/th.po b/addons/base_setup/i18n/th.po
new file mode 100644
index 00000000000..0d613b0573b
--- /dev/null
+++ b/addons/base_setup/i18n/th.po
@@ -0,0 +1,277 @@
+# Thai translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2009-08-28 16:01+0000\n"
+"PO-Revision-Date: 2010-05-20 04:32+0000\n"
+"Last-Translator: Songpon Phusing \n"
+"Language-Team: Thai | \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-21 03:37+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,city:0
+#: wizard_field:base_setup.base_setup,init,city:0
+#: wizard_field:base_setup.base_setup,update,city:0
+msgid "City"
+msgstr "อำเภอ"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,finish:0
+msgid ""
+"You can start configuring the system or connect directly to the database "
+"using the default setup."
+msgstr "คุณอาจจะเริ่มตั้งค่าหรือใช้ค่าพื้นฐานเบื้องต้น"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,zip:0
+#: wizard_field:base_setup.base_setup,init,zip:0
+#: wizard_field:base_setup.base_setup,update,zip:0
+msgid "Zip code"
+msgstr "รหัสไปรษณีย์"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,init:0
+msgid "Select a Profile"
+msgstr "เลือกแบบ"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,company:0
+msgid "Report header"
+msgstr "หัวรายงาน"
+
+#. module: base_setup
+#: wizard_button:base_setup.base_setup,finish,config:0
+msgid "Start Configuration"
+msgstr "เริ่มการตั้งค่า"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,init:0
+msgid ""
+"You'll be able to install more modules later through the Administration menu."
+msgstr "คุณสามารถลงโมดูลใหม่ๆได้ในเมนูการบริหารระบบ"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,init:0
+msgid ""
+"A profile sets a pre-selection of modules for specific needs. These profiles "
+"have been setup to help you discover the different aspects of OpenERP. This "
+"is just an overview, we have 300+ available modules."
+msgstr ""
+"รูปแบบโมดูลเป็นเพียงการตั้งค่าแนะนำในการใช้งานเพื่อตั้งค่าได้ง่ายขึ้น "
+"แต่เรามีโมดูลที่สามารถหาติดตั้งได้มากกว่า 500 โมดูล"
+
+#. module: base_setup
+#: wizard_button:base_setup.base_setup,company,update:0
+#: wizard_button:base_setup.base_setup,init,company:0
+msgid "Next"
+msgstr "ถัดไป"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,email:0
+#: wizard_field:base_setup.base_setup,init,email:0
+#: wizard_field:base_setup.base_setup,update,email:0
+msgid "E-mail"
+msgstr "อีเมล์"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,state_id:0
+#: wizard_field:base_setup.base_setup,init,state_id:0
+#: wizard_field:base_setup.base_setup,update,state_id:0
+msgid "State"
+msgstr "จังหวัด"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,finish:0
+msgid "Your new database is now fully installed."
+msgstr "ฐานข้อมูลใหม่ตั้งตั้งเสร็จสิ้น"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,profile:0
+#: wizard_field:base_setup.base_setup,init,profile:0
+#: wizard_field:base_setup.base_setup,update,profile:0
+msgid "Profile"
+msgstr "รูปแบบ"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,rml_footer1:0
+#: wizard_field:base_setup.base_setup,init,rml_footer1:0
+#: wizard_field:base_setup.base_setup,update,rml_footer1:0
+msgid "Report Footer 1"
+msgstr "หัวรายงาน 1"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,rml_footer2:0
+#: wizard_field:base_setup.base_setup,init,rml_footer2:0
+#: wizard_field:base_setup.base_setup,update,rml_footer2:0
+msgid "Report Footer 2"
+msgstr "ท้ายรายงาน 2"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,company:0
+msgid "General Information"
+msgstr "ข้อมูลทั่วไป"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,street2:0
+#: wizard_field:base_setup.base_setup,init,street2:0
+#: wizard_field:base_setup.base_setup,update,street2:0
+msgid "Street2"
+msgstr "ตำบล"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,company:0
+msgid "Report Information"
+msgstr "ข้อมูลรายงาน"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,phone:0
+#: wizard_field:base_setup.base_setup,init,phone:0
+#: wizard_field:base_setup.base_setup,update,phone:0
+msgid "Phone"
+msgstr "โทรศัพท์"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,company:0
+msgid "Define Main Company"
+msgstr "ตั้งบริษัทหลัก"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,name:0
+#: wizard_field:base_setup.base_setup,init,name:0
+#: wizard_field:base_setup.base_setup,update,name:0
+msgid "Company Name"
+msgstr "ชื่อบริษัท"
+
+#. module: base_setup
+#: help:base_setup.base_setup,company,rml_footer2:0
+#: help:base_setup.base_setup,init,rml_footer2:0
+#: help:base_setup.base_setup,update,rml_footer2:0
+msgid ""
+"This sentence will appear at the bottom of your reports.\n"
+"We suggest you to put bank information here:\n"
+"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
+msgstr ""
+"ข้อมูลนี่จะอยู่ในท้ายกระดาษของรายงาน\n"
+"เราแนะนำให้เปลี่ยนโดยใส่ข้อมูลของธนาคาร\n"
+"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,country_id:0
+#: wizard_field:base_setup.base_setup,init,country_id:0
+#: wizard_field:base_setup.base_setup,update,country_id:0
+msgid "Country"
+msgstr "ประเทศ"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,company:0
+#: wizard_view:base_setup.base_setup,finish:0
+#: wizard_view:base_setup.base_setup,init:0
+#: wizard_view:base_setup.base_setup,update:0
+#: model:ir.actions.wizard,name:base_setup.action_wizard_setup
+#: model:ir.actions.wizard,name:base_setup.wizard_base_setup
+msgid "Setup"
+msgstr "ตั้งค่า"
+
+#. module: base_setup
+#: help:base_setup.base_setup,company,rml_footer1:0
+#: help:base_setup.base_setup,init,rml_footer1:0
+#: help:base_setup.base_setup,update,rml_footer1:0
+msgid ""
+"This sentence will appear at the bottom of your reports.\n"
+"We suggest you to write legal sentences here:\n"
+"Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07"
+msgstr ""
+"ข้อมูลนี่จะอยู่ในท้ายกระดาษของรายงาน\n"
+"เราแนะนำให้ท่านนำข้อมูลเกี่ยวกับทางกฏหมาย\n"
+"Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,update:0
+msgid "Summary"
+msgstr "สรุป"
+
+#. module: base_setup
+#: wizard_button:base_setup.base_setup,update,finish:0
+msgid "Install"
+msgstr "ติดตั้ง"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,finish:0
+msgid "Installation Done"
+msgstr "ติดตั้งเสร็จสิ้น"
+
+#. module: base_setup
+#: help:base_setup.base_setup,company,rml_header1:0
+#: help:base_setup.base_setup,init,rml_header1:0
+#: help:base_setup.base_setup,update,rml_header1:0
+msgid ""
+"This sentence will appear at the top right corner of your reports.\n"
+"We suggest you to put a slogan here:\n"
+"\"Open Source Business Solutions\"."
+msgstr ""
+"ข้อมูลนี่จะอยู่ในด้านบนขวาของรายงานท่าน\n"
+"กรุณาใส่ สโลแกน\n"
+"\"Open Source Business Solutions\"."
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,rml_header1:0
+#: wizard_field:base_setup.base_setup,init,rml_header1:0
+#: wizard_field:base_setup.base_setup,update,rml_header1:0
+msgid "Report Header"
+msgstr "หัวรายงาน"
+
+#. module: base_setup
+#: wizard_view:base_setup.base_setup,company:0
+msgid "Your Logo - Use a size of about 450x150 pixels."
+msgstr "กรุณาใช้โลโก้ขนาด 450X150 px"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,currency:0
+#: wizard_field:base_setup.base_setup,init,currency:0
+#: wizard_field:base_setup.base_setup,update,currency:0
+msgid "Currency"
+msgstr "อัตราแลกเปลี่ยน"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,street:0
+#: wizard_field:base_setup.base_setup,init,street:0
+#: wizard_field:base_setup.base_setup,update,street:0
+msgid "Street"
+msgstr "ที่อยู่"
+
+#. module: base_setup
+#: wizard_button:base_setup.base_setup,finish,menu:0
+msgid "Use Directly"
+msgstr "ใช้ทันที"
+
+#. module: base_setup
+#: wizard_button:base_setup.base_setup,init,menu:0
+msgid "Cancel"
+msgstr "ยกเลิก"
+
+#. module: base_setup
+#: wizard_field:base_setup.base_setup,company,logo:0
+#: wizard_field:base_setup.base_setup,init,logo:0
+#: wizard_field:base_setup.base_setup,update,logo:0
+msgid "Logo"
+msgstr "โลโก้"
+
+#. module: base_setup
+#: model:ir.module.module,shortdesc:base_setup.module_meta_information
+msgid "Base Setup"
+msgstr "โครงสร้าง ตั้งค่า"
+
+#. module: base_setup
+#: wizard_button:base_setup.base_setup,company,init:0
+#: wizard_button:base_setup.base_setup,update,company:0
+msgid "Previous"
+msgstr "ก่อนหน้า"
diff --git a/addons/board_association/i18n/lt.po b/addons/board_association/i18n/lt.po
index cf53291f10b..581b5bc4c83 100644
--- a/addons/board_association/i18n/lt.po
+++ b/addons/board_association/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-09-08 15:20+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-05-19 09:15+0000\n"
+"Last-Translator: Rytis Ūsalis \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 03:57+0000\n"
+"X-Launchpad-Export-Date: 2010-05-20 05:23+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board_association
@@ -40,7 +40,7 @@ msgstr ""
#. module: board_association
#: view:board.board:0
msgid "My tasks"
-msgstr ""
+msgstr "Mano užduotys"
#. module: board_association
#: view:board.board:0
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index fe0eb82c52a..fe43982ad66 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -103,7 +103,7 @@ class crm_lead(osv.osv, crm_case):
'email_cc': fields.text('Watchers Emails', size=252 , help="These \
people will receive a copy of the future communication between partner \
and users by email"),
- 'description': fields.text('Description'),
+ 'description': fields.text('Notes'),
'write_date': fields.datetime('Update Date' , readonly=True),
# Lead fields
@@ -137,7 +137,7 @@ and users by email"),
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
- }
+ }
_defaults = {
'active': lambda *a: 1,
diff --git a/addons/delivery/__openerp__.py b/addons/delivery/__openerp__.py
index 9b0949e07e1..684547e0a89 100644
--- a/addons/delivery/__openerp__.py
+++ b/addons/delivery/__openerp__.py
@@ -39,6 +39,7 @@
'partner_view.xml'
],
'demo_xml': ['delivery_demo.xml'],
+ 'test':['test/delivery_test.yml',],
'installable': True,
'active': False,
'certificate': '0033981912253',
diff --git a/addons/delivery/test/delivery_test.yml b/addons/delivery/test/delivery_test.yml
new file mode 100644
index 00000000000..9225cbca66b
--- /dev/null
+++ b/addons/delivery/test/delivery_test.yml
@@ -0,0 +1,155 @@
+-
+ In order to test the delivery module, I will do Configuration -> Delivery -> Delivery Method
+ And there are two methods for doing that
+ Delivery based on order quantities,
+ Delivery based on delivered quantities.
+-
+ I create the partner associated with the transport.
+-
+ I create partner.
+-
+ !record {model: res.partner, id: res_partner_thepost0}:
+ address:
+ - country_id: base.in
+ name: Micro Link
+ credit_limit: 0.0
+ name: The Post
+ property_account_payable: account.a_pay
+ property_account_receivable: account.a_recv
+-
+
+ I create associated product for delivery.
+-
+ !record {model: product.product, id: product_product_deliverybypost0}:
+ categ_id: product.product_category_services
+ cost_method: standard
+ mes_type: fixed
+ name: Delivery Product
+ procure_method: make_to_stock
+ supply_method: buy
+ type: service
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+ warranty: 0.0
+-
+ I create the Delivery Method.
+-
+ !record {model: delivery.carrier, id: delivery_carrier_theopenerpexperss0}:
+ name: The OpenERP Experss
+ partner_id: res_partner_thepost0
+ product_id: product_product_deliverybypost0
+-
+ I create a delivery grid record and define the region for which the tariffs in the grid will be applicable.
+ Then set the condition for which this rule is applicable.
+-
+ !record {model: delivery.grid, id: delivery_grid_weight0}:
+ carrier_id: delivery_carrier_theopenerpexperss0
+ line_ids:
+ - list_price: 120.0
+ max_value: 250.0
+ name: Weight of product
+ operator: <=
+ standard_price: 60.0
+ type: weight
+ price_type: fixed
+ variable_factor: weight
+ - list_price: 0.0
+ max_value: 500.0
+ name: Price >= 500
+ operator: <=
+ standard_price: 20.0
+ type: price
+ price_type: fixed
+ variable_factor: weight
+ country_ids:
+ - base.id
+ - base.be
+ - base.in
+ - base.io
+
+ name: Weight
+ sequence: 1
+-
+ To check the Delivery based on order quantities , I have created sale order and picking_policy is direct .
+-
+ !record {model: sale.order, id: sale_order_so0}:
+ date_order: '2010-05-11'
+ invoice_quantity: order
+ name: Test/delivery
+ order_line:
+ - name: '[PC1] Basic PC'
+ price_unit: 450.0
+ product_uom: product.product_uom_unit
+ product_uom_qty: 10.0
+ state: draft
+ delay: 2.0
+ product_id: product.product_product_pc1
+ product_uos_qty: 10.0
+ th_weight: 0.0
+ type: make_to_stock
+ order_policy: manual
+ partner_id: base.res_partner_agrolait
+ partner_invoice_id: base.res_partner_address_8
+ partner_order_id: base.res_partner_address_8
+ partner_shipping_id: base.res_partner_address_8
+ picking_policy: direct
+ pricelist_id: product.list0
+ shop_id: sale.shop
+-
+ I create delivery.sale.order record.
+-
+ !record {model: delivery.sale.order, id: delivery_sale_order_0}:
+ carrier_id: delivery_carrier_theopenerpexperss0
+-
+ To add the delivery charges on the quotation, I click on Delivery costs button and select the carrier.
+-
+ !python {model: delivery.sale.order}: |
+ self.delivery_set(cr, uid, [ref("delivery_sale_order_0")], {"lang": "en_US", "active_model":
+ "sale.order", "tz": False, "order_id": 8, "active_ids": [ref("sale_order_so0")],
+ "active_id": ref("sale_order_so0"), })
+-
+ I confirm the sale order.
+-
+ !workflow {model: sale.order, action: order_confirm, ref: sale_order_so0}
+-
+ To check the Invoicing based on deliveries.I create new sale order and picking_policy is Complete Delivery.
+-
+ !record {model: sale.order, id: sale_order_test_complete0}:
+ name: Test/Complete Deliver
+ carrier_id: delivery.delivery_carrier_theopenerpexperss0
+ invoice_quantity: procurement
+ order_line:
+ - name: '[PC1] Basic PC'
+ price_unit: 450.0
+ product_uom: product.product_uom_unit
+ product_uom_qty: 10.0
+ state: draft
+ delay: 2.0
+ product_id: product.product_product_pc1
+ product_uos_qty: 10.0
+ th_weight: 0.0
+ type: make_to_stock
+ partner_id: base.res_partner_4
+ partner_order_id: base.res_partner_address_7
+ partner_invoice_id: base.res_partner_address_7
+ partner_shipping_id: base.res_partner_address_7
+ pricelist_id: product.list0
+ order_policy: picking
+-
+ I confirm the sale order.
+-
+ !workflow {model: sale.order, action: order_confirm, ref: sale_order_test_complete0}
+-
+ I Create stock.invoice.onshipping
+-
+ !record {model: stock.invoice.onshipping, id: stock_invoice_onshipping_0}:
+ journal_id: account.sales_journal
+ type: out_invoice
+-
+ I Create Invoice form picking.
+-
+ !python {model: stock.invoice.onshipping}: |
+ so=self.pool.get('sale.order').browse(cr,uid,ref('sale_order_test_complete0'))
+ self.create_invoice(cr, uid, [ref("stock_invoice_onshipping_0")], {"lang": "en_US",
+ "tz": False, "active_model": "stock.picking", "contact_display": "partner",
+ "active_ids": [so.picking_ids[0].id], "active_id": so.picking_ids[0].id })
diff --git a/addons/idea/idea.py b/addons/idea/idea.py
index e46115c5639..12564de8540 100644
--- a/addons/idea/idea.py
+++ b/addons/idea/idea.py
@@ -29,7 +29,7 @@ DefaultVoteValue = '50'
class idea_category(osv.osv):
""" Category of Idea """
-
+
_name = "idea.category"
_description = "Idea Category"
@@ -38,7 +38,7 @@ class idea_category(osv.osv):
'summary': fields.text('Summary'),
'parent_id': fields.many2one('idea.category', 'Parent Categories', ondelete='set null'),
'child_ids': fields.one2many('idea.category', 'parent_id', 'Child Categories'),
- 'visibility':fields.boolean('Open Idea?', required=False),
+ 'visibility':fields.boolean('Open Idea?', required=False, help="If True creator of the idea will be visible to others"),
}
_sql_constraints = [
('name', 'unique(parent_id,name)', 'The name of the category must be unique' )
@@ -150,11 +150,10 @@ class idea_idea(osv.osv):
if int(field_value) >= 0:
vote_obj.create(cr, uid, {'idea_id': id, 'user_id': uid, 'score': textual_value })
-
_columns = {
'user_id': fields.many2one('res.users', 'Creator', required=True, readonly=True),
- 'title': fields.char('Idea Summary', size=64, required=True),
- 'description': fields.text('Description', required=True, help='Content of the idea'),
+ 'title': fields.char('Idea Summary', size=64, required=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'description': fields.text('Description', help='Content of the idea', readonly=True, states={'draft':[('readonly',False)]}),
'comment_ids': fields.one2many('idea.comment', 'idea_id', 'Comments'),
'create_date': fields.datetime('Creation date', readonly=True),
'vote_ids': fields.one2many('idea.vote', 'idea_id', 'Vote'),
@@ -162,7 +161,7 @@ class idea_idea(osv.osv):
'vote_avg': fields.function(_vote_avg_compute, method=True, string="Average Score", type="float"),
'count_votes': fields.function(_vote_count, method=True, string="Count of votes", type="integer"),
'count_comments': fields.function(_comment_count, method=True, string="Count of comments", type="integer"),
- 'category_id': fields.many2one('idea.category', 'Category', required=True),
+ 'category_id': fields.many2one('idea.category', 'Category', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'state': fields.selection([('draft', 'Draft'),
('open', 'Opened'),
('close', 'Accepted'),
@@ -204,8 +203,30 @@ class idea_idea(osv.osv):
vals.update({
'visibility':visibility
})
+
res_id = super(idea_idea, self).create(cr, user, vals, context)
return res_id
+
+ def copy(self, cr, uid, id, default={}, context={}):
+ """
+ Create the new record in idea_idea model from existing one
+ @param cr: A database cursor
+ @param user: ID of the user currently logged in
+ @param id: list of record ids on which copy method executes
+ @param default: dict type contains the values to be overridden during copy of object
+ @param context: context arguments, like lang, time zone
+
+ @return: Returns the id of the new record
+ """
+
+ default.update({
+ 'comment_ids':False,
+ 'vote_ids':False,
+ 'stat_vote_ids':False
+
+ })
+ res_id = super(idea_idea, self).copy(cr, uid, id, default, context)
+ return res_id
def write(self, cr, user, ids, vals, context=None):
"""
diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml
index b268a64d991..88c48656b5e 100644
--- a/addons/idea/idea_view.xml
+++ b/addons/idea/idea_view.xml
@@ -133,28 +133,40 @@
@@ -91,10 +91,10 @@
form
diff --git a/addons/sale_journal/sale_journal_view.xml b/addons/sale_journal/sale_journal_view.xml
index a1989da389f..c1e415b8833 100644
--- a/addons/sale_journal/sale_journal_view.xml
+++ b/addons/sale_journal/sale_journal_view.xml
@@ -42,12 +42,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
@@ -83,10 +83,10 @@
tree
-
-
-
-
+
+
+
+
@@ -101,10 +101,10 @@
-
-
-
-
+
+
+
+
@@ -285,9 +285,9 @@
form
diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py
index 20e0d30d8fb..ec7ce1c6cee 100644
--- a/addons/stock/__openerp__.py
+++ b/addons/stock/__openerp__.py
@@ -68,7 +68,7 @@ Thanks to the double entry management, the inventory controlling is powerful and
"security/stock_security.xml",
"security/ir.model.access.csv",
],
- 'demo_xml': ['stock_demo.xml'],
+ 'test': ['test/stock_test.yml'],
'installable': True,
'active': False,
'certificate': '0055421559965',
diff --git a/addons/stock/i18n/fr.po b/addons/stock/i18n/fr.po
index 9d0c7b40248..6b82ef00f96 100644
--- a/addons/stock/i18n/fr.po
+++ b/addons/stock/i18n/fr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-03-25 14:13+0000\n"
-"Last-Translator: Numérigraphe \n"
+"PO-Revision-Date: 2010-05-20 06:22+0000\n"
+"Last-Translator: Olivier (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-04-17 03:56+0000\n"
+"X-Launchpad-Export-Date: 2010-05-21 03:37+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock
@@ -677,7 +677,7 @@ msgstr "Date d'envoi prévue"
#. module: stock
#: rml:stock.picking.list:0
msgid "Shipping Address :"
-msgstr ""
+msgstr "Adresse de livraison"
#. module: stock
#: view:stock.tracking:0
@@ -1703,7 +1703,7 @@ msgstr "Magasin"
#: selection:stock.move,state:0
#: selection:stock.picking,state:0
msgid "Done"
-msgstr "Terminer"
+msgstr "Terminé"
#. module: stock
#: model:stock.location,name:stock.stock_location_locations_virtual
diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml
index 46f4ca6e8e2..02c60968e04 100644
--- a/addons/stock/product_view.xml
+++ b/addons/stock/product_view.xml
@@ -8,8 +8,8 @@
search
-
-
+
+
diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py
index b5388b336e6..8d905a4c4d7 100755
--- a/addons/stock/report/report_stock_move.py
+++ b/addons/stock/report/report_stock_move.py
@@ -28,35 +28,48 @@ class report_stock_move(osv.osv):
_description = "Stock Statistics"
_auto = False
_columns = {
- 'date': fields.date('Date', readonly=True),
+ 'date_planned': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
+ 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
- 'location_id':fields.many2one('stock.location', 'Location', readonly=True),
+ 'location_id': fields.many2one('stock.location', 'Source Location', readonly=True, select=True, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
+ 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', readonly=True, select=True, help="Location where the system will stock the finished products."),
'product_qty':fields.integer('Qty',readonly=True),
+ 'value' : fields.float('Total Value', required=True),
+ 'product_uom': fields.many2one('product.uom', 'Product UOM', readonly=True),
'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True,
help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\
\nThe state is \'Waiting\' if the move is waiting for another one.'),
-
+ 'day_diff':fields.integer('Expected Performance',readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_stock_move')
cr.execute("""
create or replace view report_stock_move as (
- select min(m.id) as id,
- m.date as date,
- to_char(date_trunc('day',m.date), 'YYYY') as year,
- to_char(date_trunc('day',m.date), 'MM') as month,
- to_char(date_trunc('day',m.date), 'YYYY-MM-DD') as day,
- m.location_id as location_id,
- m.product_id as product_id,
- m.state as state,
- sum(m.product_qty) as product_qty
- from stock_move as m group by m.product_id, m.location_id, m.id, m.date, m.state
- )
+ select min(m.id) as id,
+ m.date_planned as date_planned,
+ to_char(date_trunc('day',m.date_planned), 'YYYY') as year,
+ to_char(date_trunc('day',m.date_planned), 'MM') as month,
+ to_char(date_trunc('day',m.date_planned), 'YYYY-MM-DD') as day,
+ (date(m.date_planned)-date(m.date_expected)) as day_diff,
+ m.address_id as partner_id,
+ m.location_id as location_id,
+ m.location_dest_id as location_dest_id,
+ m.product_id as product_id,
+ m.state as state,
+ m.product_uom as product_uom,
+ sum(m.product_qty) as product_qty,
+ pt.standard_price * sum(m.product_qty) as value
+ from stock_move m ,product_product pp,product_template pt
+ where
+ m.product_id=pp.id and pp.product_tmpl_id=pt.id
+ group by
+ m.id, m.product_id,m.address_id, m.location_id, m.location_dest_id,
+ m.date_planned, m.state, m.product_uom,pt.standard_price,m.date_expected )
""")
report_stock_move()
diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml
index 79657da0fc7..3a7b233504a 100755
--- a/addons/stock/report/report_stock_move_view.xml
+++ b/addons/stock/report/report_stock_move_view.xml
@@ -7,14 +7,20 @@
tree
-
+
+
+
+
+
-
+
+
+
@@ -43,13 +49,14 @@
domain="[('year','=',time.strftime('%%Y'))]"
help="Stock Moves of the year"/>
@@ -64,22 +71,35 @@
help = "Available Stock-Moves"/>
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
+
+
+
+
+
-
+
@@ -92,7 +112,7 @@
form
tree,graph
-
+ {'search_default_product':1, 'search_default_src_location':1,'search_default_done':1,'group_by':[]}
| |