sale_usability purchase_usability: reload form view upon sale order and purchase order confirmation to display the 3 qty columns
PEP8 fixes
This commit is contained in:
@@ -20,11 +20,11 @@ class ResPartner(models.Model):
|
||||
try:
|
||||
partner.purchase_order_count = poo.search_count(
|
||||
[('partner_id', 'child_of', partner.id)])
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
partner.supplier_invoice_count = aio.search_count([
|
||||
('partner_id', 'child_of', partner.id),
|
||||
('type', '=', 'in_invoice')])
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
@@ -35,6 +35,20 @@ class PurchaseOrder(models.Model):
|
||||
delivery_partner_id = o.picking_type_id.warehouse_id.partner_id
|
||||
o.delivery_partner_id = delivery_partner_id
|
||||
|
||||
@api.multi
|
||||
def button_confirm(self):
|
||||
'''Reload view upon order confirmation to display the 3 qty cols'''
|
||||
res = super(PurchaseOrder, self).button_confirm()
|
||||
if len(self) == 1:
|
||||
res = self.env['ir.actions.act_window'].for_xml_id(
|
||||
'purchase', 'purchase_form_action')
|
||||
res.update({
|
||||
'view_mode': 'form,tree,kanban,pivot,graph,calendar',
|
||||
'res_id': self.id,
|
||||
'views': False,
|
||||
})
|
||||
return res
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
@@ -37,6 +37,21 @@ class SaleOrder(models.Model):
|
||||
break
|
||||
order.has_discount = has_discount
|
||||
|
||||
@api.multi
|
||||
def action_confirm(self):
|
||||
'''Reload view upon order confirmation to display the 3 qty cols'''
|
||||
res = super(SaleOrder, self).action_confirm()
|
||||
if len(self) == 1:
|
||||
res = self.env['ir.actions.act_window'].for_xml_id(
|
||||
'sale', 'action_orders')
|
||||
res.update({
|
||||
'view_mode': 'form,tree,kanban,calendar,pivot,graph',
|
||||
'res_id': self.id,
|
||||
'views': False,
|
||||
'context': {'hide_sale': False},
|
||||
})
|
||||
return res
|
||||
|
||||
# for report
|
||||
@api.multi
|
||||
def py3o_lines_layout(self):
|
||||
|
||||
Reference in New Issue
Block a user