diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index f440025be26..a62d68ef644 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -540,7 +540,7 @@ class AccountInvoice(models.Model): date_invoice = fields.Date.context_today(self) if not self.payment_term_id: # When no payment terms defined - self.date_due = self.date_due or self.date_invoice + self.date_due = self.date_due or date_invoice else: pterm = self.payment_term_id pterm_list = pterm.with_context(currency_id=self.company_id.currency_id.id).compute(value=1, date_ref=date_invoice)[0] diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index 6011c45a63f..98dbf0970c6 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -828,8 +828,8 @@ class Meeting(models.Model): startdate = startdate.astimezone(pytz.utc) # Convert to UTC meeting.start = fields.Datetime.to_string(startdate) else: - meeting.start = meeting.start_datetime - meeting.stop = meeting.stop_datetime + meeting.write({'start': meeting.start_datetime, + 'stop': meeting.stop_datetime}) @api.depends('byday', 'recurrency', 'final_date', 'rrule_type', 'month_by', 'interval', 'count', 'end_type', 'mo', 'tu', 'we', 'th', 'fr', 'sa', 'su', 'day', 'week_list') def _compute_rrule(self): diff --git a/addons/l10n_ch/data/account_vat2011_data.xml b/addons/l10n_ch/data/account_vat2011_data.xml index 3eaca4c5371..7606345ecfc 100644 --- a/addons/l10n_ch/data/account_vat2011_data.xml +++ b/addons/l10n_ch/data/account_vat2011_data.xml @@ -392,7 +392,6 @@ TVA due a 8.0% (TN) 8.0% - percent sale @@ -405,7 +404,6 @@ 8.0% Incl. - percent sale @@ -418,7 +416,6 @@ 8.0% achat percent - purchase @@ -431,7 +428,6 @@ percent - purchase diff --git a/addons/payment_stripe/tests/test_stripe.py b/addons/payment_stripe/tests/test_stripe.py index ded2b7e9465..5ca3988dc04 100644 --- a/addons/payment_stripe/tests/test_stripe.py +++ b/addons/payment_stripe/tests/test_stripe.py @@ -62,31 +62,14 @@ class StripeTest(StripeCommon): # ---------------------------------------- # Test: button direct rendering # ---------------------------------------- - form_values = { - 'amount': 320.0, - 'currency': 'EUR', - 'address_line1': 'Huge Street 2/543', - 'address_city': 'Sin City', - 'address_country': 'Belgium', - 'email': 'norbert.buyer@example.com', - 'address_zip': '1000', - 'name': 'Norbert Buyer', - 'phone': '0032 12 34 56 78' - } # render the button - res = self.stripe.render('SO404', 320.0, self.currency_euro.id, values=self.buyer_values) - post_url = "https://checkout.stripe.com/checkout.js" - email = "norbert.buyer@example.com" + res = self.stripe.render('SO404', 320.0, self.currency_euro.id, values=self.buyer_values).decode('utf-8') + popup_script_src = 'script src="https://checkout.stripe.com/checkout.js"' # check form result - if "https://checkout.stripe.com/checkout.js" in res[0]: - self.assertEqual(post_url, 'https://checkout.stripe.com/checkout.js', 'Stripe: wrong form POST url') + self.assertIn(popup_script_src, res, "Stripe: popup script not found in template render") # Generated and received - if email in res[0]: - self.assertEqual( - email, form_values.get('email'), - 'Stripe: wrong value for input %s: received %s instead of %s' % (email, email, form_values.get('email')) - ) + self.assertIn(self.buyer_values.get('partner_email'), res, 'Stripe: email input not found in rendered template') @unittest.skip("Stripe test disabled: We do not want to overload Stripe with runbot's requests") def test_30_stripe_form_management(self): diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 622ba2bd1da..bf9b55c5c4d 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -863,7 +863,7 @@ class ProcurementRule(models.Model): class ProcurementOrder(models.Model): _inherit = 'procurement.order' - purchase_line_id = fields.Many2one('purchase.order.line', string='Purchase Order Line') + purchase_line_id = fields.Many2one('purchase.order.line', string='Purchase Order Line', copy=False) purchase_id = fields.Many2one(related='purchase_line_id.order_id', string='Purchase Order') @api.multi @@ -912,10 +912,23 @@ class ProcurementOrder(models.Model): @api.multi def _check(self): - if self.purchase_line_id: + if self.rule_id.action == 'buy': + # In case Phantom BoM splits only into procurements if not self.move_ids: + if self.purchase_line_id and self.purchase_line_id.order_id.state not in ('purchase', 'done', 'cancel'): + return False + else: + return True + move_all_done_or_cancel = all(move.state in ['done', 'cancel'] for move in self.move_ids) + move_all_cancel = all(move.state == 'cancel' for move in self.move_ids) + if not move_all_done_or_cancel: + return False + elif move_all_done_or_cancel and not move_all_cancel: + return True + else: + self.message_post(body=_('All stock moves have been cancelled for this procurement.')) + self.write({'state': 'cancel'}) return False - return all(move.state in ('done', 'cancel') for move in self.move_ids) and any(move.state == 'done' for move in self.move_ids) return super(ProcurementOrder, self)._check() def _get_purchase_schedule_date(self): diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py index 2f1b757960a..ed3d354b295 100644 --- a/addons/stock/models/stock_inventory.py +++ b/addons/stock/models/stock_inventory.py @@ -341,7 +341,7 @@ class InventoryLine(models.Model): # TDE FIXME: necessary ? -> replace by location_id prodlot_name = fields.Char( 'Serial Number Name', - related='prod_lot_id.name', store=True) + related='prod_lot_id.name', store=True, readonly=True) company_id = fields.Many2one( 'res.company', 'Company', related='inventory_id.company_id', index=True, readonly=True, store=True) diff --git a/debian/postrm b/debian/postrm index 22f7211203f..274a488c1bf 100644 --- a/debian/postrm +++ b/debian/postrm @@ -10,9 +10,6 @@ case "${1}" in remove) deluser --quiet --system $ODOO_USER || true delgroup --quiet --system --only-if-empty $ODOO_GROUP || true - if [ -d "$ODOO_LIB_DIR" ]; then - rm -rf $ODOO_LIB_DIR - fi ;; purge)