Skip to content

Commit

Permalink
[MERGE] forward port branch saas-15 up to 152d420
Browse files Browse the repository at this point in the history
  • Loading branch information
KangOl committed Jun 21, 2018
2 parents 1fe119d + 152d420 commit c5ed372
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 33 deletions.
4 changes: 2 additions & 2 deletions addons/calendar/models/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,8 +902,8 @@ def _inverse_dates(self):
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):
Expand Down
4 changes: 0 additions & 4 deletions addons/l10n_ch/data/account_vat2011_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,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>
Expand All @@ -429,7 +428,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>
Expand All @@ -443,7 +441,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"/>
Expand All @@ -457,7 +454,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"/>
Expand Down
25 changes: 4 additions & 21 deletions addons/payment_stripe/tests/test_stripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,14 @@ def test_20_stripe_form_render(self):
# ----------------------------------------
# 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):
Expand Down
2 changes: 1 addition & 1 deletion addons/stock/models/stock_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,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)
Expand Down
5 changes: 3 additions & 2 deletions addons/web_editor/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,17 @@ def save_less(self, url, bundle_xmlid, content):

# Check if the file to save had already been modified
custom_attachment = IrAttachment.search([("url", "=", custom_url)])
datas = base64.b64encode((content or "\n").encode("utf-8"))
if custom_attachment:
# If it was already modified, simply override the corresponding attachment content
custom_attachment.write({"datas": base64.b64encode(content.encode("utf-8"))})
custom_attachment.write({"datas": datas})
else:
# If not, create a new attachment to copy the original LESS file content, with its modifications
IrAttachment.create(dict(
name = custom_url,
type = "binary",
mimetype = "text/less",
datas = base64.b64encode(content.encode("utf-8")),
datas = datas,
datas_fname = url.split("/")[-1],
url = custom_url, # Having an attachment of "binary" type with an non empty "url" field
# is quite of an hack. This allows to fetch the "datas" field by adding
Expand Down
3 changes: 0 additions & 3 deletions debian/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c5ed372

Please sign in to comment.