summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-08-07 18:11:15 +0200
committerChristophe Simonis <chs@odoo.com>2018-08-07 18:11:15 +0200
commitced9156a97ea502050b4e827ef2237fa2cd9410f (patch)
tree395a77954dda3f5c10ce7cc18818a8f208ad880a /addons
parent174bd3a7ac137740dc8e0310e330075953e116e6 (diff)
parent65a80cf3fd2fd0c47c774ac9cc183d9d3bc4af55 (diff)
[MERGE] forward port branch saas-15 up to 65a80cf3fd2
Diffstat (limited to 'addons')
-rw-r--r--addons/event_sale/models/sale_order.py11
-rw-r--r--addons/mail/views/mail_template_views.xml5
-rw-r--r--addons/point_of_sale/static/src/js/screens.js3
-rw-r--r--addons/sale/models/sale.py2
4 files changed, 13 insertions, 8 deletions
diff --git a/addons/event_sale/models/sale_order.py b/addons/event_sale/models/sale_order.py
index 6902d8e4743..2ac4deaed5f 100644
--- a/addons/event_sale/models/sale_order.py
+++ b/addons/event_sale/models/sale_order.py
@@ -8,12 +8,13 @@ class SaleOrder(models.Model):
@api.multi
def action_confirm(self):
- self.ensure_one()
res = super(SaleOrder, self).action_confirm()
- # confirm registration if it was free (otherwise it will be confirmed once invoice fully paid)
- self.order_line._update_registrations(confirm=self.amount_total == 0, cancel_to_draft=False)
- if any(self.order_line.filtered(lambda line: line.event_id)):
- return self.env['ir.actions.act_window'].with_context(default_sale_order_id=self.id).for_xml_id('event_sale', 'action_sale_order_event_registration')
+ for order in self:
+ # confirm registration if it was free (otherwise it will be confirmed once invoice fully paid)
+ order.order_line._update_registrations(confirm=order.amount_total == 0, cancel_to_draft=False)
+ if any(order.order_line.filtered(lambda line: line.event_id)):
+ return self.env['ir.actions.act_window'].with_context(default_sale_order_id=order.id).for_xml_id(
+ 'event_sale', 'action_sale_order_event_registration')
return res
diff --git a/addons/mail/views/mail_template_views.xml b/addons/mail/views/mail_template_views.xml
index d54cb59c957..9b24457450e 100644
--- a/addons/mail/views/mail_template_views.xml
+++ b/addons/mail/views/mail_template_views.xml
@@ -9,8 +9,9 @@
<sheet>
<div class="oe_button_box" name="button_box">
<field name="ref_ir_act_window" invisible="1"/>
- <button class="oe_stat_button" name="create_action" type="object"
+ <button class="oe_stat_button"
groups="base.group_system"
+ name="create_action" type="object"
attrs="{'invisible':[('ref_ir_act_window','!=',False)]}" icon="fa-plus"
help="Display an option on related documents to open a composition wizard with this template">
<div class="o_field_widget o_stat_info">
@@ -18,7 +19,7 @@
<span class="o_stat_text">Context Action</span>
</div>
</button>
- <button name="unlink_action" type="object"
+ <button name="unlink_action" type="object"
groups="base.group_system"
class="oe_stat_button" icon="fa-minus"
attrs="{'invisible':[('ref_ir_act_window','=',False)]}"
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index 172bd53a152..95a7555e5d2 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -1372,6 +1372,9 @@ var ClientListScreenWidget = ScreenWidget.extend({
reload_partners: function(){
var self = this;
return this.pos.load_new_partners().then(function(){
+ // partners may have changed in the backend
+ self.partner_cache = new DomCache();
+
self.render_list(self.pos.db.get_partners_sorted(1000));
// update the currently assigned client if it has been changed in db.
diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py
index ce19c933f9c..b49452604ce 100644
--- a/addons/sale/models/sale.py
+++ b/addons/sale/models/sale.py
@@ -1161,13 +1161,13 @@ class SaleOrderLine(models.Model):
@api.onchange('product_id', 'price_unit', 'product_uom', 'product_uom_qty', 'tax_id')
def _onchange_discount(self):
- self.discount = 0.0
if not (self.product_id and self.product_uom and
self.order_id.partner_id and self.order_id.pricelist_id and
self.order_id.pricelist_id.discount_policy == 'without_discount' and
self.env.user.has_group('sale.group_discount_per_so_line')):
return
+ self.discount = 0.0
product = self.product_id.with_context(
lang=self.order_id.partner_id.lang,
partner=self.order_id.partner_id.id,