From e78a08e33659702c4fec78f16ca7338b7d4c50d9 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 26 Mar 2018 11:23:59 +0200 Subject: [PATCH 1/3] [FIX] mrp: date expected - Create a MO - Change the date 'Deadline Start' The corresponding 'Expected Date' on the stock moves is not updated with the new value. opw-1828631 --- addons/mrp/models/mrp_production.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 162e83b015f..16325a98500 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -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'): From f289451ce5f6806567e6c739940e0e3426920c38 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 27 Mar 2018 10:35:55 +0200 Subject: [PATCH 2/3] [FIX] payment_authorize: raise error if missing ZIP The ZIP code is an optional field. When saving a payment method, this generates a traceback since `partner.zip` is `False` while the field expects a `string`. opw-1829829 --- addons/payment_authorize/models/authorize_request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment_authorize/models/authorize_request.py b/addons/payment_authorize/models/authorize_request.py index f7aca95511d..fef82365b71 100644 --- a/addons/payment_authorize/models/authorize_request.py +++ b/addons/payment_authorize/models/authorize_request.py @@ -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") From fc659d3f78cb3c42e742ad9fa47a3df8d2d72b9b Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 8 Jan 2018 15:48:52 +0100 Subject: [PATCH 3/3] [FIX] sale: Description of the product 'Downpayment' not translated When you create a down payment invoice from an SO, the product that is used in the line is 'Down Payment'. The description of this product, which is visible for the customer, was not translated to the language of the customer in the SO and in the invoice. It was translated to the language of the user logged. This fix is made to keep the same behavior for the description of an SO line and for the description of the invoice line. opw:1820081 --- addons/sale/wizard/sale_make_invoice_advance.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 7f27ccf4570..eca97519e48 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -76,12 +76,14 @@ class SaleAdvancePaymentInv(models.TransientModel): if self.amount <= 0.00: raise UserError(_('The value of the down payment amount must be positive.')) + context = {'lang': order.partner_id.lang} if self.advance_payment_method == 'percentage': amount = order.amount_untaxed * self.amount / 100 name = _("Down payment of %s%%") % (self.amount,) else: amount = self.amount name = _('Down Payment') + del context taxes = self.product_id.taxes_id.filtered(lambda r: not order.company_id or r.company_id == order.company_id) if order.fiscal_position_id and taxes: tax_ids = order.fiscal_position_id.map_tax(taxes).ids @@ -152,6 +154,7 @@ class SaleAdvancePaymentInv(models.TransientModel): tax_ids = order.fiscal_position_id.map_tax(taxes).ids else: tax_ids = taxes.ids + context = {'lang': order.partner_id.lang} so_line = sale_line_obj.create({ 'name': _('Advance: %s') % (time.strftime('%m %Y'),), 'price_unit': amount, @@ -162,6 +165,7 @@ class SaleAdvancePaymentInv(models.TransientModel): 'product_id': self.product_id.id, 'tax_id': [(6, 0, tax_ids)], }) + del context self._create_invoice(order, so_line, amount) if self._context.get('open_invoices', False): return sale_orders.action_view_invoice()