diff --git a/addons/account/account.py b/addons/account/account.py index d145f0308b0..c2e6f3d1221 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -601,7 +601,7 @@ class account_account(osv.osv): if not default: default = {} default = default.copy() - default['code'] = (account['code'] or '') + '(copy)' + default.update(code=_("%s (copy)") % (account['code'] or '')) if not local: done_list = [] if account.id in done_list: @@ -782,9 +782,10 @@ class account_journal(osv.osv): if not default: default = {} default = default.copy() - default['code'] = (journal['code'] or '') + '(copy)' - default['name'] = (journal['name'] or '') + '(copy)' - default['sequence_id'] = False + default.update( + code=_("%s (copy)") % (journal['code'] or ''), + name=_("%s (copy)") % (journal['name'] or ''), + sequence_id=False) return super(account_journal, self).copy(cr, uid, id, default, context=context) def write(self, cr, uid, ids, vals, context=None): diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 2aed5b02107..5ddbbee74f2 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -736,7 +736,7 @@ class account_move_line(osv.osv): WHERE debit > 0 AND credit > 0 ORDER BY last_reconciliation_date""") ids = cr.fetchall() - ids = len(ids) and list(ids[0]) or [] + ids = len(ids) and [x[0] for x in ids] or [] return self.pool.get('res.partner').name_get(cr, uid, ids, context=context) def reconcile_partial(self, cr, uid, ids, type='auto', context=None, writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False): diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index 53f2b54e0ef..8f879d6b465 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -122,6 +122,14 @@ other + + X11007 + USD Bank Account - (test) + + liquidity + + + Liabilities - (test) @@ -360,8 +368,8 @@ bank - - + + @@ -412,6 +420,16 @@ + + + USD Bank Journal - (test) + TUBK + bank + + + + + diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index 5ca9f26b96b..442b51466f8 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -1,5 +1,6 @@ - + + Invoicing & Payments @@ -7,11 +8,13 @@ + Accountant + Manager @@ -25,100 +28,107 @@ Account Entry - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - Entry lines - - + Entry lines + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] Journal Period - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - + Journal multi-company - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] Analytic journal multi-company - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] Period multi-company - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] Fiscal year multi-company - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] Account multi-company - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - Tax multi-company - - + Tax multi-company + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] Tax code multi-company - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] Invoice multi-company - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] Invoice Analysis multi-company - - + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + Entries Analysis multi-company + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] Account fiscal Mapping company rule - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] Account model company rule - - + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] @@ -143,4 +153,5 @@ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - + + diff --git a/addons/account_coda/account_coda.py b/addons/account_coda/account_coda.py index cd117b5be88..1aa6e84402a 100644 --- a/addons/account_coda/account_coda.py +++ b/addons/account_coda/account_coda.py @@ -107,11 +107,12 @@ class coda_bank_account(osv.osv): if not default: default = {} default = default.copy() - default.update({'journal_id': None}) - default['description1'] = cba['description1'] or '' - default['description2'] = cba['description2'] or '' - default['name'] = (cba['name'] or '') + ' (copy)' - default['state'] = cba['state'] + default.update( + journal_id=None, + description1=cba['description1'] or '', + description2=cba['description2'] or '', + name=_("%s (copy)") % (cba['name'] or ''), + state=cba['state']) return super(coda_bank_account, self).copy(cr, uid, id, default, context) def onchange_state(self, cr, uid, ids, state): diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index d3a22782a68..269bf24ed61 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -223,9 +223,10 @@ class account_analytic_account(osv.osv): if not default: default = {} analytic = self.browse(cr, uid, id, context=context) - default['code'] = False - default['line_ids'] = [] - default['name'] = analytic['name'] + ' (' + _('copy') + ')' + default.update( + code=False, + line_ids=[], + name=_("%s (copy)") % (analytic['name'])) return super(account_analytic_account, self).copy(cr, uid, id, default, context=context) def on_change_company(self, cr, uid, id, company_id): diff --git a/addons/document/document.py b/addons/document/document.py index 3ee52f8e4fb..cb30e5f93c9 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -209,7 +209,7 @@ class document_file(osv.osv): default = {} if 'name' not in default: name = self.read(cr, uid, [id], ['name'])[0]['name'] - default.update({'name': name + " " + _("(copy)")}) + default.update(name=_("%s (copy)") % (name)) return super(document_file, self).copy(cr, uid, id, default, context=context) def write(self, cr, uid, ids, vals, context=None): diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index 1ead23ab402..ac0671d36d3 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -231,7 +231,7 @@ class document_directory(osv.osv): if not default: default ={} name = self.read(cr, uid, [id])[0]['name'] - default.update({'name': name+ " (copy)"}) + default.update(name=_("%s (copy)") % (name)) return super(document_directory,self).copy(cr, uid, id, default, context=context) def _check_duplication(self, cr, uid, vals, ids=[], op='create'): diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 4080e62f002..1dc79dc634c 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -215,7 +215,10 @@ class email_template(osv.osv): if default is None: default = {} default = default.copy() - default['name'] = template.name + _('(copy)') + default.update( + name=_("%s (copy)") % (template.name), + ref_ir_act_window=False, + ref_ir_value=False) return super(email_template, self).copy(cr, uid, id, default, context) def build_expression(self, field_name, sub_field_name, null_value): @@ -335,7 +338,7 @@ class email_template(osv.osv): :param bool force_send: if True, the generated mail.message is immediately sent after being created, as if the scheduler was executed for this message only. - :returns: id of the mail.message that was created + :returns: id of the mail.message that was created """ if context is None: context = {} mail_mail = self.pool.get('mail.mail') diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 6a2e40b9571..08dacc9a951 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -81,10 +81,9 @@ class hr_payroll_structure(osv.osv): """ if not default: default = {} - default.update({ - 'code': self.browse(cr, uid, id, context=context).code + "(copy)", - 'company_id': self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id - }) + default.update( + code=_("%s (copy)") % (self.browse(cr, uid, id, context=context).code), + company_id=self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id) return super(hr_payroll_structure, self).copy(cr, uid, id, default, context=context) def get_all_rules(self, cr, uid, structure_ids, context=None): @@ -305,7 +304,7 @@ class hr_payslip(osv.osv): return False return True - _constraints = [(_check_dates, "Payslip 'Date From' must be before 'Date To'.", ['date_from', 'date_to'])] + _constraints = [(_check_dates, "Payslip 'Date From' must be before 'Date To'.", ['date_from', 'date_to'])] def copy(self, cr, uid, id, default=None, context=None): if not default: @@ -851,7 +850,7 @@ result = rules.NET > categories.NET * 0.10''', """ :param rule_id: id of rule to compute :param localdict: dictionary containing the environement in which to compute the rule - :return: returns a tuple build as the base/amount computed, the quantity and the rate + :return: returns a tuple build as the base/amount computed, the quantity and the rate :rtype: (float, float, float) """ rule = self.browse(cr, uid, rule_id, context=context) diff --git a/addons/l10n_ch/journal_data.xml b/addons/l10n_ch/journal_data.xml index 04870ca936b..ede9136c3d2 100644 --- a/addons/l10n_ch/journal_data.xml +++ b/addons/l10n_ch/journal_data.xml @@ -19,6 +19,7 @@ + diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index ae29ad324db..94ee4bdb3b2 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -356,7 +356,7 @@ class mrp_bom(osv.osv): if default is None: default = {} bom_data = self.read(cr, uid, id, [], context=context) - default.update({'name': bom_data['name'] + ' ' + _('Copy'), 'bom_id':False}) + default.update(name=_("%s (copy)") % (bom_data['name']), bom_id=False) return super(mrp_bom, self).copy_data(cr, uid, id, default, context=context) def create(self, cr, uid, vals, context=None): diff --git a/addons/portal_sale/security/portal_security.xml b/addons/portal_sale/security/portal_security.xml index 8028d5360c4..2f161a73281 100644 --- a/addons/portal_sale/security/portal_security.xml +++ b/addons/portal_sale/security/portal_security.xml @@ -12,7 +12,7 @@ Portal Personal Delivery Orders - + [('partner_id','child_of',[user.partner_id.id])] diff --git a/addons/product/product.py b/addons/product/product.py index ab282e722c0..8bc0789d44b 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -727,7 +727,7 @@ class product_product(osv.osv): context_wo_lang.pop('lang', None) product = self.read(cr, uid, id, ['name'], context=context_wo_lang) default = default.copy() - default['name'] = product['name'] + ' (' + _('copy') + ')' + default.update(name=_("%s (copy)") % (product['name'])) if context.get('variant',False): fields = ['product_tmpl_id', 'active', 'variants', 'default_code', @@ -897,4 +897,43 @@ class pricelist_partnerinfo(osv.osv): } _order = 'min_quantity asc' pricelist_partnerinfo() + +class res_currency(osv.osv): + _inherit = 'res.currency' + + def _check_main_currency_rounding(self, cr, uid, ids, context=None): + cr.execute('SELECT digits FROM decimal_precision WHERE name like %s',('Account',)) + digits = cr.fetchone() + if digits and len(digits): + digits = digits[0] + main_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id + for currency_id in ids: + if currency_id == main_currency.id: + if main_currency.rounding < 10 ** -digits: + return False + return True + + _constraints = [ + (_check_main_currency_rounding, 'Error! You cannot define a rounding factor for the company\'s main currency that is smaller than the decimal precision of \'Account\'.', ['rounding']), + ] + +class decimal_precision(osv.osv): + _inherit = 'decimal.precision' + + def _check_main_currency_rounding(self, cr, uid, ids, context=None): + cr.execute('SELECT id, digits FROM decimal_precision WHERE name like %s',('Account',)) + res = cr.fetchone() + if res and len(res): + account_precision_id, digits = res + main_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id + for decimal_precision in ids: + if decimal_precision == account_precision_id: + if main_currency.rounding < 10 ** -digits: + return False + return True + + _constraints = [ + (_check_main_currency_rounding, 'Error! You cannot define the decimal precision of \'Account\' as greater than the rounding factor of the company\'s main currency', ['digits']), + ] + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project/project.py b/addons/project/project.py index f15656905ca..3572fd094b3 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -323,7 +323,7 @@ class project(osv.osv): default.pop('alias_id', None) proj = self.browse(cr, uid, id, context=context) if not default.get('name', False): - default['name'] = proj.name + _(' (copy)') + default.update(name=_("%s (copy)") % (proj.name)) res = super(project, self).copy(cr, uid, id, default, context) self.map_tasks(cr,uid,id,res,context) return res @@ -344,7 +344,7 @@ class project(osv.osv): new_date_end = (datetime(*time.strptime(new_date_start,'%Y-%m-%d')[:3])+(end_date-start_date)).strftime('%Y-%m-%d') context.update({'copy':True}) new_id = self.copy(cr, uid, proj.id, default = { - 'name': proj.name +_(' (copy)'), + 'name':_("%s (copy)") % (proj.name), 'state':'open', 'date_start':new_date_start, 'date':new_date_end, @@ -694,7 +694,7 @@ class task(base_stage, osv.osv): if not default.get('name', False): default['name'] = self.browse(cr, uid, id, context=context).name or '' if not context.get('copy',False): - new_name = _("%s (copy)")%default.get('name','') + new_name = _("%s (copy)") % (default.get('name', '')) default.update({'name':new_name}) return super(task, self).copy_data(cr, uid, id, default, context) diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 6121acbd607..f39be0c09d5 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -355,7 +355,7 @@ class project_issue(base_stage, osv.osv): if not default: default = {} default = default.copy() - default['name'] = issue['name'] + _(' (copy)') + default.update(name=_('%s (copy)') % (issue['name'])) return super(project_issue, self).copy(cr, uid, id, default=default, context=context) @@ -534,7 +534,7 @@ class project(osv.osv): def _get_alias_models(self, cr, uid, context=None): return [('project.task', "Tasks"), ("project.issue", "Issues")] - + def _issue_count(self, cr, uid, ids, field_name, arg, context=None): res = dict.fromkeys(ids, 0) issue_ids = self.pool.get('project.issue').search(cr, uid, [('project_id', 'in', ids)]) @@ -557,7 +557,7 @@ class project(osv.osv): _constraints = [ (_check_escalation, 'Error! You cannot assign escalation to the same project!', ['project_escalation_id']) ] - + project() class account_analytic_account(osv.osv): diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index 2eab5fa6ac6..5b88d5209c8 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -138,7 +138,7 @@ class project_phase(osv.osv): if default is None: default = {} if not default.get('name', False): - default['name'] = self.browse(cr, uid, id, context=context).name + _(' (copy)') + default.update(name=_('%s (copy)') % (self.browse(cr, uid, id, context=context).name)) return super(project_phase, self).copy(cr, uid, id, default, context) def set_draft(self, cr, uid, ids, *args): @@ -227,7 +227,7 @@ class project(osv.osv): 'phase_ids': fields.one2many('project.phase', 'project_id', "Project Phases"), 'phase_count': fields.function(_phase_count, type='integer', string="Open Phases"), } - + def schedule_phases(self, cr, uid, ids, context=None): context = context or {} if type(ids) in (long, int,): @@ -250,7 +250,7 @@ class project(osv.osv): # Maybe it's better to update than unlink/create if it already exists ? p = getattr(project_gantt, 'Phase_%d' % (phase.id,)) - self.pool.get('project.user.allocation').unlink(cr, uid, + self.pool.get('project.user.allocation').unlink(cr, uid, [x.id for x in phase.user_ids], context=context ) diff --git a/addons/resource/resource.py b/addons/resource/resource.py index 354e9c5b27c..ed21eea85cc 100644 --- a/addons/resource/resource.py +++ b/addons/resource/resource.py @@ -45,24 +45,24 @@ class resource_calendar(osv.osv): def working_hours_on_day(self, cr, uid, resource_calendar_id, day, context=None): """Calculates the Working Total Hours based on Resource Calendar and given working day (datetime object). - + @param resource_calendar_id: resource.calendar browse record @param day: datetime object - + @return: returns the working hours (as float) men should work on the given day if is in the attendance_ids of the resource_calendar_id (i.e if that day is a working day), returns 0.0 otherwise """ res = 0.0 for working_day in resource_calendar_id.attendance_ids: if (int(working_day.dayofweek) + 1) == day.isoweekday(): res += working_day.hour_to - working_day.hour_from - return res + return res def _get_leaves(self, cr, uid, id, resource): - """Private Method to Calculate resource Leaves days - + """Private Method to Calculate resource Leaves days + @param id: resource calendar id - @param resource: resource id for which leaves will ew calculated - + @param resource: resource id for which leaves will ew calculated + @return : returns the list of dates, where resource on leave in resource.calendar.leaves object (e.g.['%Y-%m-%d', '%Y-%m-%d']) """ @@ -85,9 +85,9 @@ class resource_calendar(osv.osv): """ Calculates the working Schedule from supplied from date to till hours will be satisfied based or resource calendar id. If resource is also - given then it will consider the resource leave also and than will + given then it will consider the resource leave also and than will calculates resource working schedule - + @param dt_from: datetime object, start of working scheduled @param hours: float, total number working hours needed scheduled from start date @@ -187,29 +187,29 @@ class resource_calendar(osv.osv): def interval_get(self, cr, uid, id, dt_from, hours, resource=False, byday=True): """Calculates Resource Working Internal Timing Based on Resource Calendar. - + @param dt_from: start resource schedule calculation. @param hours : total number of working hours to be scheduled. - @param resource: optional resource id, If supplied it will take care of + @param resource: optional resource id, If supplied it will take care of resource leave while scheduling. @param byday: boolean flag bit enforce day wise scheduling - + @return : list of scheduled working timing based on resource calendar. """ res = self.interval_get_multi(cr, uid, [(dt_from.strftime('%Y-%m-%d %H:%M:%S'), hours, id)], resource, byday)[(dt_from.strftime('%Y-%m-%d %H:%M:%S'), hours, id)] return res def interval_hours_get(self, cr, uid, id, dt_from, dt_to, resource=False): - """ Calculates the Total Working hours based on given start_date to - end_date, If resource id is supplied that it will consider the source + """ Calculates the Total Working hours based on given start_date to + end_date, If resource id is supplied that it will consider the source leaves also in calculating the hours. - + @param dt_from : date start to calculate hours @param dt_end : date end to calculate hours @param resource: optional resource id, If given resource leave will be - considered. - - @return : Total number of working hours based dt_from and dt_end and + considered. + + @return : Total number of working hours based dt_from and dt_end and resource if supplied. """ if not id: @@ -257,7 +257,7 @@ resource_calendar() class resource_calendar_attendance(osv.osv): _name = "resource.calendar.attendance" _description = "Work Detail" - + _columns = { 'name' : fields.char("Name", size=64, required=True), 'dayofweek': fields.selection([('0','Monday'),('1','Tuesday'),('2','Wednesday'),('3','Thursday'),('4','Friday'),('5','Saturday'),('6','Sunday')], 'Day of Week', required=True, select=True), @@ -266,9 +266,9 @@ class resource_calendar_attendance(osv.osv): 'hour_to' : fields.float("Work to", required=True), 'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True), } - + _order = 'dayofweek, hour_from' - + _defaults = { 'dayofweek' : '0' } @@ -302,12 +302,12 @@ class resource_resource(osv.osv): 'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'resource.resource', context=context) } - + def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} if not default.get('name', False): - default['name'] = self.browse(cr, uid, id, context=context).name + _(' (copy)') + default.update(name=_('%s (copy)') % (self.browse(cr, uid, id, context=context).name)) return super(resource_resource, self).copy(cr, uid, id, default, context) def generate_resources(self, cr, uid, user_ids, calendar_id, context=None): @@ -368,7 +368,7 @@ class resource_resource(osv.osv): """ if not calendar_id: # Calendar is not specified: working days: 24/7 - return [('fri', '8:0-12:0','13:0-17:0'), ('thu', '8:0-12:0','13:0-17:0'), ('wed', '8:0-12:0','13:0-17:0'), + return [('fri', '8:0-12:0','13:0-17:0'), ('thu', '8:0-12:0','13:0-17:0'), ('wed', '8:0-12:0','13:0-17:0'), ('mon', '8:0-12:0','13:0-17:0'), ('tue', '8:0-12:0','13:0-17:0')] resource_attendance_pool = self.pool.get('resource.calendar.attendance') time_range = "8:00-8:00" diff --git a/addons/stock/i18n/nl.po b/addons/stock/i18n/nl.po index 04c3875df25..e74b8c680eb 100644 --- a/addons/stock/i18n/nl.po +++ b/addons/stock/i18n/nl.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-02-08 01:37+0100\n" -"PO-Revision-Date: 2012-05-10 17:48+0000\n" -"Last-Translator: Raphael Collet (OpenERP) \n" +"PO-Revision-Date: 2012-09-24 13:55+0000\n" +"Last-Translator: Erwin \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 05:56+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-09-25 04:44+0000\n" +"X-Generator: Launchpad (build 16019)\n" #. module: stock #: field:product.product,track_outgoing:0 @@ -1179,7 +1179,7 @@ msgstr "Auteur" #: code:addons/stock/stock.py:1332 #, python-format msgid "Delivery Order" -msgstr "Leveringsbon" +msgstr "Uitgaande levering" #. module: stock #: selection:stock.location,chained_auto_packing:0 @@ -1791,7 +1791,7 @@ msgstr "Voorraadwaarde rekening (inkomend)" #. module: stock #: model:stock.location,name:stock.stock_location_14 msgid "Shelf 2" -msgstr "Schap 2" +msgstr "Plank 2" #. module: stock #: field:stock.report.tracklots,tracking_id:0 diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 329159494d3..332a21895f2 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2300,7 +2300,11 @@ class stock_move(osv.osv): or move.location_id.company_id != move.location_dest_id.company_id): journal_id, acc_src, acc_dest, acc_valuation = self._get_accounting_data_for_valuation(cr, uid, move, src_company_ctx) reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx) - account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_valuation, acc_dest, reference_amount, reference_currency_id, context))] + #returning goods to supplier + if move.location_dest_id.usage == 'supplier': + account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_valuation, acc_src, reference_amount, reference_currency_id, context))] + else: + account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_valuation, acc_dest, reference_amount, reference_currency_id, context))] # Incoming moves (or cross-company input part) if move.location_dest_id.company_id \ @@ -2308,7 +2312,11 @@ class stock_move(osv.osv): or move.location_id.company_id != move.location_dest_id.company_id): journal_id, acc_src, acc_dest, acc_valuation = self._get_accounting_data_for_valuation(cr, uid, move, dest_company_ctx) reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx) - account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_src, acc_valuation, reference_amount, reference_currency_id, context))] + #goods return from customer + if move.location_id.usage == 'customer': + account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_dest, acc_valuation, reference_amount, reference_currency_id, context))] + else: + account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_src, acc_valuation, reference_amount, reference_currency_id, context))] move_obj = self.pool.get('account.move') for j_id, move_lines in account_moves: diff --git a/addons/survey/survey.py b/addons/survey/survey.py index 0239f8bf32f..2426ae5eeed 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -94,7 +94,7 @@ class survey(osv.osv): def copy(self, cr, uid, ids, default=None, context=None): vals = {} current_rec = self.read(cr, uid, ids, context=context) - title = current_rec.get('title') + ' (Copy)' + title = _("%s (copy)") % (current_rec.get('title')) vals.update({'title':title}) vals.update({'history':[],'tot_start_survey':0,'tot_comp_survey':0}) return super(survey, self).copy(cr, uid, ids, vals, context=context) @@ -143,7 +143,7 @@ class survey(osv.osv): 'nodestroy':True, } return report - + def fill_survey(self, cr, uid, ids, context=None): sur_obj = self.read(cr, uid, ids,['title'], context=context) for sur in sur_obj: @@ -232,7 +232,7 @@ class survey_page(osv.osv): def copy(self, cr, uid, ids, default=None, context=None): vals = {} current_rec = self.read(cr, uid, ids, context=context) - title = current_rec.get('title') + ' (Copy)' + title = _("%s (copy)") % (current_rec.get('title')) vals.update({'title':title}) return super(survey_page, self).copy(cr, uid, ids, vals, context=context)