[IMP] stock_landed_stock: Landed cost error message and change label

- Change label Pickings to  Transfers to be consistent with the stock
  module
- Improve landed cost error message when they cannot be applied

TASK-1819891
This commit is contained in:
Darshil Trivedi
2018-08-09 09:33:00 +02:00
committed by Pierre Masereel
parent 39db047514
commit 1ca06f2758
@@ -27,7 +27,7 @@ class LandedCost(models.Model):
'Date', default=fields.Date.context_today,
copy=False, required=True, states={'done': [('readonly', True)]}, track_visibility='onchange')
picking_ids = fields.Many2many(
'stock.picking', string='Pickings',
'stock.picking', string='Transfers',
copy=False, states={'done': [('readonly', True)]})
cost_lines = fields.One2many(
'stock.landed.cost.lines', 'cost_id', 'Cost Lines',
@@ -158,7 +158,7 @@ class LandedCost(models.Model):
lines.append(vals)
if not lines and self.mapped('picking_ids'):
raise UserError(_('The selected picking does not contain any move that would be impacted by landed costs. Landed costs are only possible for products configured in real time valuation with real price costing method. Please make sure it is the case, or you selected the correct picking'))
raise UserError(_("You cannot apply landed costs on the chosen transfer(s). Landed costs can only be applied for products with automated inventory valuation and FIFO costing method."))
return lines
@api.multi