[MERGE] forward port branch saas-14 up to ce5b4b6512

This commit is contained in:
Christophe Simonis
2018-03-27 16:41:47 +02:00
6 changed files with 21 additions and 4 deletions
+11
View File
@@ -263,6 +263,17 @@ class MrpProduction(models.Model):
self.location_src_id = self.picking_type_id.default_location_src_id.id or location.id
self.location_dest_id = self.picking_type_id.default_location_dest_id.id or location.id
@api.multi
def write (self, vals):
res = super(MrpProduction, self).write(vals)
if 'date_planned_start' in vals:
moves = (self.mapped('move_raw_ids') + self.mapped('move_finished_ids')).filtered(
lambda r: r.state not in ['done', 'cancel'])
moves.write({
'date_expected': vals['date_planned_start'],
})
return res
@api.model
def create(self, values):
if not values.get('name', False) or values['name'] == _('New'):
@@ -142,7 +142,7 @@ class AuthorizeAPI():
etree.SubElement(billTo, "address").text = (partner.street or '' + (partner.street2 if partner.street2 else '')) or None
etree.SubElement(billTo, "city").text = partner.city
etree.SubElement(billTo, "state").text = partner.state_id.name or None
etree.SubElement(billTo, "zip").text = partner.zip
etree.SubElement(billTo, "zip").text = partner.zip or ''
etree.SubElement(billTo, "country").text = partner.country_id.name or None
payment = etree.SubElement(payment_profile, "payment")
creditCard = etree.SubElement(payment, "creditCard")
@@ -75,7 +75,7 @@
<field name="inherit_id" ref="account.view_invoice_line_form"/>
<field name="arch" type="xml">
<field name="account_id" position="before">
<field name="purchase_id"/>
<field name="purchase_id" invisible="context.get('type') in ('out_invoice', 'out_refund')"/>
</field>
</field>
</record>
+1 -1
View File
@@ -166,7 +166,7 @@
<t t-set="additional_title">Shop</t>
<div id="wrap" class="js_sale">
<div class="oe_structure" />
<div t-attf-class="container oe_website_sale #{'oe_website_sale_search' if search else None}">
<div class="container oe_website_sale">
<div class="products_pager">
<div class="row" style="width: 100%;">
<t t-call="website_sale.search">
+1
View File
@@ -441,6 +441,7 @@ class IrMailServer(models.Model):
email_to = message['To']
email_cc = message['Cc']
email_bcc = message['Bcc']
del message['Bcc']
smtp_to_list = filter(None, tools.flatten(map(extract_rfc2822_addresses, [email_to, email_cc, email_bcc])))
assert smtp_to_list, self.NO_VALID_RECIPIENT
+6 -1
View File
@@ -464,13 +464,18 @@ class IrTranslation(models.Model):
continue
# remap existing translations on terms when possible
trans_src = record_trans.mapped('src')
for trans in record_trans:
if trans.src == trans.value:
discarded += trans
elif trans.src not in terms:
matches = get_close_matches(trans.src, terms, 1, 0.9)
if matches:
trans.write({'src': matches[0], 'state': trans.state})
if matches[0] in trans_src:
# there is already a translation for this term; discard this one
discarded += trans
else:
trans.write({'src': matches[0], 'state': trans.state})
else:
outdated += trans