[MERGE] forward port branch saas-15 up to 65a80cf3fd
This commit is contained in:
@@ -8,12 +8,13 @@ class SaleOrder(models.Model):
|
|||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def action_confirm(self):
|
def action_confirm(self):
|
||||||
self.ensure_one()
|
|
||||||
res = super(SaleOrder, self).action_confirm()
|
res = super(SaleOrder, self).action_confirm()
|
||||||
# confirm registration if it was free (otherwise it will be confirmed once invoice fully paid)
|
for order in self:
|
||||||
self.order_line._update_registrations(confirm=self.amount_total == 0, cancel_to_draft=False)
|
# confirm registration if it was free (otherwise it will be confirmed once invoice fully paid)
|
||||||
if any(self.order_line.filtered(lambda line: line.event_id)):
|
order.order_line._update_registrations(confirm=order.amount_total == 0, cancel_to_draft=False)
|
||||||
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')
|
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
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,9 @@
|
|||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_button_box" name="button_box">
|
<div class="oe_button_box" name="button_box">
|
||||||
<field name="ref_ir_act_window" invisible="1"/>
|
<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"
|
groups="base.group_system"
|
||||||
|
name="create_action" type="object"
|
||||||
attrs="{'invisible':[('ref_ir_act_window','!=',False)]}" icon="fa-plus"
|
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">
|
help="Display an option on related documents to open a composition wizard with this template">
|
||||||
<div class="o_field_widget o_stat_info">
|
<div class="o_field_widget o_stat_info">
|
||||||
|
|||||||
@@ -1372,6 +1372,9 @@ var ClientListScreenWidget = ScreenWidget.extend({
|
|||||||
reload_partners: function(){
|
reload_partners: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
return this.pos.load_new_partners().then(function(){
|
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));
|
self.render_list(self.pos.db.get_partners_sorted(1000));
|
||||||
|
|
||||||
// update the currently assigned client if it has been changed in db.
|
// update the currently assigned client if it has been changed in db.
|
||||||
|
|||||||
@@ -1161,13 +1161,13 @@ class SaleOrderLine(models.Model):
|
|||||||
|
|
||||||
@api.onchange('product_id', 'price_unit', 'product_uom', 'product_uom_qty', 'tax_id')
|
@api.onchange('product_id', 'price_unit', 'product_uom', 'product_uom_qty', 'tax_id')
|
||||||
def _onchange_discount(self):
|
def _onchange_discount(self):
|
||||||
self.discount = 0.0
|
|
||||||
if not (self.product_id and self.product_uom and
|
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.partner_id and self.order_id.pricelist_id and
|
||||||
self.order_id.pricelist_id.discount_policy == 'without_discount' and
|
self.order_id.pricelist_id.discount_policy == 'without_discount' and
|
||||||
self.env.user.has_group('sale.group_discount_per_so_line')):
|
self.env.user.has_group('sale.group_discount_per_so_line')):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.discount = 0.0
|
||||||
product = self.product_id.with_context(
|
product = self.product_id.with_context(
|
||||||
lang=self.order_id.partner_id.lang,
|
lang=self.order_id.partner_id.lang,
|
||||||
partner=self.order_id.partner_id.id,
|
partner=self.order_id.partner_id.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user