From 20c9ba132f62ac05665b958913dfdd0a07d66c2c Mon Sep 17 00:00:00 2001 From: "Pinakin Nayi (OpenERP)" Date: Tue, 2 Apr 2013 14:07:30 +0530 Subject: [PATCH 02/16] [FIX]account_invoice:add measing feature reorder lines bzr revid: pna@tinyerp.com-20130402083730-qukgx3918bkhrtig --- addons/account/account_invoice.py | 2 +- addons/account/account_invoice_view.xml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index b4705245268..68358393135 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1404,7 +1404,7 @@ class account_invoice_line(osv.osv): else: prop = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category', context=context) return prop and prop.id or False - + _order = 'sequence' _defaults = { 'quantity': 1, 'discount': 0.0, diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 8c7cec67ac5..2a00e127ffb 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -191,6 +191,7 @@ + @@ -346,6 +347,7 @@ + From d6a678c7d560b0757f55004cc49ad68de3a5be73 Mon Sep 17 00:00:00 2001 From: Rifakat Date: Thu, 4 Apr 2013 19:24:46 +0530 Subject: [PATCH 03/16] [FIX] stock: code optimization to restric checking product's availability in all the locations, if there are thousands of locations to be checked then should only check goods in the location where this product is ever come or went bzr revid: rha@tinyerp.com-20130404135446-ln4e3n7rdibajho3 --- addons/stock/stock.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index f2258372907..2c2ac23dfa3 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -399,7 +399,16 @@ class stock_location(osv.osv): uom_rounding = self.pool.get('product.product').browse(cr, uid, product_id, context=context).uom_id.rounding if context.get('uom'): uom_rounding = uom_obj.browse(cr, uid, context.get('uom'), context=context).rounding - for id in self.search(cr, uid, [('location_id', 'child_of', ids)]): + locations_ids = self.search(cr, uid, [('location_id', 'child_of', ids)]) + #Fetch only those locations in which this product has ever processed(in or out) + cr.execute("""SELECT l.id FROM stock_location l WHERE l.id in %s AND + EXISTS (SELECT 1 FROM stock_move m WHERE m.product_id = %s + AND ((state = 'done' AND m.location_dest_id = l.id) + OR + (state in ('done','assigned') AND m.location_id = l.id))) + """, (tuple(locations_ids), product_id,)) + locations_ids = [i for i in cr.fetchall()] + for id in locations_ids: if lock: try: # Must lock with a separate select query because FOR UPDATE can't be used with From d3729c8526c307177eb1cc8ec42fa4820038aa0f Mon Sep 17 00:00:00 2001 From: "Pinakin Nayi (OpenERP)" Date: Tue, 9 Apr 2013 10:57:12 +0530 Subject: [PATCH 04/16] [IMP]survey:add missing translation bzr revid: pna@tinyerp.com-20130409052712-bxnwhj4ro2tuksk6 --- addons/survey/i18n/survey.pot | 90 +++++++++++++++++++ .../survey/report/survey_browse_response.py | 19 ++-- addons/survey/wizard/survey_answer.py | 16 ++-- 3 files changed, 108 insertions(+), 17 deletions(-) diff --git a/addons/survey/i18n/survey.pot b/addons/survey/i18n/survey.pot index cd08e9bc711..f08b9ede3c4 100644 --- a/addons/survey/i18n/survey.pot +++ b/addons/survey/i18n/survey.pot @@ -1490,6 +1490,54 @@ msgstr "" msgid "Survey Answers" msgstr "" +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:70 +#, python-format +msgid "Page : " +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:210 +#, python-format +msgid "Print Date : " +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:213 +#, python-format +msgid "Answered by : " +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:220 +#, python-format +msgid "Answer Date : " +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:225 +#, python-format +msgid "Not Finished" +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:226 +#, python-format +msgid "Finished" +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:232 +#, python-format +msgid "Status :- " +msgstr "" + +#. module: survey +#: code:addons/survey/report/survey_browse_response.py:243 +#, python-format +msgid "Page :- " +msgstr "" + #. module: survey #: model:ir.ui.menu,name:survey.menu_print_survey_answer msgid "Surveys Answers" @@ -1596,6 +1644,48 @@ msgstr "" msgid "Warning!" msgstr "" +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:392 +#, python-format +msgid "Exit" +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:376 +#, python-format +msgid "Next" +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:222 +#, python-format +msgid "Answer" +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:174 +#, python-format +msgid "Answer Of :- " +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:174 +#, python-format +msgid ", Date :- " +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:175 +#, python-format +msgid " Answer :- " +msgstr "" + +#. module: survey +#: code:addons/survey/wizard/survey_answer.py:375 +#, python-format +msgid "Previous" +msgstr "" + #. module: survey #: code:addons/survey/survey.py:465 #, python-format diff --git a/addons/survey/report/survey_browse_response.py b/addons/survey/report/survey_browse_response.py index f910140727d..54abe6e34bb 100644 --- a/addons/survey/report/survey_browse_response.py +++ b/addons/survey/report/survey_browse_response.py @@ -26,6 +26,7 @@ from openerp import pooler, tools from openerp.report import report_sxw from openerp.report.interface import report_rml from openerp.tools import to_xml +from openerp.tools.translate import _ class survey_browse_response(report_rml): def create(self, cr, uid, ids, datas, context): @@ -66,7 +67,7 @@ class survey_browse_response(report_rml): rml +=""" - Page : """ + """+_('Page : ')+""" """ rml +=""" @@ -206,29 +207,29 @@ class survey_browse_response(report_rml): resp_create = tools.ustr(time.strftime('%d-%m-%Y %I:%M:%S %p', time.strptime(response.date_create.split('.')[0], '%Y-%m-%d %H:%M:%S'))) rml += """ - Print Date : + """ + _('Print Date : ') + """ """ + to_xml(rml_obj.formatLang(time.strftime("%Y-%m-%d %H:%M:%S"),date_time=True)) + """ - Answered by : + """ +_('Answered by : ') + """ """ + to_xml(response.user_id.login or '') + """ - Answer Date : + """ +_('Answer Date : ') + """ """ + to_xml(resp_create) + """ """ - status = "Not Finished" - if response.state == "done": status = "Finished" + status = _("Not Finished") + if response.state == "done": status = _("Finished") colwidth = str(tbl_width - 7) + "cm," colwidth += "7cm" rml += """ """ + to_xml(tools.ustr(survey.title)) + """ - Status :- """ + to_xml(tools.ustr(status)) + """ + """+_('Status :- ')+ to_xml(tools.ustr(status)) + """ """ @@ -239,7 +240,7 @@ class survey_browse_response(report_rml): for page in survey.page_ids: rml += """ - Page :- """ + to_xml(tools.ustr(page.title or '')) + """ + """+_('Page :- ') + to_xml(tools.ustr(page.title or '')) + """ """ if page.note: rml += """ @@ -299,7 +300,7 @@ class survey_browse_response(report_rml): else: rml +=""" - No Answer + """+ _('No Answer') + """ """ elif que.type in ['multiple_choice_only_one_ans','multiple_choice_multiple_ans']: diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index d935eb92ade..4e7c1c57304 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -171,8 +171,8 @@ class survey_question_wiz(osv.osv_memory): # TODO: l10n, cleanup this code to make it readable. Or template? xml_group = etree.SubElement(xml_form, 'group', {'col': '40', 'colspan': '4'}) record = sur_response_obj.browse(cr, uid, context['response_id'][context['response_no']]) - etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr('Answer Of :- ' + record.user_id.name + ', Date :- ' + record.date_create.split('.')[0] )), 'align':"0.0"}) - etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(" Answer :- " + str(context.get('response_no',0) + 1) +"/" + str(len(context.get('response_id',0))) )), 'align':"0.0"}) + etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(_('Answer Of :- ') + record.user_id.name + _(', Date :- ') + record.date_create.split('.')[0] )), 'align':"0.0"}) + etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(_(" Answer :- ") + str(context.get('response_no',0) + 1) +"/" + str(len(context.get('response_id',0))) )), 'align':"0.0"}) if context.get('response_no',0) > 0: etree.SubElement(xml_group, 'button', {'colspan':"1",'icon':"gtk-go-back",'name':"action_forward_previous",'string': tools.ustr("Previous Answer"),'type':"object"}) if context.get('response_no',0) + 1 < len(context.get('response_id',0)): @@ -219,7 +219,7 @@ class survey_question_wiz(osv.osv_memory): selection.append((tools.ustr(ans.id), ans.answer)) xml_group = etree.SubElement(xml_group, 'group', {'col': '2', 'colspan': '2'}) etree.SubElement(xml_group, 'field', {'readonly':str(readonly), 'name': tools.ustr(que.id) + "_selection"}) - fields[tools.ustr(que.id) + "_selection"] = {'type':'selection', 'selection' :selection, 'string':"Answer"} + fields[tools.ustr(que.id) + "_selection"] = {'type':'selection', 'selection' :selection, 'string':_('Answer')} elif que_rec.type == 'multiple_choice_multiple_ans': xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'}) @@ -372,10 +372,10 @@ class survey_question_wiz(osv.osv_memory): if pre_button: etree.SubElement(xml_footer, 'label', {'string': ""}) - etree.SubElement(xml_footer, 'button', {'name':"action_previous",'string':"Previous",'type':"object"}) - but_string = "Next" + etree.SubElement(xml_footer, 'button', {'name':"action_previous",'string':_('Previous'),'type':"object"}) + but_string = _('Next') if int(page_number) + 1 == total_pages: - but_string = "Done" + but_string = _('Done') if context.has_key('active') and context.get('active',False) and int(page_number) + 1 == total_pages and context.has_key('response_id') and context.has_key('response_no') and context.get('response_no',0) + 1 == len(context.get('response_id',0)): etree.SubElement(xml_footer, 'label', {'string': ""}) etree.SubElement(xml_footer, 'button', {'special' : 'cancel','string': tools.ustr("Done") ,'context' : tools.ustr(context), 'class':"oe_highlight"}) @@ -388,8 +388,8 @@ class survey_question_wiz(osv.osv_memory): else: etree.SubElement(xml_footer, 'label', {'string': ""}) etree.SubElement(xml_footer, 'button', {'name':"action_next",'string': tools.ustr(but_string) ,'type':"object",'context' : tools.ustr(context), 'class':"oe_highlight"}) - etree.SubElement(xml_footer, 'label', {'string': "or"}) - etree.SubElement(xml_footer, 'button', {'special': "cancel",'string':"Exit",'class':"oe_link"}) + etree.SubElement(xml_footer, 'label', {'string': _('or')}) + etree.SubElement(xml_footer, 'button', {'special': "cancel",'string':_('Exit'),'class':"oe_link"}) etree.SubElement(xml_footer, 'label', {'string': tools.ustr(page_number+ 1) + "/" + tools.ustr(total_pages), 'class':"oe_survey_title_page oe_right"}) root = xml_form.getroottree() From a9e8b58ec5746113dfef89c5bd540d188db99b55 Mon Sep 17 00:00:00 2001 From: "Pinakin Nayi (OpenERP)" Date: Thu, 11 Apr 2013 14:38:42 +0530 Subject: [PATCH 05/16] [Remove]survey:remove pot changes bzr revid: pna@tinyerp.com-20130411090842-2s8i8t1wr11hvs8c --- addons/survey/i18n/survey.pot | 90 ----------------------------------- 1 file changed, 90 deletions(-) diff --git a/addons/survey/i18n/survey.pot b/addons/survey/i18n/survey.pot index f08b9ede3c4..cd08e9bc711 100644 --- a/addons/survey/i18n/survey.pot +++ b/addons/survey/i18n/survey.pot @@ -1490,54 +1490,6 @@ msgstr "" msgid "Survey Answers" msgstr "" -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:70 -#, python-format -msgid "Page : " -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:210 -#, python-format -msgid "Print Date : " -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:213 -#, python-format -msgid "Answered by : " -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:220 -#, python-format -msgid "Answer Date : " -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:225 -#, python-format -msgid "Not Finished" -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:226 -#, python-format -msgid "Finished" -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:232 -#, python-format -msgid "Status :- " -msgstr "" - -#. module: survey -#: code:addons/survey/report/survey_browse_response.py:243 -#, python-format -msgid "Page :- " -msgstr "" - #. module: survey #: model:ir.ui.menu,name:survey.menu_print_survey_answer msgid "Surveys Answers" @@ -1644,48 +1596,6 @@ msgstr "" msgid "Warning!" msgstr "" -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:392 -#, python-format -msgid "Exit" -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:376 -#, python-format -msgid "Next" -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:222 -#, python-format -msgid "Answer" -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:174 -#, python-format -msgid "Answer Of :- " -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:174 -#, python-format -msgid ", Date :- " -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:175 -#, python-format -msgid " Answer :- " -msgstr "" - -#. module: survey -#: code:addons/survey/wizard/survey_answer.py:375 -#, python-format -msgid "Previous" -msgstr "" - #. module: survey #: code:addons/survey/survey.py:465 #, python-format From 49e50a3cc4f12a8ea0695bb1179a7925a58313e3 Mon Sep 17 00:00:00 2001 From: "Dharti Ratani (Open ERP)" Date: Tue, 16 Apr 2013 12:49:34 +0530 Subject: [PATCH 06/16] [FIX]Set the filter properly in partner ledger as it was stretched wide bzr revid: dhr@tinyerp.com-20130416071934-n68fffm5kd9kbj8h --- addons/account/wizard/account_report_partner_ledger_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/wizard/account_report_partner_ledger_view.xml b/addons/account/wizard/account_report_partner_ledger_view.xml index 34c5d55e4c1..61b57f87d7e 100644 --- a/addons/account/wizard/account_report_partner_ledger_view.xml +++ b/addons/account/wizard/account_report_partner_ledger_view.xml @@ -15,7 +15,7 @@ - + From 0ff721d70ed477ce5d897c572767b42c418d5123 Mon Sep 17 00:00:00 2001 From: "Purnendu Singh (OpenERP)" Date: Wed, 17 Apr 2013 12:46:26 +0530 Subject: [PATCH 07/16] [FIX] mrp_operations: change the icon of start button as icon for scrap and start botton were same bzr revid: psi@tinyerp.com-20130417071626-bxrip3s9mz1dzi60 --- addons/mrp_operations/mrp_operations_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml index 207c5d975d7..d62e4fce1a3 100644 --- a/addons/mrp_operations/mrp_operations_view.xml +++ b/addons/mrp_operations/mrp_operations_view.xml @@ -9,7 +9,7 @@
-