[MERGE] forward port branch saas-15 up to 65a80cf3fd
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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)]}"
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user