[9.0][IMP] rma_account:

* remove unneded copy attributes.
* simplify action_view methods.
* fix wrong naming.
* fix misplaced views.
* fix wrong count and view actions for rma.orders in invoices.
* fix error when installing the module.
* remove unneded data update when preparing rma lines from invoice lines.
* minor extra fixes.
This commit is contained in:
lreficent
2017-08-25 12:22:53 +02:00
committed by AaronHForgeFlow
parent 77688d880d
commit 441218fecd
3 changed files with 7 additions and 8 deletions

View File

@@ -179,8 +179,8 @@ class RmaOrder(models.Model):
def _get_valid_lines(self):
""":return: A recordset of rma lines.
"""
for rec in self:
return rec.rma_line_ids
self.ensure_one()
return self.rma_line_ids
@api.multi
def action_view_lines(self):
@@ -192,8 +192,7 @@ class RmaOrder(models.Model):
lines = self._get_valid_lines()
# choose the view_mode accordingly
if len(lines) != 1:
result['domain'] = "[('id', 'in', " + \
str(lines.ids) + ")]"
result['domain'] = [('id', 'in', lines.ids)]
elif len(lines) == 1:
if self.type == 'customer':
res = self.env.ref('rma.view_rma_line_form', False)