From 9ed5d05cc03f6f6711e3ec14a29fec84e8e354c1 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 11 Jun 2010 15:43:55 +0200 Subject: [PATCH 01/37] [REF] mail_gateway: Remove the duplicated import bzr revid: stephane@openerp.com-20100611134355-2ku851kddw72p4g1 --- addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py b/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py index 95543fcb7f6..c4cad98b046 100755 --- a/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py +++ b/addons/mail_gateway/scripts/openerp_mailgate/openerp_mailgate.py @@ -164,7 +164,6 @@ class email_parser(object): return s.decode('latin1') def _decode_header(self, text): - from email.Header import decode_header if text: text = decode_header(text.replace('\r', '')) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), text or [])) From 43ccf2f7743d55cd01acd4aba62fdb415e4b0fef Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 11 Jun 2010 16:26:31 +0200 Subject: [PATCH 02/37] fix bzr revid: fp@tinyerp.com-20100611142631-8njuqup1ugudbb3w --- addons/account/account_view.xml | 2 +- addons/account/partner_view.xml | 26 +++++++------------- addons/document/document_view.xml | 2 +- addons/purchase/purchase.py | 2 +- addons/purchase/purchase_view.xml | 2 +- addons/purchase/security/ir.model.access.csv | 3 +++ 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index b18e3e2f609..2fdb2c5fd07 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1519,7 +1519,7 @@ res_model="account.addtmpl.wizard" context="{'tmpl_ids': active_id}" src_model="account.account.template" - view_type="form" view_mode="form"/> + view_type="form" view_mode="form"/> - @@ -126,21 +125,14 @@ - - res.partner.account.info.inherit - res.partner - form - - - - - - - - - - - - + + diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index b1fa9a510c9..aa37b4472ad 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -3,7 +3,7 @@ - + diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 08507f9dfac..87f4c3031bb 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -633,7 +633,7 @@ class purchase_order_line(osv.osv): prod= self.pool.get('product.product').browse(cr, uid,product) lang=False if partner_id: - lang=self.pool.get('res.partner').read(cr, uid, partner_id)['lang'] + lang=self.pool.get('res.partner').read(cr, uid, partner_id, ['lang'])['lang'] context={'lang':lang} context['partner_id'] = partner_id diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 502c33bd5f9..d5050c69b18 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -3,7 +3,7 @@ - diff --git a/addons/purchase/security/ir.model.access.csv b/addons/purchase/security/ir.model.access.csv index 9b0f8bc184e..f5ac86559cc 100644 --- a/addons/purchase/security/ir.model.access.csv +++ b/addons/purchase/security/ir.model.access.csv @@ -17,3 +17,6 @@ "access_stock_picking_purchase_user_manager","stock.picking","stock.model_stock_picking","purchase.group_purchase_manager",1,1,1,1 "access_stock_move_purchase_user_manager","stock.move","stock.model_stock_move","purchase.group_purchase_manager",1,1,1,1 "access_account_tax_purchase_user_manager","account.tax","account.model_account_tax","purchase.group_purchase_manager",1,0,0,0 +"access_product_product_purchase_user","product.product.purchase.user","product.model_product_product","group_purchase_user",1,0,0,0 +"access_account_invoice_purchase","account_invoice purchase","account.model_account_invoice","group_purchase_user",1,1,1,1 +"access_account_invoice_line_purchase","account_invoice.line purchase","account.model_account_invoice_line","group_purchase_user",1,1,1,1 From caca420c82a6aaac1b462bbe0e7c8639a5b850f5 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 11 Jun 2010 17:53:51 +0200 Subject: [PATCH 03/37] [REF] Use the domain on the one2many fields instead of a custom class to manage this case bzr revid: stephane@openerp.com-20100611155351-i9r1lqml8xvvtlui --- addons/mail_gateway/mail_gateway.py | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index c19f1767fa6..c9a264b1d9d 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -21,26 +21,8 @@ from osv import osv, fields import time -import base64 +import base64 -class one2many_domain(fields.one2many): - def set(self, cr, obj, id, field, values, user=None, context=None): - if not values: - return - return super(one2many_domain, self).set(cr, obj, id, field, values, - user=user, context=context) - - def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): - if context is None: - context = {} - res = {} - msg_obj = obj.pool.get('mailgate.message') - for thread in obj.browse(cr, user, ids, context=context): - final = msg_obj.search(cr, user, self._domain + [('thread_id', '=', thread.id)], context=context) - res[thread.id] = final - return res - - class mailgate_thread(osv.osv): ''' Mailgateway Thread @@ -51,11 +33,11 @@ class mailgate_thread(osv.osv): _columns = { 'thread': fields.char('Thread', size=32, required=False), - 'message_ids': one2many_domain('mailgate.message', 'thread_id', 'Messages', domain=[('history', '=', True)], required=False), - 'log_ids': one2many_domain('mailgate.message', 'thread_id', 'Logs', domain=[('history', '=', False)], required=False), + 'message_ids': fields.one2many('mailgate.message', 'thread_id', 'Messages', domain=[('history', '=', True)], required=False), + 'log_ids': fields.one2many('mailgate.message', 'thread_id', 'Logs', domain=[('history', '=', False)], required=False), } - def __history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=None, context=None): + def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=None, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @@ -118,8 +100,7 @@ class mailgate_thread(osv.osv): res = obj.create(cr, uid, data, context) return True - _history = __history - history = __history + __history = history = _history mailgate_thread() From 71be09ecc66245e050f25818e0c616a9739238e8 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sat, 12 Jun 2010 00:02:09 +0200 Subject: [PATCH 04/37] [IMP] Partners Geo Assignation - new module bzr revid: fp@tinyerp.com-20100611220209-kerfxsckm6us8yh7 --- .../wizard/account_invoice_state_view.xml | 40 +++---- addons/crm/crm_opportunity_view.xml | 24 +++- addons/partner_geo_assign/__init__.py | 22 ++++ addons/partner_geo_assign/__openerp__.py | 38 ++++++ .../partner_geo_assign/partner_geo_assign.py | 113 ++++++++++++++++++ .../partner_geo_assign/res_partner_view.xml | 45 +++++++ addons/purchase/purchase_view.xml | 51 ++++---- 7 files changed, 288 insertions(+), 45 deletions(-) create mode 100644 addons/partner_geo_assign/__init__.py create mode 100644 addons/partner_geo_assign/__openerp__.py create mode 100644 addons/partner_geo_assign/partner_geo_assign.py create mode 100644 addons/partner_geo_assign/res_partner_view.xml diff --git a/addons/account/wizard/account_invoice_state_view.xml b/addons/account/wizard/account_invoice_state_view.xml index d83c0c6f2dc..e0c22a0007f 100644 --- a/addons/account/wizard/account_invoice_state_view.xml +++ b/addons/account/wizard/account_invoice_state_view.xml @@ -1,22 +1,22 @@ - + account.invoice.confirm.form account.invoice.confirm form -
- + + -