mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[mrg] add _auto_set_warranty when you press on "create picking" on return product wizard
This commit is contained in:
@@ -254,6 +254,15 @@ class claim_line(orm.Model):
|
||||
context=context)
|
||||
return True
|
||||
|
||||
def auto_set_warranty(self, cr, uid, ids, context):
|
||||
""" Set warranty automatically
|
||||
if the user has not himself pressed on 'Calculate warranty state'
|
||||
button, it sets warranty for him"""
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
if not line.warning:
|
||||
self.set_warranty(cr, uid, [line.id], context=context)
|
||||
return True
|
||||
|
||||
def get_destination_location(self, cr, uid, product_id,
|
||||
warehouse_id, context=None):
|
||||
"""Compute and return the destination location ID to take
|
||||
|
||||
@@ -194,6 +194,9 @@ class claim_make_picking(orm.TransientModel):
|
||||
_('A product return cannot be created for various '
|
||||
'destination locations, please choose line with a '
|
||||
'same destination location.'))
|
||||
self.pool.get('claim.line').auto_set_warranty(cr, uid,
|
||||
line_ids,
|
||||
context=context)
|
||||
common_dest_partner_id = self._get_common_partner_from_line(
|
||||
cr, uid, line_ids, context=context)
|
||||
if not common_dest_partner_id:
|
||||
|
||||
Reference in New Issue
Block a user