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

This commit is contained in:
Christophe Simonis
2018-06-20 18:48:06 +02:00
7 changed files with 24 additions and 35 deletions
+1 -1
View File
@@ -554,7 +554,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]
+2 -2
View File
@@ -829,8 +829,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):
@@ -392,7 +392,6 @@
<field name="name">TVA due a 8.0% (TN)</field>
<field name="description">8.0%</field>
<field name="amount" eval="8.0"/>
<field name="sequence" eval="0"/>
<field name="amount_type">percent</field>
<field name="chart_template_id" ref="l10nch_chart_template"/>
<field name="type_tax_use">sale</field>
@@ -405,7 +404,6 @@
<field name="description">8.0% Incl.</field>
<field name="price_include" eval="1"/>
<field name="amount" eval="8.0"/>
<field name="sequence" eval="0"/>
<field name="amount_type">percent</field>
<field name="chart_template_id" ref="l10nch_chart_template"/>
<field name="type_tax_use">sale</field>
@@ -418,7 +416,6 @@
<field name="description">8.0% achat</field>
<field name="amount" eval="8.0"/>
<field name="amount_type">percent</field>
<field name="sequence" eval="0"/>
<field name="chart_template_id" ref="l10nch_chart_template"/>
<field name="type_tax_use">purchase</field>
<field name="refund_account_id" ref="ch_coa_1170"/>
@@ -431,7 +428,6 @@
<field name="price_include" eval="1"/>
<field name="amount" eval="8.0"/>
<field name="amount_type">percent</field>
<field name="sequence" eval="0"/>
<field name="chart_template_id" ref="l10nch_chart_template"/>
<field name="type_tax_use">purchase</field>
<field name="refund_account_id" ref="ch_coa_1170"/>
+4 -21
View File
@@ -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):
+16 -3
View File
@@ -865,7 +865,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
@@ -914,10 +914,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):
+1 -1
View File
@@ -342,7 +342,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)
-3
View File
@@ -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)