mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[FIX+IMP] rma, rma_sale: fix bugs and add improvements
- Fix thrown error when trying to download a picking from the portal. - Add the hook method to prepare RMA values from the return pick wizard. - Add the access rule for portal users. - Show the portal 'Request RMAs' button on the sales page only to users related to the sales order. [UPD] Update rma.pot rma 12.0.1.3.0 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: rma-12.0/rma-12.0-rma Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma/
This commit is contained in:
committed by
Nikolaus Weingartmair
parent
87bff4530d
commit
4120f2db89
@@ -1080,6 +1080,12 @@ class Rma(models.Model):
|
||||
}
|
||||
|
||||
# Mail business methods
|
||||
def _track_subtype(self, init_values):
|
||||
self.ensure_one()
|
||||
if 'state' in init_values and self.state == 'draft':
|
||||
return 'rma.mt_rma_draft'
|
||||
return super()._track_subtype(init_values)
|
||||
|
||||
def message_new(self, msg_dict, custom_values=None):
|
||||
"""Extract the needed values from an incoming rma emails data-set
|
||||
to be used to create an RMA.
|
||||
|
||||
@@ -88,6 +88,32 @@ class StockMove(models.Model):
|
||||
res['rma_id'] = self.rma_id.id
|
||||
return res
|
||||
|
||||
def _prepare_return_rma_vals(self, original_picking):
|
||||
""" hook method for preparing an RMA from the 'return picking wizard'.
|
||||
"""
|
||||
self.ensure_one()
|
||||
partner = original_picking.partner_id
|
||||
if hasattr(original_picking, 'sale_id') and original_picking.sale_id:
|
||||
partner_invoice_id = original_picking.sale_id.partner_invoice_id.id
|
||||
else:
|
||||
partner_invoice_id = partner.address_get(
|
||||
['invoice']).get('invoice', False),
|
||||
return {
|
||||
'user_id': self.env.user.id,
|
||||
'partner_id': partner.id,
|
||||
'partner_invoice_id': partner_invoice_id,
|
||||
'origin': original_picking.name,
|
||||
'picking_id': original_picking.id,
|
||||
'move_id': self.origin_returned_move_id.id,
|
||||
'product_id': self.origin_returned_move_id.product_id.id,
|
||||
'product_uom_qty': self.product_uom_qty,
|
||||
'product_uom': self.product_uom.id,
|
||||
'reception_move_id': self.id,
|
||||
'company_id': self.company_id.id,
|
||||
'location_id': self.location_dest_id.id,
|
||||
'state': 'confirmed',
|
||||
}
|
||||
|
||||
|
||||
class StockRule(models.Model):
|
||||
_inherit = 'stock.rule'
|
||||
|
||||
@@ -62,7 +62,7 @@ class StockWarehouse(models.Model):
|
||||
sequence_data = warehouse._get_sequence_values()
|
||||
warehouse.rma_in_type_id.sequence_id.write(
|
||||
sequence_data['rma_in_type_id'])
|
||||
warehouse.rma_in_type_id.sequence_id.write(
|
||||
warehouse.rma_out_type_id.sequence_id.write(
|
||||
sequence_data['rma_out_type_id'])
|
||||
|
||||
def _get_picking_type_create_values(self, max_sequence):
|
||||
|
||||
Reference in New Issue
Block a user