diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 43aaa2f58c1..a380a69dc03 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -99,7 +99,6 @@ for a particular financial year and for preparation of vouchers there is a modul 'project/wizard/project_account_analytic_line_view.xml', 'account_end_fy.xml', 'account_invoice_view.xml', - 'partner_view.xml', 'data/account_data.xml', 'data/data_account_type.xml', 'data/configurable_account_chart.xml', @@ -112,6 +111,7 @@ for a particular financial year and for preparation of vouchers there is a modul 'project/wizard/account_analytic_journal_report_view.xml', 'project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml', 'project/wizard/account_analytic_chart_view.xml', + 'partner_view.xml', 'product_view.xml', 'account_assert_test.xml', 'process/statement_process.xml', diff --git a/addons/account/account.py b/addons/account/account.py index 3959799f1bb..e92bd3a7879 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1670,7 +1670,7 @@ class account_move_reconcile(osv.osv): elif reconcile.line_partial_ids: first_partner = reconcile.line_partial_ids[0].partner_id.id move_lines = reconcile.line_partial_ids - if any([line.partner_id.id != first_partner for line in move_lines]): + if any([(line.account_id.type in ('receivable', 'payable') and line.partner_id.id != first_partner) for line in move_lines]): return False return True diff --git a/addons/account/account_financial_report_data.xml b/addons/account/account_financial_report_data.xml index 6410a5e887c..e8ff33151c3 100644 --- a/addons/account/account_financial_report_data.xml +++ b/addons/account/account_financial_report_data.xml @@ -6,16 +6,19 @@ --> Profit and Loss + sum Income + detail_with_hierarchy account_type Expense + detail_with_hierarchy account_type diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml index 58e824a6250..b03babc63ac 100644 --- a/addons/account/account_installer.xml +++ b/addons/account/account_installer.xml @@ -20,10 +20,11 @@

+ - +
@@ -76,6 +76,7 @@ Website Design Templates project.task + employees @@ -89,6 +90,7 @@ Data Import/Export Plugin project.task + followers diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 0d2c139ce86..eb042e5f0c7 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -52,7 +52,8 @@ kanban,tree,form,calendar,gantt,graph { 'search_default_project_id': [active_id], - 'default_project_id': active_id, + 'default_project_id': active_id, + 'active_test': False, } diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml index 4bbaa9b788e..e674019443b 100644 --- a/addons/project/security/project_security.xml +++ b/addons/project/security/project_security.xml @@ -75,15 +75,13 @@ - Project/Task: employees: public or employee or following or assigned + Project/Task: employees: public or employee or (followers and following) ['|', - ('user_id', '=', user.id), - '|', - ('project_id.privacy_visibility', 'in', ['public', 'employees']), - '&', - ('project_id.privacy_visibility', '=', 'followers'), - ('message_follower_ids', 'in', [user.partner_id.id]), + ('project_id.privacy_visibility', 'in', ['public', 'employees']), + '&', + ('project_id.privacy_visibility', '=', 'followers'), + ('message_follower_ids', 'in', [user.partner_id.id]), ] diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml index 1467ce55fab..4bfd5b783c7 100644 --- a/addons/project_gtd/project_gtd_view.xml +++ b/addons/project_gtd/project_gtd_view.xml @@ -106,6 +106,8 @@ + + diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 517d335aa48..a008c670138 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -495,10 +495,10 @@ class project_issue(base_stage, osv.osv): def message_get_suggested_recipients(self, cr, uid, ids, context=None): recipients = super(project_issue, self).message_get_suggested_recipients(cr, uid, ids, context=context) for issue in self.browse(cr, uid, ids, context=context): - if issue.partner_id: - self._message_add_suggested_recipient(cr, uid, recipients, issue, partner=issue.partner_id, reason=_('Customer')) - elif issue.email_from: + if issue.email_from: self._message_add_suggested_recipient(cr, uid, recipients, issue, email=issue.email_from, reason=_('Customer Email')) + elif issue.partner_id: + self._message_add_suggested_recipient(cr, uid, recipients, issue, partner=issue.partner_id, reason=_('Customer')) return recipients def message_new(self, cr, uid, msg, custom_values=None, context=None): diff --git a/addons/project_issue/security/project_issue_security.xml b/addons/project_issue/security/project_issue_security.xml index 5215a94a8b7..c8ed12086e4 100644 --- a/addons/project_issue/security/project_issue_security.xml +++ b/addons/project_issue/security/project_issue_security.xml @@ -10,15 +10,13 @@ - Project/Issue: employees: public or employee or following or assigned + Project/Issue: employees: public or employee or (followers and following) ['|', - '|', - ('project_id.privacy_visibility', 'in', ['public', 'employees']), - '&', - ('project_id.privacy_visibility', '=', 'followers'), - ('message_follower_ids', 'in', [user.id]), - ('user_id', '=', user.id), + ('project_id.privacy_visibility', 'in', ['public', 'employees']), + '&', + ('project_id.privacy_visibility', '=', 'followers'), + ('message_follower_ids', 'in', [user.id]), ] diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 26e34048b40..849e558563a 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -640,7 +640,7 @@ class purchase_order(osv.osv): 'product_uom': order_line.product_uom.id, 'product_uos': order_line.product_uom.id, 'date': self.date_to_datetime(cr, uid, order.date_order, context), - 'date_expected': self.date_to_datetime(cr, uid, order.date_order, context), + 'date_expected': self.date_to_datetime(cr, uid, order_line.date_planned, context), 'location_id': order.partner_id.property_stock_supplier.id, 'location_dest_id': order.location_id.id, 'picking_id': picking_id, @@ -952,7 +952,8 @@ class purchase_order_line(osv.osv): lang = res_partner.browse(cr, uid, partner_id).lang context_partner.update( {'lang': lang, 'partner_id': partner_id} ) product = product_product.browse(cr, uid, product_id, context=context_partner) - name = product.name + #call name_get() with partner in the context to eventually match name and description in the seller_ids field + dummy, name = product_product.name_get(cr, uid, product_id, context=context_partner)[0] if product.description_purchase: name += '\n' + product.description_purchase res['value'].update({'name': name}) diff --git a/addons/purchase_double_validation/test/purchase_double_validation_test.yml b/addons/purchase_double_validation/test/purchase_double_validation_test.yml old mode 100755 new mode 100644 diff --git a/addons/purchase_requisition/test/purchase_requisition_demo.yml b/addons/purchase_requisition/test/purchase_requisition_demo.yml old mode 100755 new mode 100644 diff --git a/addons/report_webkit/__init__.py b/addons/report_webkit/__init__.py index 2c23fd8ed90..e00289407d8 100644 --- a/addons/report_webkit/__init__.py +++ b/addons/report_webkit/__init__.py @@ -25,7 +25,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/addons/report_webkit/__openerp__.py b/addons/report_webkit/__openerp__.py index b962669eee9..f4035a951de 100644 --- a/addons/report_webkit/__openerp__.py +++ b/addons/report_webkit/__openerp__.py @@ -25,7 +25,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/addons/report_webkit/company.py b/addons/report_webkit/company.py index f9ae4191528..b29354938de 100644 --- a/addons/report_webkit/company.py +++ b/addons/report_webkit/company.py @@ -25,7 +25,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/addons/report_webkit/convert.py b/addons/report_webkit/convert.py index b4d42325bb6..e30209a77dc 100644 --- a/addons/report_webkit/convert.py +++ b/addons/report_webkit/convert.py @@ -25,7 +25,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/addons/report_webkit/header.py b/addons/report_webkit/header.py index 9713efc5382..7a290662498 100644 --- a/addons/report_webkit/header.py +++ b/addons/report_webkit/header.py @@ -25,7 +25,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/addons/report_webkit/ir_report.py b/addons/report_webkit/ir_report.py index 4b64a54c420..cea2b4e8329 100644 --- a/addons/report_webkit/ir_report.py +++ b/addons/report_webkit/ir_report.py @@ -25,7 +25,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/addons/report_webkit/report_helper.py b/addons/report_webkit/report_helper.py index af9408b834e..83286dc59bd 100644 --- a/addons/report_webkit/report_helper.py +++ b/addons/report_webkit/report_helper.py @@ -25,7 +25,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 3d8e41c42ff..82061daa758 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -26,7 +26,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/addons/report_webkit/wizard/__init__.py b/addons/report_webkit/wizard/__init__.py index e8ae8b79fc0..e95244cc7aa 100644 --- a/addons/report_webkit/wizard/__init__.py +++ b/addons/report_webkit/wizard/__init__.py @@ -25,7 +25,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/addons/report_webkit/wizard/report_webkit_actions.py b/addons/report_webkit/wizard/report_webkit_actions.py index 5f91d05d671..e22e7948d59 100644 --- a/addons/report_webkit/wizard/report_webkit_actions.py +++ b/addons/report_webkit/wizard/report_webkit_actions.py @@ -25,7 +25,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/addons/resource/faces/observer.py b/addons/resource/faces/observer.py index 894345230ea..28ae58eb2b6 100644 --- a/addons/resource/faces/observer.py +++ b/addons/resource/faces/observer.py @@ -22,7 +22,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ############################################################################ #@-node:<< Copyright >> diff --git a/addons/resource/faces/pcalendar.py b/addons/resource/faces/pcalendar.py index c82c49d4816..24c974233d8 100644 --- a/addons/resource/faces/pcalendar.py +++ b/addons/resource/faces/pcalendar.py @@ -22,7 +22,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ############################################################################ #@-node:<< Copyright >> diff --git a/addons/resource/faces/plocale.py b/addons/resource/faces/plocale.py index 61bfa91917b..908fd1252e9 100644 --- a/addons/resource/faces/plocale.py +++ b/addons/resource/faces/plocale.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ############################################################################ import gettext diff --git a/addons/resource/faces/resource.py b/addons/resource/faces/resource.py index 3451806444e..faee8174994 100644 --- a/addons/resource/faces/resource.py +++ b/addons/resource/faces/resource.py @@ -22,7 +22,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ############################################################################ #@-node:<< Copyright >> diff --git a/addons/resource/faces/task.py b/addons/resource/faces/task.py index 7516f41db2a..961f6213d1d 100644 --- a/addons/resource/faces/task.py +++ b/addons/resource/faces/task.py @@ -22,7 +22,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ############################################################################ #@-node:<< Copyright >> diff --git a/addons/resource/faces/timescale.py b/addons/resource/faces/timescale.py index 3e7c3c1dc89..818c031b7d5 100644 --- a/addons/resource/faces/timescale.py +++ b/addons/resource/faces/timescale.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ############################################################################ import faces.pcalendar as pcal diff --git a/addons/resource/faces/utils.py b/addons/resource/faces/utils.py index 54985767613..6568c314fb5 100644 --- a/addons/resource/faces/utils.py +++ b/addons/resource/faces/utils.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the # Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ############################################################################ import observer diff --git a/addons/resource/resource.py b/addons/resource/resource.py index 944c90a3749..449fa422ab4 100644 --- a/addons/resource/resource.py +++ b/addons/resource/resource.py @@ -25,6 +25,7 @@ from dateutil import rrule import math from faces import * from openerp.osv import fields, osv +from openerp.tools.float_utils import float_compare from openerp.tools.translate import _ from itertools import groupby @@ -108,11 +109,11 @@ class resource_calendar(osv.osv): result = [] maxrecur = 100 current_hour = dt_from.hour - while (todo>0) and maxrecur: + while float_compare(todo, 0, 4) and maxrecur: cr.execute("select hour_from,hour_to from resource_calendar_attendance where dayofweek='%s' and calendar_id=%s order by hour_from desc", (dt_from.weekday(),id)) for (hour_from,hour_to) in cr.fetchall(): leave_flag = False - if (hour_from0): + if (hour_fromtodo: hour_from = m-todo @@ -161,10 +162,10 @@ class resource_calendar(osv.osv): result = [] maxrecur = 100 current_hour = dt_from.hour - while (todo>0) and maxrecur: + while float_compare(todo, 0, 4) and maxrecur: for (hour_from,hour_to) in [(item['hour_from'], item['hour_to']) for item in hours_by_cal[id] if item['dayofweek'] == str(dt_from.weekday())]: leave_flag = False - if (hour_to>current_hour) and (todo>0): + if (hour_to>current_hour) and float_compare(todo, 0, 4): m = max(hour_from, current_hour) if (hour_to-m)>todo: hour_to = m+todo diff --git a/addons/sale/res_partner_view.xml b/addons/sale/res_partner_view.xml index 40ac119fdee..5107f0c17af 100644 --- a/addons/sale/res_partner_view.xml +++ b/addons/sale/res_partner_view.xml @@ -69,27 +69,15 @@ False sale.group_delivery_invoice_address - + + False sale.group_delivery_invoice_address - - False - sale.group_delivery_invoice_address - - - False - sale.group_delivery_invoice_address - - - False - sale.group_delivery_invoice_address - - - False - sale.group_delivery_invoice_address - - + False sale.group_delivery_invoice_address diff --git a/addons/sale/wizard/sale_line_invoice.py b/addons/sale/wizard/sale_line_invoice.py index 83b953cc4d5..3b04319f5c7 100644 --- a/addons/sale/wizard/sale_line_invoice.py +++ b/addons/sale/wizard/sale_line_invoice.py @@ -21,6 +21,7 @@ from openerp.osv import osv, fields from openerp.tools.translate import _ +from openerp import netsvc class sale_order_line_make_invoice(osv.osv_memory): _name = "sale.order.line.make.invoice" @@ -80,6 +81,7 @@ class sale_order_line_make_invoice(osv.osv_memory): sales_order_line_obj = self.pool.get('sale.order.line') sales_order_obj = self.pool.get('sale.order') + wf_service = netsvc.LocalService('workflow') for line in sales_order_line_obj.browse(cr, uid, context.get('active_ids', []), context=context): if (not line.invoiced) and (line.state not in ('draft', 'cancel')): if not line.order_id in invoices: diff --git a/addons/sale_analytic_plans/sale_analytic_plans_view.xml b/addons/sale_analytic_plans/sale_analytic_plans_view.xml index 3600d71b7d4..121efbdf12e 100644 --- a/addons/sale_analytic_plans/sale_analytic_plans_view.xml +++ b/addons/sale_analytic_plans/sale_analytic_plans_view.xml @@ -52,5 +52,17 @@ + + account.invoice.form.analytic.inherit + account.invoice + + + + + + + + + diff --git a/addons/sale_crm/sale_crm.py b/addons/sale_crm/sale_crm.py index d0899729050..3172999c545 100644 --- a/addons/sale_crm/sale_crm.py +++ b/addons/sale_crm/sale_crm.py @@ -31,6 +31,12 @@ class sale_order(osv.osv): domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]") } + def _prepare_invoice(self, cr, uid, order, lines, context=None): + invoice_vals = super(sale_order, self)._prepare_invoice(cr, uid, order, lines, context=context) + if order.section_id and order.section_id.id: + invoice_vals['section_id'] = order.section_id.id + return invoice_vals + class crm_case_section(osv.osv): _inherit = 'crm.case.section' diff --git a/addons/sale_crm/sale_crm_view.xml b/addons/sale_crm/sale_crm_view.xml index eab9d38bf10..31c0317969a 100644 --- a/addons/sale_crm/sale_crm_view.xml +++ b/addons/sale_crm/sale_crm_view.xml @@ -16,6 +16,11 @@ + + + {'stage_type': 'opportunity', 'default_type': 'opportunity', 'default_user_id': uid, 'needaction_menu_ref': 'sale.menu_sale_quotations'} + + sale.order.inherit sale.order diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 764d9de453e..db73bae3b6c 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -29,7 +29,7 @@ from openerp.osv import fields, osv from openerp.tools.translate import _ from openerp import netsvc from openerp import tools -from openerp.tools import float_compare +from openerp.tools import float_compare, DEFAULT_SERVER_DATETIME_FORMAT import openerp.addons.decimal_precision as dp import logging _logger = logging.getLogger(__name__) @@ -647,7 +647,7 @@ class stock_picking(osv.osv): ), 'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date", store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled time for the shipment to be processed"), - 'date': fields.datetime('Time', help="Creation time, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), + 'date': fields.datetime('Creation Date', help="Creation date, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date", store=True, type='datetime', string='Max. Expected Date', select=2), @@ -2323,7 +2323,6 @@ class stock_move(osv.osv): 'line_id': move_lines, 'ref': move.picking_id and move.picking_id.name}) - def action_done(self, cr, uid, ids, context=None): """ Makes the move done and if all moves are done, it will finish the picking. @return: @@ -2369,7 +2368,7 @@ class stock_move(osv.osv): if todo: self.action_confirm(cr, uid, todo, context=context) - self.write(cr, uid, move_ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context) + self.write(cr, uid, move_ids, {'state': 'done', 'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)}, context=context) for id in move_ids: wf_service.trg_trigger(uid, 'stock.move', id, cr) @@ -2412,14 +2411,14 @@ class stock_move(osv.osv): # or if it's the same as that of the secondary amount being posted. account_obj = self.pool.get('account.account') src_acct, dest_acct = account_obj.browse(cr, uid, [src_account_id, dest_account_id], context=context) - src_main_currency_id = src_acct.company_id.currency_id.id - dest_main_currency_id = dest_acct.company_id.currency_id.id + src_main_currency_id = src_acct.currency_id and src_acct.currency_id.id or src_acct.company_id.currency_id.id + dest_main_currency_id = dest_acct.currency_id and dest_acct.currency_id.id or dest_acct.company_id.currency_id.id cur_obj = self.pool.get('res.currency') if reference_currency_id != src_main_currency_id: # fix credit line: credit_line_vals['credit'] = cur_obj.compute(cr, uid, reference_currency_id, src_main_currency_id, reference_amount, context=context) if (not src_acct.currency_id) or src_acct.currency_id.id == reference_currency_id: - credit_line_vals.update(currency_id=reference_currency_id, amount_currency=reference_amount) + credit_line_vals.update(currency_id=reference_currency_id, amount_currency=-reference_amount) if reference_currency_id != dest_main_currency_id: # fix debit line: debit_line_vals['debit'] = cur_obj.compute(cr, uid, reference_currency_id, dest_main_currency_id, reference_amount, context=context) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 6097885175b..b1a1fa048be 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1262,8 +1262,8 @@ - - + +