[MERGE] forward port branch 9.0 up to 06a085b25f
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -240,14 +240,16 @@
|
||||
<span><t t-esc="dashboard.account_balance"/></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" name="latest_statement" t-if="dashboard.last_balance != dashboard.account_balance">
|
||||
<div class="col-xs-6">
|
||||
<span title="Latest Statement">Latest Statement</span>
|
||||
<t t-if="dashboard.last_balance != dashboard.account_balance">
|
||||
<div class="row" name="latest_statement">
|
||||
<div class="col-xs-6">
|
||||
<span title="Latest Statement">Latest Statement</span>
|
||||
</div>
|
||||
<div class="col-xs-6 text-right">
|
||||
<span><t t-esc="dashboard.last_balance"/></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 text-right">
|
||||
<span><t t-esc="dashboard.last_balance"/></span>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="JournalBodySalePurchase">
|
||||
|
||||
@@ -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]:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
<field name="name">res.partner.rule.private.employee</field>
|
||||
<field name="model_id" ref="base.model_res_partner"/>
|
||||
<field name="domain_force">
|
||||
[('type', '!=', 'private')]
|
||||
['|', ('type', '!=', 'private'), ('type', '=', False)]
|
||||
</field>
|
||||
<field name="groups" eval="[
|
||||
(4, ref('base.group_user')),
|
||||
|
||||
Reference in New Issue
Block a user