From 304605a8ce49e60c317fbff4ca042d3d132cdeda Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Tue, 12 Oct 2010 17:02:28 +0530 Subject: [PATCH 01/44] [FIX] sale : navigation to associated picking from sale lp bug: https://launchpad.net/bugs/653948 fixed bzr revid: jma@tinyerp.com-20101012113228-qln7mzb4y6a6fki1 --- addons/sale/stock_view.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/addons/sale/stock_view.xml b/addons/sale/stock_view.xml index 6b3c0e2c684..73a289af503 100644 --- a/addons/sale/stock_view.xml +++ b/addons/sale/stock_view.xml @@ -13,6 +13,29 @@ + + + + + tree + + + + + + form + + + + + + From 110e5ac904c3c5bc337eebd68ef553eadc32fa63 Mon Sep 17 00:00:00 2001 From: "JMA (OpenERP)" Date: Tue, 12 Oct 2010 18:16:16 +0530 Subject: [PATCH 02/44] [FIX] sale : Corrections bzr revid: jma@tinyerp.com-20101012124616-ab7ia1hc0n5vzdqa --- addons/sale/stock_view.xml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/addons/sale/stock_view.xml b/addons/sale/stock_view.xml index 2739c8dfdfc..dddcad07932 100644 --- a/addons/sale/stock_view.xml +++ b/addons/sale/stock_view.xml @@ -13,8 +13,6 @@ -<<<<<<< TREE -======= stock.move.form stock.move @@ -27,7 +25,6 @@ ->>>>>>> MERGE-SOURCE -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE tree -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE form -<<<<<<< TREE - -======= ->>>>>>> MERGE-SOURCE -<<<<<<< TREE - - -======= ->>>>>>> MERGE-SOURCE From 7c63402f9259ac9681e9886f38c8df81ab9b3e3f Mon Sep 17 00:00:00 2001 From: "RME (OpenERP)" Date: Wed, 13 Oct 2010 16:58:27 +0530 Subject: [PATCH 03/44] [FIX] account voucher : correction - form view not open bzr revid: rme@tinyerp.com-20101013112827-p6smqsai4sk7bzsz --- addons/account_voucher/voucher_payment_receipt_view.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 8169cac31e3..cf3f75c1d49 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -181,9 +181,6 @@ -
-
From 39574b1d41661dbd05b3b4fc63acfd3177fe7300 Mon Sep 17 00:00:00 2001 From: cpa-openerp Date: Fri, 15 Oct 2010 15:46:26 +0530 Subject: [PATCH 04/44] [IMP] Piratepad web addons. bzr revid: cpa@tinyerp.com-20101015101626-e23fxuyvzwsx9ao2 --- addons/piratepad/__init__.py | 2 ++ addons/piratepad/__openerp__.py | 8 +++++ addons/piratepad/controllers.py | 22 ++++++++++++++ addons/piratepad/editors.py | 54 +++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 addons/piratepad/__init__.py create mode 100644 addons/piratepad/__openerp__.py create mode 100644 addons/piratepad/controllers.py create mode 100644 addons/piratepad/editors.py diff --git a/addons/piratepad/__init__.py b/addons/piratepad/__init__.py new file mode 100644 index 00000000000..95542e91e3e --- /dev/null +++ b/addons/piratepad/__init__.py @@ -0,0 +1,2 @@ +import controllers +import editors diff --git a/addons/piratepad/__openerp__.py b/addons/piratepad/__openerp__.py new file mode 100644 index 00000000000..05e707b0581 --- /dev/null +++ b/addons/piratepad/__openerp__.py @@ -0,0 +1,8 @@ +{ + "name" : "Piratepad Controller methods", + "version" : "1.0", + "depends" : ["openerp"], + "author" : "Tiny", + "website": 'http://www.openerp.com/', + "active": True, +} diff --git a/addons/piratepad/controllers.py b/addons/piratepad/controllers.py new file mode 100644 index 00000000000..290cfc2953b --- /dev/null +++ b/addons/piratepad/controllers.py @@ -0,0 +1,22 @@ +from openobject.tools import expose +from openerp.controllers import form +from openerp.utils import rpc, common, TinyDict +import cherrypy + +class Form(form.Form): + _cp_path = "/piratepad/form" + + @expose('json', methods=('POST',)) + def save(self, **kwargs): + params, data = TinyDict.split(cherrypy.session['params']) + pad_name=kwargs.get('pad_name') + ctx = dict(rpc.session.context, + default_res_model=params.model, default_res_id=params.id, + active_id=False, active_ids=[]) + + pad_link = "http://piratepad.net/"+'-'.join(pad_name.split()) + attachment_id = rpc.RPCProxy('ir.attachment').create({ + 'name': pad_name, + 'url': pad_link, + }, ctx) + return {'id': attachment_id, 'name': pad_name, 'url': pad_link} \ No newline at end of file diff --git a/addons/piratepad/editors.py b/addons/piratepad/editors.py new file mode 100644 index 00000000000..a70dc6aa429 --- /dev/null +++ b/addons/piratepad/editors.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- + +from openobject.widgets import JSLink +import openobject.templating + +class SidebarTemplateEditor(openobject.templating.TemplateEditor): + templates = ['/openerp/widgets/templates/sidebar.mako'] + SIDEBAR_START = u'
' + + def edit(self, template, template_text): + output = super(SidebarTemplateEditor, self).edit(template, template_text) + + insertion_point = output.index(self.SIDEBAR_START) + len(self.SIDEBAR_START) + return output[:insertion_point] + ''' + +
+ + + + + + +
+ + + ${_("Ok")} +
+
+ ''' + output[insertion_point:] From eb40acb2db63421bcd4f02a841d13687dc7003f4 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 20 Oct 2010 13:32:53 +0530 Subject: [PATCH 05/44] [FIX] document_webdav: add detail of configuration parameter in module description lp bug: https://launchpad.net/bugs/511394 fixed bzr revid: hmo@tinyerp.com-20101020080253-yrc61hljix0r77j3 --- addons/document_webdav/__openerp__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/document_webdav/__openerp__.py b/addons/document_webdav/__openerp__.py index 1c2e232e914..e6b8cfd3f94 100644 --- a/addons/document_webdav/__openerp__.py +++ b/addons/document_webdav/__openerp__.py @@ -38,6 +38,17 @@ You can then use any compatible browser to remotely see the attachments of OpenObject. After installation, the webDAV server can be controlled by a [webdav] section in the server's config. + Server Configuration Parameter: + [webdav] + ; enable = True ; Serve webdav over the http(s) servers + ; vdir = webdav ; the directory that webdav will be served at + ; this default val means that webdav will be + ; on "http://localhost:8069/webdav/ + ; verbose = True ; Turn on the verbose messages of webdav + ; debug = True ; Turn on the debugging messages of webdav + ; since the messages are routed to the python logging, with + ; levels "debug" and "debug_rpc" respectively, you can leave + ; these options on """, "depends" : ["base", "document"], "init_xml" : [], From e1d066b76808818e38db2c930d4b3d27324a6de0 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Wed, 20 Oct 2010 10:55:45 +0200 Subject: [PATCH 06/44] [FIX] event: invalid view: duplicate field 'user_id' bzr revid: olt@tinyerp.com-20101020085545-i8bltbsm5rq4jqiw --- addons/event/event_view.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 918147b79cb..6fc620abdf8 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -171,7 +171,6 @@ - From 29b353d5d211b9dd253c4064207be9e16638aff5 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 20 Oct 2010 16:28:16 +0530 Subject: [PATCH 07/44] [FIX] mrp: regression: production orders moves are wrongly done from 'Stock' to 'Stock' lp bug: https://launchpad.net/bugs/622948 fixed bzr revid: hmo@tinyerp.com-20101020105816-08af1r7unnxcagv0 --- addons/mrp/mrp.py | 2 +- addons/stock/stock.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index d0402708f5f..12014f0fad8 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -745,7 +745,7 @@ class mrp_production(osv.osv): if rest_qty <= production_qty: production_qty = rest_qty if rest_qty > 0 : - stock_mov_obj.action_consume(cr, uid, [produce_product.id], production_qty, production.location_dest_id.id, context=context) + stock_mov_obj.action_consume(cr, uid, [produce_product.id], production_qty, context=context) for raw_product in production.move_lines2: new_parent_ids = [] diff --git a/addons/stock/stock.py b/addons/stock/stock.py index f6c5f1de554..fe984b10f22 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2215,7 +2215,7 @@ class stock_move(osv.osv): 'product_qty': quantity, 'product_uos_qty': uos_qty, 'state': move.state, - 'location_id': location_id + 'location_id': location_id or move.location_id.id, } if move.product_id.track_production and location_id: # IF product has checked track for production lot, move lines will be split by 1 @@ -2238,9 +2238,8 @@ class stock_move(osv.osv): update_val = { 'product_qty' : quantity_rest, 'product_uos_qty' : uos_qty_rest, - 'location_id': location_id + 'location_id': location_id or move.location_id.id } - self.write(cr, uid, [move.id], update_val) product_obj = self.pool.get('product.product') From 44ca7b0225427978929b5a3963b4c9797a8aa571 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 20 Oct 2010 13:59:30 +0200 Subject: [PATCH 08/44] [ADD] piratepad extension from web-piratepad branch * Removed modifications to openerp itself * Fixed code a bit to avoid breakages (due to e.g. openerp pad-specific modifications removed from the merge) bzr revid: xmo@openerp.com-20101020115930-cwzs2jlb2t2a2k7s --- addons/piratepad/controllers.py | 4 +-- addons/piratepad/editors.py | 53 ++++++++++++++++----------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/addons/piratepad/controllers.py b/addons/piratepad/controllers.py index 290cfc2953b..f8a0982a372 100644 --- a/addons/piratepad/controllers.py +++ b/addons/piratepad/controllers.py @@ -13,10 +13,10 @@ class Form(form.Form): ctx = dict(rpc.session.context, default_res_model=params.model, default_res_id=params.id, active_id=False, active_ids=[]) - + pad_link = "http://piratepad.net/"+'-'.join(pad_name.split()) attachment_id = rpc.RPCProxy('ir.attachment').create({ 'name': pad_name, 'url': pad_link, }, ctx) - return {'id': attachment_id, 'name': pad_name, 'url': pad_link} \ No newline at end of file + return {'id': attachment_id, 'name': pad_name, 'url': pad_link} diff --git a/addons/piratepad/editors.py b/addons/piratepad/editors.py index a70dc6aa429..83b80a0dba9 100644 --- a/addons/piratepad/editors.py +++ b/addons/piratepad/editors.py @@ -5,38 +5,13 @@ import openobject.templating class SidebarTemplateEditor(openobject.templating.TemplateEditor): templates = ['/openerp/widgets/templates/sidebar.mako'] - SIDEBAR_START = u'
' + BINARY_ATTACHMENTS_FORM = u'
- jQuery(document).ready(function() { - - var padForm = jQuery('#pad-box').hide(); - - jQuery('#sidebar-attachments').append( - jQuery('',{ - 'href': '#', - 'id': 'add-pad', - 'class': 'button-a', - }).text('${_("Pad")}') - ); - jQuery('#sidebar_pad_ok').bind('click', function(){ - padForm.submit(); - }); - jQuery('#add-pad').click(function(e){ - padForm.show(); - e.preventDefault(); - }); - padForm.bind({ - submit: createAttachment - }); - }); - - @@ -51,4 +26,28 @@ class SidebarTemplateEditor(openobject.templating.TemplateEditor):
+ ''' + output[insertion_point:] From 54563933a265a7c70adce3996d0a31eb9c915203 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 20 Oct 2010 14:09:17 +0200 Subject: [PATCH 09/44] [IMP] Use kwarg normally in piratepad.controllers.Form bzr revid: xmo@openerp.com-20101020120917-flvi1ez9p0272axm --- addons/piratepad/controllers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/piratepad/controllers.py b/addons/piratepad/controllers.py index f8a0982a372..8bc55d88f19 100644 --- a/addons/piratepad/controllers.py +++ b/addons/piratepad/controllers.py @@ -1,15 +1,14 @@ from openobject.tools import expose from openerp.controllers import form -from openerp.utils import rpc, common, TinyDict +from openerp.utils import rpc, TinyDict import cherrypy class Form(form.Form): _cp_path = "/piratepad/form" @expose('json', methods=('POST',)) - def save(self, **kwargs): + def save(self, pad_name): params, data = TinyDict.split(cherrypy.session['params']) - pad_name=kwargs.get('pad_name') ctx = dict(rpc.session.context, default_res_model=params.model, default_res_id=params.id, active_id=False, active_ids=[]) From dd572f0c73b17248d9a526284e931f892264cb96 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 20 Oct 2010 14:14:05 +0200 Subject: [PATCH 10/44] [IMP] Make piratepad controller not inherit from openerp.controllers.form.Form (there is no reason to), remove /form section of URL (no need for it), fix naming of class and method bzr revid: xmo@openerp.com-20101020121405-u5g3450aen0vaapr --- addons/piratepad/controllers.py | 14 ++++++++------ addons/piratepad/editors.py | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/addons/piratepad/controllers.py b/addons/piratepad/controllers.py index 8bc55d88f19..3b30257f9a1 100644 --- a/addons/piratepad/controllers.py +++ b/addons/piratepad/controllers.py @@ -1,13 +1,15 @@ -from openobject.tools import expose -from openerp.controllers import form -from openerp.utils import rpc, TinyDict import cherrypy -class Form(form.Form): - _cp_path = "/piratepad/form" +from openobject.tools import expose + +import openerp.controllers +from openerp.utils import rpc, TinyDict + +class Piratepad(openerp.controllers.SecuredController): + _cp_path = "/piratepad" @expose('json', methods=('POST',)) - def save(self, pad_name): + def link(self, pad_name): params, data = TinyDict.split(cherrypy.session['params']) ctx = dict(rpc.session.context, default_res_model=params.model, default_res_id=params.id, diff --git a/addons/piratepad/editors.py b/addons/piratepad/editors.py index 83b80a0dba9..d1ca9c22bc9 100644 --- a/addons/piratepad/editors.py +++ b/addons/piratepad/editors.py @@ -12,7 +12,7 @@ class SidebarTemplateEditor(openobject.templating.TemplateEditor): insertion_point = output.index(self.BINARY_ATTACHMENTS_FORM) return output[:insertion_point] + ''' -
+ From a3e79c6d496902b4d41085d42e9d8d6b35ffb080 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 20 Oct 2010 14:25:28 +0200 Subject: [PATCH 11/44] [IMP] extract creation of pad URL into separate methods for overriding/configuration in the future bzr revid: xmo@openerp.com-20101020122528-z194x6jz1zvg1lwc --- addons/piratepad/controllers.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/piratepad/controllers.py b/addons/piratepad/controllers.py index 3b30257f9a1..b0940f94369 100644 --- a/addons/piratepad/controllers.py +++ b/addons/piratepad/controllers.py @@ -5,9 +5,16 @@ from openobject.tools import expose import openerp.controllers from openerp.utils import rpc, TinyDict +PIRATEPAD_ROOT = "http://piratepad.net/" class Piratepad(openerp.controllers.SecuredController): _cp_path = "/piratepad" + def get_root(self): + return PIRATEPAD_ROOT + + def make_url(self, pad_name): + return self.get_root() + '-'.join(pad_name.split()) + @expose('json', methods=('POST',)) def link(self, pad_name): params, data = TinyDict.split(cherrypy.session['params']) @@ -15,7 +22,7 @@ class Piratepad(openerp.controllers.SecuredController): default_res_model=params.model, default_res_id=params.id, active_id=False, active_ids=[]) - pad_link = "http://piratepad.net/"+'-'.join(pad_name.split()) + pad_link = self.make_url(pad_name) attachment_id = rpc.RPCProxy('ir.attachment').create({ 'name': pad_name, 'url': pad_link, From 863a0c00c6fd00d06e8d62d35506d9faae42e8d8 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 20 Oct 2010 14:41:33 +0200 Subject: [PATCH 12/44] [IMP] use templates manipulation to add the link to open the pad form, rather than using JS bzr revid: xmo@openerp.com-20101020124133-36olqe3hp1e1xp3t --- addons/piratepad/editors.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/addons/piratepad/editors.py b/addons/piratepad/editors.py index d1ca9c22bc9..e224243b2a8 100644 --- a/addons/piratepad/editors.py +++ b/addons/piratepad/editors.py @@ -5,13 +5,27 @@ import openobject.templating class SidebarTemplateEditor(openobject.templating.TemplateEditor): templates = ['/openerp/widgets/templates/sidebar.mako'] + ADD_ATTACHMENT_BUTTON = u'id="add-attachment"' BINARY_ATTACHMENTS_FORM = u'${_("Pad")}\n' + \ + output[form_opener_insertion:] + return output + def edit(self, template, template_text): output = super(SidebarTemplateEditor, self).edit(template, template_text) - insertion_point = output.index(self.BINARY_ATTACHMENTS_FORM) - return output[:insertion_point] + ''' + output = self.insert_pad_link(output) + + form_insertion_point = output.index(self.BINARY_ATTACHMENTS_FORM) + return output[:form_insertion_point] + '''
@@ -28,16 +42,7 @@ class SidebarTemplateEditor(openobject.templating.TemplateEditor): - ''' + output[insertion_point:] + ''' + output[form_insertion_point:] From 874c9fc845190b18ea0f48a6c34c26cb70d4e53c Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 20 Oct 2010 14:41:53 +0200 Subject: [PATCH 13/44] [REM] unused import bzr revid: xmo@openerp.com-20101020124153-3kh6jy6023tcsdcm --- addons/piratepad/editors.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/piratepad/editors.py b/addons/piratepad/editors.py index e224243b2a8..c229a924da1 100644 --- a/addons/piratepad/editors.py +++ b/addons/piratepad/editors.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- - -from openobject.widgets import JSLink import openobject.templating class SidebarTemplateEditor(openobject.templating.TemplateEditor): From 377af37434e6bcbe0c7a900064e630cee2dda731 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 20 Oct 2010 14:44:50 +0200 Subject: [PATCH 14/44] [IMP] Style of JS inserted for handling of the pad-creation form: naming conventions, usage of event shortcuts bzr revid: xmo@openerp.com-20101020124450-ctvqik4ukqizwfsc --- addons/piratepad/editors.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/addons/piratepad/editors.py b/addons/piratepad/editors.py index c229a924da1..39df35f5ecf 100644 --- a/addons/piratepad/editors.py +++ b/addons/piratepad/editors.py @@ -24,7 +24,7 @@ class SidebarTemplateEditor(openobject.templating.TemplateEditor): form_insertion_point = output.index(self.BINARY_ATTACHMENTS_FORM) return output[:form_insertion_point] + ''' -
+
@@ -40,17 +40,16 @@ class SidebarTemplateEditor(openobject.templating.TemplateEditor): ''' + output[form_insertion_point:] From 91fc2a2c3c004e8f10b36d0dafb255e260c45d12 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 20 Oct 2010 14:47:32 +0200 Subject: [PATCH 15/44] [IMP] use button element in pad-creation form, avoids need for a bunch of JS to transform a link-click into a form submission Also remove a bunch of unneeded attributes on the pad-name input bzr revid: xmo@openerp.com-20101020124732-2dovbi82ht7hyiyi --- addons/piratepad/editors.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/addons/piratepad/editors.py b/addons/piratepad/editors.py index 39df35f5ecf..dd3623f464c 100644 --- a/addons/piratepad/editors.py +++ b/addons/piratepad/editors.py @@ -29,11 +29,11 @@ class SidebarTemplateEditor(openobject.templating.TemplateEditor):
- + - ${_("Ok")} +
@@ -43,9 +43,6 @@ class SidebarTemplateEditor(openobject.templating.TemplateEditor): var $padForm = jQuery('#pad-form') .hide() .submit(createAttachment); - jQuery('#sidebar_pad_ok').click(function(){ - $padForm.submit(); - }); jQuery('#add-pad').click(function(e){ $padForm.show(); e.preventDefault(); From fae0a9ccd4c10d38489403911598fe875b1e8b77 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 20 Oct 2010 14:53:24 +0200 Subject: [PATCH 16/44] [FIX] position of the inserted pad-form-revealing button bzr revid: xmo@openerp.com-20101020125324-7bmz5an1jgvvuna6 --- addons/piratepad/editors.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/piratepad/editors.py b/addons/piratepad/editors.py index dd3623f464c..eb1e6ccdf77 100644 --- a/addons/piratepad/editors.py +++ b/addons/piratepad/editors.py @@ -13,7 +13,9 @@ class SidebarTemplateEditor(openobject.templating.TemplateEditor): '\n', output.index(self.ADD_ATTACHMENT_BUTTON)) + 1 output = output[:form_opener_insertion] + \ - '
${_("Pad")}\n' + \ + '''${_("Pad")}\n''' + \ output[form_opener_insertion:] return output From 9475077629755339394a61202454fc340cc48478 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 20 Oct 2010 18:32:12 +0530 Subject: [PATCH 17/44] [FIX] mrp: many2many and one2many field support domain. so removed many2many_domain,one2many_dommain in mrp.py lp bug: https://launchpad.net/bugs/663003 fixed bzr revid: hmo@tinyerp.com-20101020130212-j1373iyv4e6ysftg --- addons/mrp/mrp.py | 50 ++++------------------------------------------- 1 file changed, 4 insertions(+), 46 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 12014f0fad8..cee60e63023 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -350,48 +350,6 @@ def rounding(f, r): return f return round(f / r) * r -class many2many_domain(fields.many2many): - def set(self, cr, obj, id, name, values, user=None, context=None): - return super(many2many_domain, self).set(cr, obj, id, name, values, user=user, - context=context) - - def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): - if not context: - context = {} - - move_obj = obj.pool.get('stock.move') - res = {} - for i in ids: - res[i] = [] - valid_move_ids = move_obj.search(cr, user, self._domain) # move ids relative to domain argument - if valid_move_ids: - cr.execute("SELECT production_id, move_id from mrp_production_move_ids where production_id in %s and move_id in %s", - [tuple(ids), tuple(valid_move_ids)]) - related_move_map = cr.fetchall() - related_move_dict = dict((k, list(set([v[1] for v in itr]))) for k, itr in groupby(related_move_map, itemgetter(0))) - res.update(related_move_dict) - - return res - -class one2many_domain(fields.one2many): - def set(self, cr, obj, id, field, values, user=None, context=None): - 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 not context: - context = {} - - move_obj = obj.pool.get('stock.move') - res = {} - for i in ids: - res[i] = [] - move_ids = move_obj.search(cr, user, self._domain+[('production_id', 'in', tuple(ids))], context=context) - related_move_dict = dict([(o.production_id.id, [o.id]) for o in move_obj.browse(cr, user, move_ids, context=context)]) - res.update(related_move_dict) - - return res - class mrp_production(osv.osv): """ Production Orders / Manufacturing Orders @@ -467,10 +425,10 @@ class mrp_production(osv.osv): 'picking_id': fields.many2one('stock.picking', 'Picking list', readonly=True, help="This is the internal picking list that brings the finished product to the production plan"), 'move_prod_id': fields.many2one('stock.move', 'Move product', readonly=True), - 'move_lines': many2many_domain('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Products to Consume', domain=[('state','not in', ('done', 'cancel'))], states={'done':[('readonly',True)]}), - 'move_lines2': many2many_domain('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Consumed Products', domain=[('state','in', ('done', 'cancel'))]), - 'move_created_ids': one2many_domain('stock.move', 'production_id', 'Moves Created', domain=[('state','not in', ('done', 'cancel'))], states={'done':[('readonly',True)]}), - 'move_created_ids2': one2many_domain('stock.move', 'production_id', 'Moves Created', domain=[('state','in', ('done', 'cancel'))]), + 'move_lines': fields.many2many('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Products to Consume', domain=[('state','not in', ('done', 'cancel'))], states={'done':[('readonly',True)]}), + 'move_lines2': fields.many2many('stock.move', 'mrp_production_move_ids', 'production_id', 'move_id', 'Consumed Products', domain=[('state','in', ('done', 'cancel'))]), + 'move_created_ids': fields.one2many('stock.move', 'production_id', 'Moves Created', domain=[('state','not in', ('done', 'cancel'))], states={'done':[('readonly',True)]}), + 'move_created_ids2': fields.one2many('stock.move', 'production_id', 'Moves Created', domain=[('state','in', ('done', 'cancel'))]), 'product_lines': fields.one2many('mrp.production.product.line', 'production_id', 'Scheduled goods'), 'workcenter_lines': fields.one2many('mrp.production.workcenter.line', 'production_id', 'Work Centers Utilisation'), 'state': fields.selection([('draft','Draft'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Cancelled'),('done','Done')],'State', readonly=True, From c7d50354fb880f01092be16ff8a99b66d97e89d5 Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Wed, 20 Oct 2010 18:59:48 +0530 Subject: [PATCH 18/44] [FIX] hr_timesheet_sheet : date_from and date_to problem, hr_evaluation : date deadline problem fixed bzr revid: vir@tinyerp.com-20101020132948-1ax61wd33j1ejj18 --- addons/hr_evaluation/hr_evaluation.py | 2 +- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 2 +- addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 3c5a150691e..4d8ef9d440f 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -124,7 +124,7 @@ class hr_employee(osv.osv): flag = False evaluation_plan = evaluation_plan_obj.browse(cr, uid, [evaluation_plan_id], context=context)[0] if not evaluation_date: - evaluation_date=(parser.parse(datetime.date.today().strftime('%Y-%m-%d'))+ relativedelta(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d') + evaluation_date=(parser.parse(datetime.now().strftime('%Y-%m-%d'))+ relativedelta(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d') flag = True else: if (parser.parse(evaluation_date) + relativedelta(months = int(evaluation_plan.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"): diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index b152e0112eb..6411bae7bc0 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -319,7 +319,7 @@ class hr_timesheet_sheet(osv.osv): if r=='month': return time.strftime('%Y-%m-01') elif r=='week': - return (datetime.today() + relativedelta(weekday=0)).strftime('%Y-%m-%d') + return (datetime.today() + relativedelta(weekday=0, weeks=-1)).strftime('%Y-%m-%d') elif r=='year': return time.strftime('%Y-01-01') return time.strftime('%Y-%m-%d') diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml index dedac8377a7..a4b4b434da6 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_demo.xml @@ -10,11 +10,12 @@ - + From 358d1b2fe187664423e38bf6391f1de7fed77ac3 Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Wed, 20 Oct 2010 19:10:08 +0530 Subject: [PATCH 19/44] [FIX] Account : Usability bzr revid: jvo@tinyerp.com-20101020134008-bq2gce4sjbkp6i3z --- addons/account/wizard/account_validate_move_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/wizard/account_validate_move_view.xml b/addons/account/wizard/account_validate_move_view.xml index 352d23d6b53..d4184dd9c8b 100644 --- a/addons/account/wizard/account_validate_move_view.xml +++ b/addons/account/wizard/account_validate_move_view.xml @@ -10,7 +10,7 @@
-