mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
fix mistakes made when porting to the new API
This commit is contained in:
@@ -88,6 +88,7 @@ class AccountInvoiceLine(models.Model):
|
||||
_inherit = "account.invoice.line"
|
||||
|
||||
@api.model
|
||||
@api.returns('self', lambda value: value.id)
|
||||
def create(self, vals):
|
||||
claim_line_id = vals.get('claim_line_id')
|
||||
if claim_line_id:
|
||||
|
||||
@@ -72,7 +72,7 @@ class ClaimLine(models.Model):
|
||||
self.return_value = (self.unit_sale_price *
|
||||
self.product_returned_quantity)
|
||||
|
||||
@api.model
|
||||
@api.multi
|
||||
def copy_data(self, default=None):
|
||||
if default is None:
|
||||
default = {}
|
||||
@@ -420,7 +420,7 @@ class CrmClaim(models.Model):
|
||||
def name_get(self):
|
||||
return (self.id, u'[{}] {}'.format(self.code or '', self.name))
|
||||
|
||||
@api.model
|
||||
@api.multi
|
||||
def copy_data(self, default=None):
|
||||
if default is None:
|
||||
default = {}
|
||||
@@ -513,12 +513,18 @@ class CrmClaim(models.Model):
|
||||
if self.invoice_id:
|
||||
self.delivery_address_id = self.invoice_id.partner_id.id
|
||||
|
||||
@api.model
|
||||
@api.multi
|
||||
def message_get_reply_to(self):
|
||||
""" Override to get the reply_to of the parent project. """
|
||||
return [claim.section_id.message_get_reply_to()[0]
|
||||
if claim.section_id else False
|
||||
for claim in self.sudo()]
|
||||
result = {}
|
||||
for claim in self.sudo():
|
||||
section = claim.section_id
|
||||
if section:
|
||||
section_reply_to = section.message_get_reply_to()
|
||||
result[claim.id] = section_reply_to[section.id]
|
||||
else:
|
||||
result[claim.id] = False
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
def message_get_suggested_recipients(self):
|
||||
|
||||
@@ -31,6 +31,7 @@ class StockPicking(models.Model):
|
||||
claim_id = fields.Many2one('crm.claim', string='Claim')
|
||||
|
||||
@api.model
|
||||
@api.returns('self', lambda value: value.id)
|
||||
def create(self, vals):
|
||||
if ('name' not in vals) or (vals.get('name') == '/'):
|
||||
vals['name'] = self.env['ir.sequence'].get(self._name)
|
||||
@@ -41,6 +42,7 @@ class StockMove(models.Model):
|
||||
_inherit = "stock.move"
|
||||
|
||||
@api.model
|
||||
@api.returns('self', lambda value: value.id)
|
||||
def create(self, vals):
|
||||
"""
|
||||
In case of a wrong picking out, We need to create a new stock_move in a
|
||||
|
||||
Reference in New Issue
Block a user