mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[9.0][IMP] rma: add button to rma's from customers
This commit is contained in:
committed by
AaronHForgeFlow
parent
95dce245c7
commit
828fb1abaa
27
rma/models/res_partner.py
Normal file
27
rma/models/res_partner.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import api, fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
@api.multi
|
||||
def _compute_rma_line_count(self):
|
||||
for rec in self:
|
||||
rec.rma_line_count = len(rec.rma_line_ids)
|
||||
|
||||
rma_line_ids = fields.One2many(
|
||||
comodel_name="rma.order.line", string="RMAs",
|
||||
inverse_name="partner_id",
|
||||
)
|
||||
rma_line_count = fields.Integer(compute="_compute_rma_line_count")
|
||||
|
||||
@api.multi
|
||||
def action_open_partner_rma(self):
|
||||
action = self.env.ref('rma.action_rma_customer_lines')
|
||||
result = action.read()[0]
|
||||
result['context'] = {'search_default_partner_id': self.id}
|
||||
return result
|
||||
Reference in New Issue
Block a user