From 7f9fe360f32e46af275081a7477972d1a55b9c63 Mon Sep 17 00:00:00 2001 From: qdp Date: Mon, 8 Dec 2008 18:08:40 +0100 Subject: [PATCH] *merge of the ~activity/openobject-addons/trunk branch. Improvement of translatability and small bugfixes *small modifs on mrp_repair module bzr revid: qdp@tinyerp.com-20081208170840-ryh5435c5heqsngl --- addons/account/account.py | 3 +- addons/account/invoice.py | 4 +- .../wizard/wizard_account_analytic_line.py | 3 +- addons/account/wizard/wizard_account_chart.py | 5 ++ .../account/wizard/wizard_bank_reconcile.py | 3 +- .../wizard/wizard_general_ledger_report.py | 29 +---------- .../wizard/wizard_partner_balance_report.py | 2 +- .../account/wizard/wizard_reconcile_select.py | 4 +- .../wizard/wizard_third_party_ledger.py | 2 +- addons/audittrail/audittrail.py | 14 +++--- addons/crm/crm.py | 36 ++++++++------ .../wizard/meeting_planify.py | 4 +- addons/crm_profiling/crm_profiling.py | 6 +-- addons/document/document.py | 8 ++-- addons/document/ftpserver/__init__.py | 3 +- addons/event/event.py | 7 ++- addons/hr/hr_department.py | 5 +- addons/hr_timesheet/report/user_timesheet.py | 15 +++++- addons/hr_timesheet/report/user_timesheet.xsl | 4 +- addons/hr_timesheet/report/users_timesheet.py | 19 +++++++- .../hr_timesheet/report/users_timesheet.xsl | 10 ++-- .../hr_timesheet_final_invoice_create.py | 4 +- .../wizard/hr_timesheet_invoice_create.py | 9 ++-- addons/mrp/mrp.py | 10 ++-- addons/mrp/report/price.py | 48 ++++++++++--------- addons/mrp/report/workcenter_load.py | 4 +- addons/mrp_repair/mrp_repair.py | 11 ++--- addons/mrp_repair/mrp_repair_view.xml | 17 +++++-- addons/product/pricelist.py | 25 ++++++++-- addons/product/report/product_label.xsl | 2 +- addons/product/report/product_pricelist.py | 14 ++++-- .../wizard/wizard_product_margin.py | 4 +- addons/project/report/gantt.py | 1 + addons/project/report/project_report.xsl | 24 +++++----- addons/project_timesheet/project_timesheet.py | 2 +- addons/report_task/report_task_view.xml | 2 + .../sale_analytic_plans_view.xml | 5 +- addons/stock/product.py | 24 +++++----- addons/stock/wizard/wizard_return.py | 6 ++- 39 files changed, 234 insertions(+), 164 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 1b7727e9737..30a18ac6efe 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1442,7 +1442,8 @@ class account_model(osv.osv): } _defaults = { - 'legend':lambda *a:'''You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s : To Specify Year \n%(month)s : To Specify Month \n%(date)s : Current Date\n\ne.g. My model on %(date)s''', + 'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s : To Specify Year \n%(month)s : To Specify Month \n%(date)s : Current Date\n\ne.g. My model on %(date)s'), + } account_model() diff --git a/addons/account/invoice.py b/addons/account/invoice.py index e60c04d9851..c57626d5720 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -82,8 +82,8 @@ class account_invoice(osv.osv): res[id] = self.test_paid(cr, uid, [id]) return res - def _get_reference_type(self, cursor, user, context=None): - return [('none', 'Free Reference')] + def _get_reference_type(self, cr, uid, context=None): + return [('none', _('Free Reference'))] def _amount_residual(self, cr, uid, ids, name, args, context={}): res = {} diff --git a/addons/account/project/wizard/wizard_account_analytic_line.py b/addons/account/project/wizard/wizard_account_analytic_line.py index 59b1d7069e3..3c3a47e7cc6 100644 --- a/addons/account/project/wizard/wizard_account_analytic_line.py +++ b/addons/account/project/wizard/wizard_account_analytic_line.py @@ -23,6 +23,7 @@ import wizard import pooler import time +from tools.translate import _ def _action_open_window(self, cr, uid, data, context): domain=[] @@ -35,7 +36,7 @@ def _action_open_window(self, cr, uid, data, context): elif to_date: domain=[('date','<=',to_date)] return { - 'name': 'Analytic Entries', + 'name': _('Analytic Entries'), 'view_type': 'form', "view_mode": 'tree,form', 'res_model': 'account.analytic.line', diff --git a/addons/account/wizard/wizard_account_chart.py b/addons/account/wizard/wizard_account_chart.py index eeeeb85e30a..a2edc2fec2f 100644 --- a/addons/account/wizard/wizard_account_chart.py +++ b/addons/account/wizard/wizard_account_chart.py @@ -60,6 +60,11 @@ class wizard_account_chart(wizard.interface): result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree') id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] result = act_obj.read(cr, uid, [id])[0] + if 'lang' in context: + import tools + trans_name = tools.translate(cr, 'ir.actions.act_window,name', 'model', context['lang'], result['name']) + if trans_name: + result['name'] = trans_name result['context'] = str({'fiscalyear': data['form']['fiscalyear'],'target_move':data['form']['target_move']}) if data['form']['fiscalyear']: result['name']+=':'+pooler.get_pool(cr.dbname).get('account.fiscalyear').read(cr,uid,[data['form']['fiscalyear']])[0]['code'] diff --git a/addons/account/wizard/wizard_bank_reconcile.py b/addons/account/wizard/wizard_bank_reconcile.py index 961ae553924..0c80ed5a7fb 100644 --- a/addons/account/wizard/wizard_bank_reconcile.py +++ b/addons/account/wizard/wizard_bank_reconcile.py @@ -40,7 +40,8 @@ def _action_open_window(self, cr, uid, data, context): raise Exception, _('You have to define the bank account\nin the journal definition for reconciliation.') return { 'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (form['journal_id'],account_id), - 'name': 'Saisie Standard', + 'name': _('Standard Encoding'), + 'view_type': 'form', 'view_mode': 'tree,form', 'res_model': 'account.move.line', diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py index 1d5896204db..57cf73b2941 100644 --- a/addons/account/wizard/wizard_general_ledger_report.py +++ b/addons/account/wizard/wizard_general_ledger_report.py @@ -25,32 +25,6 @@ import pooler import locale import time -#report_type = ''' -#
-#
''' -# -#dates_form = ''' -#
-# -# -# -# -# -# -# -#''' -# -#dates_fields = { -# 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')}, -# 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, -# 'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]}, -# 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]}, -# 'landscape':{'string':"Print in Landscape Mode",'type':'boolean'}, -# 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'}, -# 'amount_currency':{'string':"with amount in currency",'type':'boolean'} -# -#} - account_form = '''
@@ -108,11 +82,10 @@ period_fields = { 'sortbydate':{'string':"Sort by:",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Movement')]}, 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]}, 'landscape':{'string':"Landscape Mode",'type':'boolean'}, - 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'}, + 'soldeinit':{'string':"Include initial balances",'type':'boolean'}, 'amount_currency':{'string':"With Currency",'type':'boolean'}, 'date_from': {'string':" Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')}, 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, - } def _check_path(self, cr, uid, data, context): if data['model'] == 'account.account': diff --git a/addons/account/wizard/wizard_partner_balance_report.py b/addons/account/wizard/wizard_partner_balance_report.py index 697b08fd16b..1c5290832dc 100644 --- a/addons/account/wizard/wizard_partner_balance_report.py +++ b/addons/account/wizard/wizard_partner_balance_report.py @@ -68,7 +68,7 @@ period_fields = { 'selection':[('customer','Receivable Accounts'),('supplier','Payable Accounts'),('all','Receivable and Payable Accounts')], 'required':True }, - 'soldeinit':{'string':" Inclure les soldes initiaux",'type':'boolean'}, + 'soldeinit':{'string':"Include initial balances",'type':'boolean'}, 'date1': {'string':' Start date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-01-01')}, 'date2': {'string':'End date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-%m-%d')}, } diff --git a/addons/account/wizard/wizard_reconcile_select.py b/addons/account/wizard/wizard_reconcile_select.py index d63725fdb1f..d61504003bb 100644 --- a/addons/account/wizard/wizard_reconcile_select.py +++ b/addons/account/wizard/wizard_reconcile_select.py @@ -21,6 +21,8 @@ ############################################################################## import wizard +from tools.translate import _ + _journal_form = ''' @@ -34,7 +36,7 @@ _journal_fields = { def _action_open_window(self, cr, uid, data, context): return { 'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['form']['account_id'], - 'name': 'Reconciliation', + 'name': _('Reconciliation'), 'view_type': 'form', 'view_mode': 'tree,form', 'view_id': False, diff --git a/addons/account/wizard/wizard_third_party_ledger.py b/addons/account/wizard/wizard_third_party_ledger.py index 80827378e0f..c84dbbbe4e0 100755 --- a/addons/account/wizard/wizard_third_party_ledger.py +++ b/addons/account/wizard/wizard_third_party_ledger.py @@ -74,7 +74,7 @@ period_fields = { 'selection':[('customer','Receivable Accounts'),('supplier','Payable Accounts'),('all','Receivable and Payable Accounts')], 'required':True }, - 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'}, + 'soldeinit':{'string':"Include initial balances",'type':'boolean'}, 'reconcil':{'string':" Include Reconciled Entries",'type':'boolean'}, 'page_split':{'string':"One Partner Per Page",'type':'boolean'}, 'date1': {'string':' Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py index 09fc74507fe..51459003d6b 100644 --- a/addons/audittrail/audittrail.py +++ b/addons/audittrail/audittrail.py @@ -144,17 +144,16 @@ def get_value_text(cr, uid, field_name,values,object, context={}): if values: if type(values)==tuple: values=values[0] - val=pool.get(model).read(cr,uid,[values],['name']) + val=pool.get(model).read(cr,uid,[values],[pool.get(model)._rec_name]) if len(val): - return val[0]['name'] - + return val[0][pool.get(model)._rec_name] elif field['ttype'] == 'many2many': value=[] if values: for id in values: - val=pool.get(model).read(cr,uid,[id],['name']) + val=pool.get(model).read(cr,uid,[id],[pool.get(model)._rec_name]) if len(val): - value.append(val[0]['name']) + value.append(val[0][pool.get(model)._rec_name]) return value elif field['ttype'] == 'one2many': @@ -162,9 +161,10 @@ def get_value_text(cr, uid, field_name,values,object, context={}): if values: value=[] for id in values: - val=pool.get(model).read(cr,uid,[id],['name']) + val=pool.get(model).read(cr,uid,[id],[pool.get(model)._rec_name]) + if len(val): - value.append(val[0]['name']) + value.append(val[0][pool.get(model)._rec_name]) return value return values diff --git a/addons/crm/crm.py b/addons/crm/crm.py index d284da54904..85cab98107f 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -223,6 +223,7 @@ class crm_case_rule(osv.osv): ('create','Creation Date'), ('action_last','Last Action Date'), ('deadline','Deadline'), + ('date','Date'), ], 'Trigger Date', size=16), 'trg_date_range': fields.integer('Delay after trigger date'), 'trg_date_range_type': fields.selection([('minutes', 'Minutes'),('hour','Hours'),('day','Days'),('month','Months')], 'Delay type'), @@ -435,6 +436,8 @@ class crm_case(osv.osv): base = mx.DateTime.strptime(case.create_date[:19], '%Y-%m-%d %H:%M:%S') elif action.trg_date_type=='deadline' and case.date_deadline: base = mx.DateTime.strptime(case.date_deadline, '%Y-%m-%d') + elif action.trg_date_type=='date' and case.date: + base = mx.DateTime.strptime(case.date, '%Y-%m-%d') if base: fnct = { 'minutes': lambda interval: mx.DateTime.RelativeDateTime(minutes=interval), @@ -531,7 +534,10 @@ class crm_case(osv.osv): return False for case in cases: if case.partner_id: - name = 'Case ' + keyword + ': ' + case.name + translated_keyword = keyword + if 'translated_keyword' in context: + translated_keyword = context['translated_keyword'] + name = _('Case') + ' ' + translated_keyword + ': ' + case.name if isinstance(name, str): name = unicode(name, 'utf-8') if len(name) > 64: @@ -574,7 +580,7 @@ class crm_case(osv.osv): res = super(crm_case, self).create(cr, uid, *args, **argv) cases = self.browse(cr, uid, [res]) cases[0].state # to fill the browse record cache - self.__log(cr,uid, cases, 'draft') + self.__log(cr,uid, cases, 'draft', context={'translated_keyword': _('draft')}) self._action(cr,uid, cases, 'draft') return res @@ -626,7 +632,7 @@ class crm_case(osv.osv): def case_log(self, cr, uid, ids,context={}, email=False, *args): cases = self.browse(cr, uid, ids) - self.__history(cr, uid, cases, 'Historize', history=True, email=email) + self.__history(cr, uid, cases, _('Historize'), history=True, email=email) return self.write(cr, uid, ids, {'description': False, 'som': False, 'canal_id': False}) @@ -636,7 +642,7 @@ class crm_case(osv.osv): if not case.email_from: raise osv.except_osv(_('Error!'), _('You must put a Partner eMail to use this action!')) - self.__history(cr, uid, cases, 'Send', history=True, email=False) + self.__history(cr, uid, cases, _('Send'), history=True, email=False) for case in cases: self.write(cr, uid, [case.id], { 'description': False, @@ -685,8 +691,8 @@ class crm_case(osv.osv): def case_close(self, cr, uid, ids, *args): cases = self.browse(cr, uid, ids) cases[0].state # to fill the browse record cache - self.__log(cr,uid, cases, 'done') - self.__history(cr, uid, cases, 'Close') + self.__log(cr,uid, cases, 'done', context={'translated_keyword': _('done')}) + self.__history(cr, uid, cases, _('Close')) self.write(cr, uid, ids, {'state':'done', 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')}) # # We use the cache of cases to keep the old case state @@ -705,15 +711,15 @@ class crm_case(osv.osv): else: raise osv.except_osv(_('Error !'), _('You can not escalate this case.\nYou are already at the top level.')) self.write(cr, uid, ids, data) - self.__history(cr, uid, cases, 'escalate') + self.__history(cr, uid, cases, _('Escalate')) self._action(cr, uid, cases, 'escalate') return True def case_open(self, cr, uid, ids, *args): cases = self.browse(cr, uid, ids) - self.__log(cr, uid, cases, 'open') - self.__history(cr, uid, cases, 'Open') + self.__log(cr, uid, cases, 'open', context={'translated_keyword': _('open')}) + self.__history(cr, uid, cases, _('Open')) for case in cases: data = {'state':'open', 'active':True} if not case.user_id: @@ -729,8 +735,8 @@ class crm_case(osv.osv): def case_cancel(self, cr, uid, ids, *args): cases = self.browse(cr, uid, ids) cases[0].state # to fill the browse record cache - self.__log(cr, uid, cases, 'cancel') - self.__history(cr, uid, cases, 'Cancel') + self.__log(cr, uid, cases, 'cancel', context={'translated_keyword': _('cancel')}) + self.__history(cr, uid, cases, _('Cancel')) self.write(cr, uid, ids, {'state':'cancel', 'active':True}) self._action(cr,uid, cases, 'cancel') return True @@ -738,8 +744,8 @@ class crm_case(osv.osv): def case_pending(self, cr, uid, ids, *args): cases = self.browse(cr, uid, ids) cases[0].state # to fill the browse record cache - self.__log(cr, uid, cases, 'pending') - self.__history(cr, uid, cases, 'Pending') + self.__log(cr, uid, cases, 'pending', context={'translated_keyword': _('draft')}) + self.__history(cr, uid, cases, _('Pending')) self.write(cr, uid, ids, {'state':'pending', 'active':True}) self._action(cr,uid, cases, 'pending') return True @@ -747,8 +753,8 @@ class crm_case(osv.osv): def case_reset(self, cr, uid, ids, *args): cases = self.browse(cr, uid, ids) cases[0].state # to fill the browse record cache - self.__log(cr, uid, cases, 'draft') - self.__history(cr, uid, cases, 'Draft') + self.__log(cr, uid, cases, 'draft', context={'translated_keyword': _('draft')}) + self.__history(cr, uid, cases, _('Draft')) self.write(cr, uid, ids, {'state':'draft', 'active':True}) self._action(cr, uid, cases, 'draft') return True diff --git a/addons/crm_configuration/wizard/meeting_planify.py b/addons/crm_configuration/wizard/meeting_planify.py index f0c050de30f..9cf6ea89d62 100644 --- a/addons/crm_configuration/wizard/meeting_planify.py +++ b/addons/crm_configuration/wizard/meeting_planify.py @@ -27,6 +27,8 @@ import netsvc import ir import pooler +from tools.translate import _ + case_form = """ @@ -54,7 +56,7 @@ class make_meeting(wizard.interface): 'date': data['form']['date'], 'duration': data['form']['duration'] }, context=context) - case_obj._history(cr, uid, case_obj.browse(cr, uid, [data['id']]), 'meeting') + case_obj._history(cr, uid, case_obj.browse(cr, uid, [data['id']]), _('meeting')) return {} states = { diff --git a/addons/crm_profiling/crm_profiling.py b/addons/crm_profiling/crm_profiling.py index dc68e62ef1b..a7e702bec05 100644 --- a/addons/crm_profiling/crm_profiling.py +++ b/addons/crm_profiling/crm_profiling.py @@ -22,6 +22,8 @@ from osv import fields,osv from osv import orm +from tools.translate import _ + def _get_answers(cr, uid, ids): query = """ select distinct(answer) @@ -131,11 +133,9 @@ class questionnaire(osv.osv): from crm_profiling_question where id in ( select question from profile_questionnaire_quest_rel where questionnaire = %s)"""% data['form']['questionnaire_name'] cr.execute(query) - quest_fields={} quest_form=''' - ''' - + ''' % _('Questionnaire') for x in cr.fetchall(): quest_form = quest_form + '''''' quest_fields['quest_form'+str(x[1])] = {'string': str(x[0]), 'type': 'many2one', 'relation': 'crm_profiling.answer', 'domain': [('question_id','=',x[1])] } diff --git a/addons/document/document.py b/addons/document/document.py index 84c70b56c30..e7929f2ba90 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -36,6 +36,7 @@ import StringIO import random import string +from tools import config def random_name(): random.seed() @@ -261,8 +262,9 @@ class document_directory(osv.osv): _parent(dir_id,path) path.append(self.pool.get(directory.ressource_type_id.model).browse(cr,uid,res_id).name) user=self.pool.get('res.users').browse(cr,uid,uid) - return "ftp://%s:%s@localhost:8021/%s/%s"%(user.login,user.password,cr.dbname,'/'.join(path)) - return False + return "ftp://%s:%s@localhost:%s/%s/%s"%(user.login,user.password,config.get('ftp_server_port',8021),cr.dbname,'/'.join(path)) + return False + def _check_recursion(self, cr, uid, ids): level = 100 while len(ids): @@ -364,7 +366,7 @@ class document_directory(osv.osv): ressource_id=directory.ressource_id and directory.ressource_id.id or 0 res=self.search(cr,uid,[('id','<>',directory.id),('name','=',name),('parent_id','=',parent_id),('ressource_parent_type_id','=',ressource_parent_type_id),('ressource_id','=',ressource_id)]) if len(res): - return False + return False if op=='create': res=self.search(cr,uid,[('name','=',name),('parent_id','=',parent_id),('ressource_parent_type_id','=',ressource_parent_type_id),('ressource_id','=',ressource_id)]) if len(res): diff --git a/addons/document/ftpserver/__init__.py b/addons/document/ftpserver/__init__.py index f4b12525426..3856c5d47e1 100644 --- a/addons/document/ftpserver/__init__.py +++ b/addons/document/ftpserver/__init__.py @@ -4,7 +4,8 @@ import authorizer import abstracted_fs import netsvc -PORT = 8021 +from tools import config +PORT = config.get('ftp_server_port', 8021) HOST = '' class ftp_server(threading.Thread): diff --git a/addons/event/event.py b/addons/event/event.py index e593a1c38e8..e45f878456c 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -137,10 +137,12 @@ class event(osv.osv): 'mail_confirm': fields.text('Confirmation Email', help="This email will be sent when the event gets confimed or when someone subscribes to a confirmed event. This is also the email sent to remind someone about the event."), 'product_id':fields.many2one('product.product','Product', required=True), } + _defaults = { 'state': lambda *args: 'draft', 'code': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'event.event'), 'user_id': lambda self,cr,uid,ctx: uid, + } event() @@ -148,6 +150,8 @@ class event_registration(osv.osv): def _history(self, cr, uid,ids,keyword, history=False, email=False, context={}): for case in self.browse(cr, uid, ids): + if not case.case_id: + return True data = { 'name': keyword, 'som': case.som.id, @@ -333,7 +337,8 @@ class event_registration(osv.osv): case_data = self.browse(cr,uid,ids) new_ids=[] for case in case_data: - new_ids.append(case.case_id.id) + if case.case_id: + new_ids.append(case.case_id.id) return getattr(self.pool.get('crm.case'),method)(cr, uid, new_ids, *args, **argv) diff --git a/addons/hr/hr_department.py b/addons/hr/hr_department.py index dc7deb8799b..fe687266521 100644 --- a/addons/hr/hr_department.py +++ b/addons/hr/hr_department.py @@ -73,7 +73,10 @@ class ir_action_window(osv.osv): r['domain'] = r['domain'].replace(mystring, str( self.pool.get('hr.department')._get_members(cr, uid))) if isinstance(ids, (int, long)): - return res[0] + if res: + return res[0] + else: + return False return res ir_action_window() diff --git a/addons/hr_timesheet/report/user_timesheet.py b/addons/hr_timesheet/report/user_timesheet.py index 3a90781135f..07742b451b1 100644 --- a/addons/hr_timesheet/report/user_timesheet.py +++ b/addons/hr_timesheet/report/user_timesheet.py @@ -24,6 +24,7 @@ import datetime from report.interface import report_rml from report.interface import toxml +from tools.translate import _ import pooler @@ -33,13 +34,23 @@ def lengthmonth(year, month): return [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month] class report_custom(report_rml): + + def get_month_name(self, cr, uid, month): + _months = {1:_("January"), 2:_("February"), 3:_("March"), 4:_("April"), 5:_("May"), 6:_("June"), 7:_("July"), 8:_("August"), 9:_("September"), 10:_("October"), 11:_("November"), 12:_("December")} + return _months[month] + def get_weekday_name(self, cr, uid, weekday): + _weekdays = {1:_('Mon'), 2:_('Tue'), 3:_('Wed'), 4:_('Thu'), 5:_('Fri'), 6:_('Sat'), 7:_('Sun')} + return _weekdays[weekday] + def create_xml(self, cr, uid, ids, data, context): # Computing the dates (start of month: som, and end of month: eom) som = datetime.date(data['form']['year'], data['form']['month'], 1) eom = som + datetime.timedelta(lengthmonth(som.year, som.month)) - date_xml = ['' % (som.strftime('%B'), som.year), ''] - date_xml += ['' % (x, som.replace(day=x).strftime('%a')) for x in range(1, lengthmonth(som.year, som.month)+1)] + + date_xml = ['' % (self.get_month_name(cr, uid, som.month), som.year), ''] + date_xml += ['' % (x, self.get_weekday_name(cr, uid, som.replace(day=x).weekday()+1), som.replace(day=x).weekday()+1) for x in range(1, lengthmonth(som.year, som.month)+1)] + date_xml.append('') date_xml.append('2.5cm%s,2cm\n' % (',0.7cm' * lengthmonth(som.year, som.month))) diff --git a/addons/hr_timesheet/report/user_timesheet.xsl b/addons/hr_timesheet/report/user_timesheet.xsl index d48e890ac4f..07bbd778ded 100644 --- a/addons/hr_timesheet/report/user_timesheet.xsl +++ b/addons/hr_timesheet/report/user_timesheet.xsl @@ -30,7 +30,7 @@ - + lightgrey @@ -131,4 +131,4 @@ - \ No newline at end of file + diff --git a/addons/hr_timesheet/report/users_timesheet.py b/addons/hr_timesheet/report/users_timesheet.py index f84d8388aa7..8ba187da4a2 100644 --- a/addons/hr_timesheet/report/users_timesheet.py +++ b/addons/hr_timesheet/report/users_timesheet.py @@ -24,6 +24,9 @@ import datetime from report.interface import report_rml from report.interface import toxml +from tools.translate import _ + + def lengthmonth(year, month): if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))): return 29 @@ -67,13 +70,22 @@ def emp_create_xml(cr, id, som, eom): return xml class report_custom(report_rml): + + def get_month_name(self, cr, uid, month): + _months = {1:_("January"), 2:_("February"), 3:_("March"), 4:_("April"), 5:_("May"), 6:_("June"), 7:_("July"), 8:_("August"), 9:_("September"), 10:_("October"), 11:_("November"), 12:_("December")} + return _months[month] + + def get_weekday_name(self, cr, uid, weekday): + _weekdays = {1:_('Mon'), 2:_('Tue'), 3:_('Wed'), 4:_('Thu'), 5:_('Fri'), 6:_('Sat'), 7:_('Sun')} + return _weekdays[weekday] + def create_xml(self, cr, uid, ids, data, context): # Computing the dates (start of month: som, and end of month: eom) som = datetime.date(data['form']['year'], data['form']['month'], 1) eom = som + datetime.timedelta(lengthmonth(som.year, som.month)) - date_xml = ['' % (som.strftime('%B'), som.year), ''] - date_xml += ['' % (x, som.replace(day=x).strftime('%a')) for x in range(1, lengthmonth(som.year, som.month)+1)] + date_xml = ['' % (self.get_month_name(cr, uid, som.month), som.year), ''] + date_xml += ['' % (x, self.get_weekday_name(cr, uid, som.replace(day=x).weekday()+1), som.replace(day=x).weekday()+1) for x in range(1, lengthmonth(som.year, som.month)+1)] date_xml.append('') date_xml.append('2.5cm%s,2cm\n' % (',0.7cm' * lengthmonth(som.year, som.month))) @@ -82,6 +94,9 @@ class report_custom(report_rml): emp_xml += emp_create_xml(cr, id, som, eom) # Computing the xml + #Without this, report don't show non-ascii characters (TO CHECK) + date_xml = '\n'.join(date_xml) + xml=''' %s diff --git a/addons/hr_timesheet/report/users_timesheet.xsl b/addons/hr_timesheet/report/users_timesheet.xsl index b800ae2d008..7a06e04b409 100644 --- a/addons/hr_timesheet/report/users_timesheet.xsl +++ b/addons/hr_timesheet/report/users_timesheet.xsl @@ -30,7 +30,7 @@ - + lightgrey @@ -107,17 +107,17 @@ - + - Total + Total - + - + diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py index 086136781bd..62353018520 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py @@ -117,7 +117,7 @@ class final_invoice_create(wizard.interface): 'discount': 0.0, 'invoice_line_tax_id': [(6,0,tax)], 'invoice_id': last_invoice, - 'name': ref+(product and ' - '+product.name or ''), + 'name': ref or '' +(product and ' - '+product.name or ''), 'product_id': product_id, 'uos_id': product_uom_id, 'account_id': account_id, @@ -139,7 +139,7 @@ class final_invoice_create(wizard.interface): 'invoice_line_tax_id': [(6,0,tax)], 'invoice_id': last_invoice, 'name': product.name, - 'product_id': product_id, + 'product_id': product.id, 'uos_id': product.uom_id.id, 'account_id': account_id, 'account_analytic_id': account.id diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index 8125ce3f2fe..b85cba38bf4 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -52,8 +52,11 @@ class invoice_create(wizard.interface): partner = account.partner_id if (not partner) or not (account.pricelist_id): raise wizard.except_wizard(_('Analytic account incomplete'), - _('Please fill in the partner and pricelist field ' - 'in the analytic account:\n%s') % (account.name,)) + _('Please fill in the partner and pricelist field in the analytic account:\n%s') % (account.name,)) + + if not partner.address: + raise wizard.except_wizard(_('Partner incomplete'), + _('Please fill in the address field in the partner: %s.') % (partner.name,)) date_due = False if partner.property_payment_term: @@ -150,7 +153,7 @@ class invoice_create(wizard.interface): return { 'domain': "[('id','in', ["+','.join(map(str,invoices))+"])]", - 'name': 'Invoices', + 'name': _('Invoices'), 'view_type': 'form', 'view_mode': 'tree,form', 'res_model': 'account.invoice', diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index e0b326f7fca..36e7492d8b9 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -874,7 +874,7 @@ class mrp_procurement(osv.osv): properties = [x.id for x in procurement.property_ids] bom_id = self.pool.get('mrp.bom')._bom_find(cr, uid, procurement.product_id.id, procurement.product_uom.id, properties) if not bom_id: - cr.execute('update mrp_procurement set message=%s where id=%d', ('No BoM defined for this product !', procurement.id)) + cr.execute('update mrp_procurement set message=%s where id=%d', (_('No BoM defined for this product !'), procurement.id)) return False return True @@ -912,7 +912,7 @@ class mrp_procurement(osv.osv): if procurement.product_id.product_tmpl_id.supply_method<>'buy': return False if not procurement.product_id.seller_ids: - cr.execute('update mrp_procurement set message=%s where id=%d', ('No supplier defined for this product !', procurement.id)) + cr.execute('update mrp_procurement set message=%s where id=%d', (_('No supplier defined for this product !'), procurement.id)) return False partner = procurement.product_id.seller_ids[0].name if user.company_id and user.company_id.partner_id: @@ -920,7 +920,7 @@ class mrp_procurement(osv.osv): return False address_id = self.pool.get('res.partner').address_get(cr, uid, [partner.id], ['delivery'])['delivery'] if not address_id: - cr.execute('update mrp_procurement set message=%s where id=%d', ('No address defined for the supplier', procurement.id)) + cr.execute('update mrp_procurement set message=%s where id=%d', (_('No address defined for the supplier'), procurement.id)) return False return True @@ -956,7 +956,7 @@ class mrp_procurement(osv.osv): return True def action_move_assigned(self, cr, uid, ids): - self.write(cr, uid, ids, {'state':'running','message':'from stock: products assigned.'}) + self.write(cr, uid, ids, {'state':'running','message':_('from stock: products assigned.')}) return True def _check_make_to_stock_service(self, cr, uid, procurement, context={}): @@ -970,7 +970,7 @@ class mrp_procurement(osv.osv): ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id]) cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%d', (procurement.product_id.id,)) if not cr.fetchone()[0]: - cr.execute('update mrp_procurement set message=%s where id=%d', ('from stock and no minimum orderpoint rule defined', procurement.id)) + cr.execute('update mrp_procurement set message=%s where id=%d', (_('from stock and no minimum orderpoint rule defined'), procurement.id)) return ok def action_produce_assign_service(self, cr, uid, ids, context={}): diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index 5a044a32935..5342e5b9e87 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -25,6 +25,8 @@ import pooler from report.interface import report_rml from report.interface import toxml +from tools.translate import _ + #FIXME: we should use toxml class report_custom(report_rml): @@ -116,38 +118,38 @@ class report_custom(report_rml): """ header = """
- Product name - Product supplier - Product quantity - Product uom - Product Standard Price - Unit Product Price + %s + %s + %s + %s + %s + %s
- """ + """ % (_('Product name'), _('Product supplier'), _('Product quantity'), _('Product uom'), _('Product Standard Price'), _('Unit Product Price')) workcenter_header = """ - Workcenter name + %s - Cycles Cost - Hours Cost + %s + %s - """ + """ % (_('Workcenter name'), _('Cycles Cost'), _('Hours Cost')) prod_header = """ - Product name - Product supplier - Product Quantity - Product uom - Product Standard Price - Unit Product Price + %s + %s + %s + %s + %s + %s - """ + """ % (_('Product name'), _('Product supplier'), _('Product Quantity'), _('Product uom'), _('Product Standard Price'), _('Unit Product Price')) company_currency = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid).company_id.currency_id.id first = True @@ -171,8 +173,7 @@ class report_custom(report_rml): if not first: xml += prod_header xml += "" + xml_tmp + '' - xml += "SUBTOTAL : (for " + str(number) + " products)" + '%.2f' % total_strd + '' + '%.2f' % total + '' - + xml += "%s : (" % (_('SUBTOTAL')) + str(number) + " %s)" % (_('products')) + '%.2f' % total_strd + '' + '%.2f' % total + '' total2 = 0 xml_tmp = '' for wrk in (sub_boms and sub_boms[1]): @@ -182,11 +183,12 @@ class report_custom(report_rml): if xml_tmp: xml += workcenter_header xml += "" + xml_tmp + '' - xml += "SUBTOTAL : (for " + str(number) + " products)" + '%.2f' % total2 + '' - xml += "TOTAL : (for " + str(number) + " products)" + '%.2f' % (total_strd+total2) + "" + '%.2f' % (total+total2) + '' + xml += "%s : (" % (_('SUBTOTAL')) + str(number) + " %s)" % (_('products')) + '%.2f' % total2 + '' + xml += "%s : (" % (_('TOTAL')) + str(number) + " %s)" % (_('products')) + '%.2f' % (total_strd+total2) + "" + '%.2f' % (total+total2) + '' + first = False - xml = '' + config_start + 'Product Cost Structure\n\r' + prod.name + ''+ config_stop + header + xml + '' + xml = '' + config_start + '%s\n\r' % (_('Product Cost Structure')) + prod.name + ''+ config_stop + header + xml + '' return xml diff --git a/addons/mrp/report/workcenter_load.py b/addons/mrp/report/workcenter_load.py index cb0c6378546..820654b821e 100644 --- a/addons/mrp/report/workcenter_load.py +++ b/addons/mrp/report/workcenter_load.py @@ -110,7 +110,7 @@ class report_custom(report_int): res = cr.dictfetchone() if not res['stop']: res['stop'] = time.strftime('%Y-%m-%d') - dates = self._compute_dates(datas['form']['time_unit'], time.strftime('%Y-%m-%d'), res['stop']) + dates = self._compute_dates(datas['form']['time_unit'], time.strftime('%Y-%m-%d'), res['stop'][:10]) dates_list = dates.keys() dates_list.sort() x_index = [] @@ -151,7 +151,7 @@ class report_custom(report_int): AND (mrp_workcenter.id=%d) \ AND (mrp_production.date_planned BETWEEN %s AND %s) \ GROUP BY mrp_production_workcenter_line.workcenter_id, mrp_workcenter.name, mrp_workcenter.id \ - ORDER BY mrp_workcenter.id", (workcenter['id'], dates[date]['start'], dates[date]['stop'])) + ORDER BY mrp_workcenter.id", (workcenter['id'], dates[date]['start'] + ' 00:00:00', dates[date]['stop'] + ' 23:59:59')) res = cr.dictfetchall() if not res: vals.append(0.0) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index bf8a9f8a640..53ae321f60c 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -93,7 +93,7 @@ class mrp_repair(osv.osv): 'guarantee_limit': fields.date('Guarantee limit', help="The garantee limit is computed as: last move date + warranty defined on selected product. If the current date is below the garantee limit, each operation and fee you will add will be set as 'not to invoiced' by default. Note that you can change manually afterwards."), 'operations' : fields.one2many('mrp.repair.line', 'repair_id', 'Operation Lines', readonly=True, states={'draft':[('readonly',False)]}), 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', help='The pricelist comes from the selected partner, by default.'), - 'partner_invoice_id':fields.many2one('res.partner.address', 'Invoice to', domain="[('partner_id','=',partner_id)]"), + 'partner_invoice_id':fields.many2one('res.partner.address', 'Invoicing Address', domain="[('partner_id','=',partner_id)]"), 'invoice_method':fields.selection([ ("none","No Invoice"), ("b4repair","Before Repair"), @@ -374,7 +374,6 @@ class mrp_repair(osv.osv): res = {} company = self.pool.get('res.users').browse(cr, uid, uid).company_id for repair in self.browse(cr, uid, ids, context=context): - #TODO: create the moves add/remove for move in repair.operations: move_id = self.pool.get('stock.move').create(cr, uid, { 'name': move.name, @@ -385,7 +384,7 @@ class mrp_repair(osv.osv): 'location_id': move.location_id.id, 'location_dest_id': move.location_dest_id.id, 'tracking_id': False, - 'state': 'assigned', + 'state': 'done', }) self.pool.get('mrp.repair.line').write(cr, uid, [move.id], {'move_id': move_id}) @@ -397,7 +396,7 @@ class mrp_repair(osv.osv): 'address_id': repair.address_id and repair.address_id.id or False, 'note': repair.internal_notes, 'invoice_state': 'none', - 'type': 'out', # FIXME delivery ? + 'type': 'out', }) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'stock.picking', picking, 'button_confirm', cr) @@ -499,8 +498,8 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'product_uom_qty': fields.float('Quantity (UoM)', digits=(16,2), required=True), 'product_uom': fields.many2one('product.uom', 'Product UoM', required=True), 'invoice_line_id': fields.many2one('account.invoice.line', 'Invoice Line', readonly=True), - 'location_id': fields.many2one('stock.location', 'Source Location', required=True, select=True), - 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', required=True, select=True), + 'location_id': fields.many2one('stock.location', 'Source Location', domain=[('type','!=','view')], required=True, select=True), + 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', domain=[('type','!=','view')], required=True, select=True), 'move_id': fields.many2one('stock.move', 'Inventory Move', readonly=True), 'state': fields.selection([('draft','Draft'),('confirmed','Confirmed'),('done','Done'),('cancel','Canceled')], 'Status', required=True, readonly=True), } diff --git a/addons/mrp_repair/mrp_repair_view.xml b/addons/mrp_repair/mrp_repair_view.xml index ae13bc09f64..15dfd109b59 100644 --- a/addons/mrp_repair/mrp_repair_view.xml +++ b/addons/mrp_repair/mrp_repair_view.xml @@ -199,9 +199,18 @@ mrp.repair form tree,form - [('state','=','confirmed')] + [('state','=','under_repair')] - + + + Repairs Ready to Start + ir.actions.act_window + mrp.repair + form + tree,form + [('state','!=','draft'),('state','!=','under_repair'),('state','!=','2binvoiced'),('state','!=','invoice_except'),('state','!=','done'),('state','!=','cancel'),] + + Repairs to be invoiced ir.actions.act_window @@ -214,8 +223,10 @@ - + + + diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index 247d098e69c..8df19271288 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -36,8 +36,16 @@ class price_type(osv.osv): sale and purchase prices based on some fields of the product. """ def _price_field_get(self, cr, uid, context={}): - cr.execute('select name, field_description from ir_model_fields where model in (%s,%s) and ttype=%s order by name', ('product.product', 'product.template', 'float')) - return cr.fetchall() + import tools + cr.execute('select name, field_description, model from ir_model_fields where model in (%s,%s) and ttype=%s order by name', ('product.product', 'product.template', 'float')) + res = [] + for field in cr.dictfetchall(): + desc = tools.translate(cr, field['model'] + ',' + field['name'], 'field', context.get('lang', False) or 'en_US') + if not desc: + desc = field['field_description'] + res.append((field['name'], desc)) + return res + def _get_currency(self, cr, uid, ctx): comp = self.pool.get('res.users').browse(cr,uid,uid).company_id if not comp: @@ -297,9 +305,16 @@ product_pricelist_version() class product_pricelist_item(osv.osv): def _price_field_get(self, cr, uid, context={}): cr.execute('select id,name from product_price_type where active') - result = cr.fetchall() - result.append((-1,'Other Pricelist')) - result.append((-2,'Partner section of the product form')) + import tools + result = [] + for line in cr.fetchall(): + transl_name = tools.translate(cr, 'product.price.type,name', 'model', ('lang' in context) and context['lang'] or 'en_US', line[1]) + if not transl_name: + transl_name = line[1] + result.append((line[0], transl_name)) + + result.append((-1, _('Other Pricelist'))) + result.append((-2, _('Partner section of the product form'))) return result _name = "product.pricelist.item" diff --git a/addons/product/report/product_label.xsl b/addons/product/report/product_label.xsl index 2b3d05d2f14..5c52e21227f 100644 --- a/addons/product/report/product_label.xsl +++ b/addons/product/report/product_label.xsl @@ -66,7 +66,7 @@ - EUR + EUR diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py index 87b7d6ad3e9..513d396a4b4 100644 --- a/addons/product/report/product_pricelist.py +++ b/addons/product/report/product_pricelist.py @@ -24,6 +24,9 @@ import time from report import report_sxw from osv import osv import pooler + +from tools.translate import _ + parents = { 'tr':1, 'li':1, @@ -45,16 +48,19 @@ class product_pricelist(report_sxw.rml_parse): 'qty_header':self._qty_header, }) def _qty_header(self,form): + def _get_unit_text(obj, cr, uid, par_qty): + if form[q]==1: + return _('%d unit')%(par_qty) + else: + return _('%d units')%(par_qty) + qty=[] self.pricelist=form['price_list'] for i in range(1,6): q = 'qty%d'%i if form[q]: self.quantity.append(form[q]) - if form[q]==1: - qty.append('%d unit'%(form[q])) - else: - qty.append('%d units'%(form[q])) + qty.append(_get_unit_text(self, self.cr, self.uid, form[q])) return qty diff --git a/addons/product_margin/wizard/wizard_product_margin.py b/addons/product_margin/wizard/wizard_product_margin.py index fec60501960..920fd3469ee 100644 --- a/addons/product_margin/wizard/wizard_product_margin.py +++ b/addons/product_margin/wizard/wizard_product_margin.py @@ -24,6 +24,8 @@ import wizard import pooler import time +from tools.translate import _ + def _action_open_window(self, cr, uid, data, context): cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.graph', 'graph')) view_res3 = cr.fetchone()[0] @@ -32,7 +34,7 @@ def _action_open_window(self, cr, uid, data, context): cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.tree', 'tree')) view_res = cr.fetchone()[0] return { - 'name': 'Product Margins', + 'name': _('Product Margins'), 'context':{'date_from':data['form']['from_date'],'date_to':data['form']['to_date'],'invoice_state' : data['form']['invoice_state']}, 'view_type': 'form', "view_mode": 'tree,form,graph', diff --git a/addons/project/report/gantt.py b/addons/project/report/gantt.py index 801f61a14f2..fb426a098a3 100644 --- a/addons/project/report/gantt.py +++ b/addons/project/report/gantt.py @@ -42,6 +42,7 @@ class GanttCanvas(object): user=user.replace('/', '//') if hasattr(name, 'replace'): name=name.replace('/', '//') + name = name.encode('ascii', 'ignore') if user not in self._datas: self._datas[user] = [] for f in datas: diff --git a/addons/project/report/project_report.xsl b/addons/project/report/project_report.xsl index f87611b1b5a..c0b475805c7 100644 --- a/addons/project/report/project_report.xsl +++ b/addons/project/report/project_report.xsl @@ -59,11 +59,11 @@ - Tasks - Hours - Done - Deadline - Responsible + Tasks + Hours + Done + Deadline + Responsible @@ -76,24 +76,24 @@ - Manager: + Manager: - Members: + Members: - Project: + Project: - Date Start: + Date Start: - Date Stop: + Date Stop: - Planned Hours: + Planned Hours: - Effective Hours: + Effective Hours: diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index b0dac7dd5f5..655029f1c68 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -57,7 +57,7 @@ class project_work(osv.osv): if line_id in list_avail_ids: obj = self.pool.get('hr.analytic.timesheet') if 'name' in vals: - vals_line['name']=task.name+': '+vals['name'] + vals_line['name']=task.name+': '+vals['name'] if 'user_id' in vals: vals_line['user_id']=vals['user_id'] if 'date' in vals: diff --git a/addons/report_task/report_task_view.xml b/addons/report_task/report_task_view.xml index b258465dd0d..60a2a0a7894 100644 --- a/addons/report_task/report_task_view.xml +++ b/addons/report_task/report_task_view.xml @@ -15,6 +15,7 @@ + @@ -42,6 +43,7 @@ + diff --git a/addons/sale_analytic_plans/sale_analytic_plans_view.xml b/addons/sale_analytic_plans/sale_analytic_plans_view.xml index fdab5de1399..0fe67b5ff22 100644 --- a/addons/sale_analytic_plans/sale_analytic_plans_view.xml +++ b/addons/sale_analytic_plans/sale_analytic_plans_view.xml @@ -18,10 +18,7 @@ form - + diff --git a/addons/stock/product.py b/addons/stock/product.py index 23fa32b7e27..35e49f5f95e 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -21,6 +21,8 @@ ############################################################################## from osv import fields, osv +from tools.translate import _ + class product_product(osv.osv): _inherit = "product.product" @@ -161,36 +163,36 @@ class product_product(osv.osv): if fields: if location_info.usage == 'supplier': if fields.get('virtual_available'): - res['fields']['virtual_available']['string'] = 'Futur Receptions' + res['fields']['virtual_available']['string'] = _('Futur Receptions') if fields.get('qty_available'): - res['fields']['qty_available']['string'] = 'Received Qty' + res['fields']['qty_available']['string'] = _('Received Qty') if location_info.usage == 'internal': if fields.get('virtual_available'): - res['fields']['virtual_available']['string'] = 'Futur Stock' + res['fields']['virtual_available']['string'] = _('Futur Stock') if location_info.usage == 'customer': if fields.get('virtual_available'): - res['fields']['virtual_available']['string'] = 'Futur Deliveries' + res['fields']['virtual_available']['string'] = _('Futur Deliveries') if fields.get('qty_available'): - res['fields']['qty_available']['string'] = 'Delivered Qty' + res['fields']['qty_available']['string'] = _('Delivered Qty') if location_info.usage == 'inventory': if fields.get('virtual_available'): - res['fields']['virtual_available']['string'] = 'Futur P&L' - res['fields']['qty_available']['string'] = 'P&L Qty' + res['fields']['virtual_available']['string'] = _('Futur P&L') + res['fields']['qty_available']['string'] = _('P&L Qty') if location_info.usage == 'procurement': if fields.get('virtual_available'): - res['fields']['virtual_available']['string'] = 'Futur Qty' + res['fields']['virtual_available']['string'] = _('Futur Qty') if fields.get('qty_available'): - res['fields']['qty_available']['string'] = 'Unplanned Qty' + res['fields']['qty_available']['string'] = _('Unplanned Qty') if location_info.usage == 'production': if fields.get('virtual_available'): - res['fields']['virtual_available']['string'] = 'Futur Productions' + res['fields']['virtual_available']['string'] = _('Futur Productions') if fields.get('qty_available'): - res['fields']['qty_available']['string'] = 'Produced Qty' + res['fields']['qty_available']['string'] = _('Produced Qty') return res product_product() diff --git a/addons/stock/wizard/wizard_return.py b/addons/stock/wizard/wizard_return.py index 44b75ec5e2e..c9a02ce27c0 100644 --- a/addons/stock/wizard/wizard_return.py +++ b/addons/stock/wizard/wizard_return.py @@ -27,6 +27,8 @@ from tools.misc import UpdateableStr import netsvc import time +from tools.translate import _ + arch=UpdateableStr() fields={} @@ -41,7 +43,7 @@ def _get_returns(self, cr, uid, data, context): pick=pick_obj.browse(cr, uid, [data['id']])[0] res={} fields.clear() - arch_lst=['', '
', '