diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 709dd522400..f81cb6c432e 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1256,6 +1256,13 @@ class AccountInvoiceLine(models.Model): return accounts['income'] return accounts['expense'] + def _set_currency(self): + company = self.invoice_id.company_id + currency = self.invoice_id.currency_id + if company and currency: + if company.currency_id != currency: + self.price_unit = self.price_unit * currency.with_context(dict(self._context or {}, date=self.invoice_id.date_invoice)).rate + def _set_taxes(self): """ Used in on_change to set taxes and price.""" if self.invoice_id.type in ('out_invoice', 'out_refund'): @@ -1274,8 +1281,10 @@ class AccountInvoiceLine(models.Model): prec = self.env['decimal.precision'].precision_get('Product Price') if not self.price_unit or float_compare(self.price_unit, self.product_id.standard_price, precision_digits=prec) == 0: self.price_unit = fix_price(self.product_id.standard_price, taxes, fp_taxes) + self._set_currency() else: self.price_unit = fix_price(self.product_id.lst_price, taxes, fp_taxes) + self._set_currency() @api.onchange('product_id') def _onchange_product_id(self): @@ -1324,8 +1333,6 @@ class AccountInvoiceLine(models.Model): domain['uom_id'] = [('category_id', '=', product.uom_id.category_id.id)] if company and currency: - if company.currency_id != currency: - self.price_unit = self.price_unit * currency.with_context(dict(self._context or {}, date=self.invoice_id.date_invoice)).rate if self.uom_id and self.uom_id.id != product.uom_id.id: self.price_unit = product.uom_id._compute_price(self.price_unit, self.uom_id) diff --git a/addons/account/views/account_journal_dashboard_view.xml b/addons/account/views/account_journal_dashboard_view.xml index 61318f7323d..a08e79ddd33 100644 --- a/addons/account/views/account_journal_dashboard_view.xml +++ b/addons/account/views/account_journal_dashboard_view.xml @@ -240,14 +240,16 @@ -
-
- Latest Statement + +
+
+ Latest Statement +
+
+ +
-
- -
-
+
diff --git a/addons/crm/wizard/base_partner_merge.py b/addons/crm/wizard/base_partner_merge.py index b8b46f2a7dc..b6044efc990 100644 --- a/addons/crm/wizard/base_partner_merge.py +++ b/addons/crm/wizard/base_partner_merge.py @@ -260,7 +260,7 @@ class MergePartnerAutomatic(models.TransientModel): """ _logger.debug('_update_values for dst_partner: %s for src_partners: %r', dst_partner.id, src_partners.ids) - model_fields = dst_partner._fields + model_fields = dst_partner.fields_get().keys() def write_serializer(item): if isinstance(item, models.BaseModel): @@ -269,7 +269,8 @@ class MergePartnerAutomatic(models.TransientModel): return item # get all fields that are not computed or x2many values = dict() - for column, field in model_fields.iteritems(): + for column in model_fields: + field = dst_partner._fields[column] if field.type not in ('many2many', 'one2many') and field.compute is None: for item in itertools.chain(src_partners, [dst_partner]): if item[column]: diff --git a/doc/cla/corporate/wt-io-it.md b/doc/cla/corporate/wt-io-it.md index 491d580c792..c9bbebc2445 100644 --- a/doc/cla/corporate/wt-io-it.md +++ b/doc/cla/corporate/wt-io-it.md @@ -13,3 +13,4 @@ Wolfgang Taferner wolfgang.taferner@wt-io-it.at https://github.com/wt-io-it List of contributors: Wolfgang Taferner wolfgang.taferner@wt-io-it.at https://github.com/wtaferner +Andreas Perhab andreas.perhab@wt-io-it.at https://github.com/ap-wtioit diff --git a/odoo/addons/base/ir/ir_mail_server.py b/odoo/addons/base/ir/ir_mail_server.py index 2e936a74579..36490b96ee6 100644 --- a/odoo/addons/base/ir/ir_mail_server.py +++ b/odoo/addons/base/ir/ir_mail_server.py @@ -20,6 +20,8 @@ from odoo.tools import html2text, ustr _logger = logging.getLogger(__name__) _test_logger = logging.getLogger('odoo.tests') +SMTP_TIMEOUT = 60 + class MailDeliveryException(except_orm): """Specific exception subclass for mail delivery errors""" @@ -205,9 +207,9 @@ class IrMailServer(models.Model): if not 'SMTP_SSL' in smtplib.__all__: raise UserError(_("Your OpenERP Server does not support SMTP-over-SSL. You could use STARTTLS instead." "If SSL is needed, an upgrade to Python 2.6 on the server-side should do the trick.")) - connection = smtplib.SMTP_SSL(host, port) + connection = smtplib.SMTP_SSL(host, port, timeout=SMTP_TIMEOUT) else: - connection = smtplib.SMTP(host, port) + connection = smtplib.SMTP(host, port, timeout=SMTP_TIMEOUT) connection.set_debuglevel(smtp_debug) if encryption == 'starttls': # starttls() will perform ehlo() if needed first diff --git a/odoo/addons/base/security/base_security.xml b/odoo/addons/base/security/base_security.xml index ff22b286ac9..42bd5d92267 100644 --- a/odoo/addons/base/security/base_security.xml +++ b/odoo/addons/base/security/base_security.xml @@ -152,7 +152,7 @@ res.partner.rule.private.employee - [('type', '!=', 'private')] + ['|', ('type', '!=', 'private'), ('type', '=', False)]