mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[11.0] MIG: rma_account
This commit is contained in:
committed by
ahenriquez
parent
526b4d5dac
commit
b3f75d4348
@@ -43,6 +43,7 @@ Contributors
|
||||
* Jordi Ballester Alomar <jordi.ballester@eficent.com>
|
||||
* Aaron Henriquez <ahenriquez@eficent.com>
|
||||
* Lois Rilo <lois.rilo@eficent.com>
|
||||
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from . import models
|
||||
from . import wizards
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
{
|
||||
'name': 'RMA Account',
|
||||
'version': '9.0.1.0.0',
|
||||
'version': '11.0.1.0.0',
|
||||
'license': 'LGPL-3',
|
||||
'category': 'RMA',
|
||||
'summary': 'Integrates RMA with Invoice Processing',
|
||||
@@ -21,6 +20,6 @@
|
||||
'wizards/rma_add_invoice.xml',
|
||||
'wizards/rma_refund.xml',
|
||||
],
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo noupdate="1">
|
||||
<?xml version="1.0"?>
|
||||
<odoo noupdate="0">
|
||||
|
||||
<record id="rma.rma_operation_customer_replace" model="rma.operation">
|
||||
<field name="refund_policy">no</field>
|
||||
@@ -35,10 +35,6 @@
|
||||
<field name="refund_policy">no</field>
|
||||
</record>
|
||||
|
||||
<record id="rma.rma_operation_ds_replace_customer" model="rma.operation">
|
||||
<field name="refund_policy">no</field>
|
||||
</record>
|
||||
|
||||
<record id="rma.rma_operation_ds_replace_supplier" model="rma.operation">
|
||||
<field name="refund_policy">no</field>
|
||||
</record>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from . import rma_order
|
||||
from . import rma_order_line
|
||||
from . import rma_operation
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
@@ -72,28 +71,30 @@ class AccountInvoice(models.Model):
|
||||
def action_view_rma_supplier(self):
|
||||
action = self.env.ref('rma.action_rma_supplier_lines')
|
||||
result = action.read()[0]
|
||||
rma_list = self.mapped('invoice_line_ids.rma_line_ids').ids
|
||||
# choose the view_mode accordingly
|
||||
if len(rma_list) != 1:
|
||||
result['domain'] = [('id', 'in', rma_list)]
|
||||
elif len(rma_list) == 1:
|
||||
res = self.env.ref('rma.view_rma_line_supplier_form', False)
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = rma_list[0]
|
||||
rma_ids = self.mapped('invoice_line_ids.rma_line_ids').ids
|
||||
if rma_ids:
|
||||
# choose the view_mode accordingly
|
||||
if len(rma_ids) > 1:
|
||||
result['domain'] = [('id', 'in', rma_ids)]
|
||||
else:
|
||||
res = self.env.ref('rma.view_rma_line_supplier_form', False)
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = rma_ids[0]
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
def action_view_rma_customer(self):
|
||||
action = self.env.ref('rma.action_rma_customer_lines')
|
||||
result = action.read()[0]
|
||||
rma_list = self.mapped('invoice_line_ids.rma_line_ids').ids
|
||||
# choose the view_mode accordingly
|
||||
if len(rma_list) != 1:
|
||||
result['domain'] = [('id', 'in', rma_list)]
|
||||
elif len(rma_list) == 1:
|
||||
res = self.env.ref('rma.view_rma_line_form', False)
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = rma_list[0]
|
||||
rma_ids = self.mapped('invoice_line_ids.rma_line_ids').ids
|
||||
if rma_ids:
|
||||
# choose the view_mode accordingly
|
||||
if len(rma_ids) > 1:
|
||||
result['domain'] = [('id', 'in', rma_ids)]
|
||||
else:
|
||||
res = self.env.ref('rma.view_rma_line_form', False)
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = rma_ids[0]
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
@@ -94,30 +94,28 @@ class RmaOrder(models.Model):
|
||||
invoice_ids = self.mapped(
|
||||
'rma_line_ids.refund_line_ids.invoice_id').ids
|
||||
# choose the view_mode accordingly
|
||||
if len(invoice_ids) != 1:
|
||||
if len(invoice_ids) > 1:
|
||||
result['domain'] = [('id', 'in', invoice_ids)]
|
||||
elif len(invoice_ids) == 1:
|
||||
else:
|
||||
res = self.env.ref('account.invoice_supplier_form', False)
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = invoice_ids[0]
|
||||
result['res_id'] = invoice_ids and invoice_ids[0]
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
def action_view_invoice(self):
|
||||
if self.type == "supplier":
|
||||
action = self.env.ref('account.action_invoice_tree2')
|
||||
res = self.env.ref('account.invoice_supplier_form', False)
|
||||
else:
|
||||
action = self.env.ref('account.action_invoice_tree')
|
||||
res = self.env.ref('account.invoice_form', False)
|
||||
result = action.read()[0]
|
||||
invoice_ids = self.mapped('rma_line_ids.invoice_id').ids
|
||||
# choose the view_mode accordingly
|
||||
if len(invoice_ids) != 1:
|
||||
if len(invoice_ids) > 1:
|
||||
result['domain'] = [('id', 'in', invoice_ids)]
|
||||
elif len(invoice_ids) == 1:
|
||||
if self.type == "supplier":
|
||||
res = self.env.ref('account.invoice_supplier_form', False)
|
||||
else:
|
||||
res = self.env.ref('account.invoice_form', False)
|
||||
else:
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = invoice_ids[0]
|
||||
result['res_id'] = invoice_ids and invoice_ids[0]
|
||||
return result
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
from odoo.addons import decimal_precision as dp
|
||||
@@ -211,12 +211,12 @@ class RmaOrderLine(models.Model):
|
||||
result = action.read()[0]
|
||||
invoice_ids = self.mapped('refund_line_ids.invoice_id').ids
|
||||
# choose the view_mode accordingly
|
||||
if len(invoice_ids) != 1:
|
||||
if len(invoice_ids) > 1:
|
||||
result['domain'] = [('id', 'in', invoice_ids)]
|
||||
elif len(invoice_ids) == 1:
|
||||
else:
|
||||
res = self.env.ref('account.invoice_supplier_form', False)
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = invoice_ids[0]
|
||||
result['res_id'] = invoice_ids and invoice_ids[0]
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from . import test_rma
|
||||
from . import test_supplier_rma
|
||||
from . import test_rma_dropship
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
@@ -275,13 +274,11 @@ class TestRma(common.TransactionCase):
|
||||
'picking_type': 'incoming',
|
||||
'active_id': 1
|
||||
}).create({})
|
||||
procurements = wizard._create_picking()
|
||||
group_ids = set([proc.group_id.id for proc in procurements if
|
||||
proc.group_id])
|
||||
domain = [('group_id', 'in', list(group_ids))]
|
||||
picking = self.stockpicking.search(domain)
|
||||
self.assertEquals(len(picking), 1,
|
||||
"Incorrect number of pickings created")
|
||||
wizard._create_picking()
|
||||
res = self.rma_customer_id.rma_line_ids.action_view_in_shipments()
|
||||
self.assertTrue('res_id' in res,
|
||||
"Incorrect number of pickings created")
|
||||
picking = self.env['stock.picking'].browse(res['res_id'])
|
||||
moves = picking.move_lines
|
||||
self.assertEquals(len(moves), 3,
|
||||
"Incorrect number of moves created")
|
||||
@@ -297,22 +294,31 @@ class TestRma(common.TransactionCase):
|
||||
"Wrong qty delivered")
|
||||
# product specific
|
||||
if line.product_id == self.product_1:
|
||||
self.assertEquals(line.qty_to_deliver, 0,
|
||||
"Wrong qty to deliver")
|
||||
self.assertEquals(line.qty_to_receive, 3,
|
||||
"Wrong qty to receive")
|
||||
self.assertEquals(line.qty_incoming, 3,
|
||||
"Wrong qty incoming")
|
||||
if line.product_id == self.product_2:
|
||||
self.assertEquals(line.qty_to_deliver, 0,
|
||||
"Wrong qty to deliver")
|
||||
self.assertEquals(line.qty_to_receive, 5,
|
||||
"Wrong qty to receive")
|
||||
self.assertEquals(line.qty_incoming, 5,
|
||||
"Wrong qty incoming")
|
||||
if line.product_id == self.product_3:
|
||||
self.assertEquals(line.qty_to_deliver, 0,
|
||||
"Wrong qty to deliver")
|
||||
self.assertEquals(line.qty_to_receive, 2,
|
||||
"Wrong qty to receive")
|
||||
self.assertEquals(line.qty_incoming, 2,
|
||||
"Wrong qty incoming")
|
||||
picking.action_assign()
|
||||
picking.do_transfer()
|
||||
picking.action_assign()
|
||||
for line in picking.move_line_ids:
|
||||
line.qty_done = line.product_uom_qty
|
||||
picking.action_done()
|
||||
for line in self.rma_customer_id.rma_line_ids:
|
||||
self.assertEquals(line.qty_to_receive, 0,
|
||||
"Wrong qty to_receive")
|
||||
@@ -344,15 +350,12 @@ class TestRma(common.TransactionCase):
|
||||
'active_model': 'rma.order.line',
|
||||
'picking_type': 'outgoing',
|
||||
}).create({})
|
||||
procurements = wizard._create_picking()
|
||||
group_ids = set([proc.group_id.id for proc in procurements if
|
||||
proc.group_id])
|
||||
domain = [('group_id', 'in', list(group_ids))]
|
||||
pickings = self.stockpicking.search(domain)
|
||||
self.assertEquals(len(pickings), 2,
|
||||
"Incorrect number of pickings created")
|
||||
picking_out = pickings[1]
|
||||
moves = picking_out.move_lines
|
||||
wizard._create_picking()
|
||||
res = self.rma_customer_id.rma_line_ids.action_view_out_shipments()
|
||||
self.assertTrue('res_id' in res,
|
||||
"Incorrect number of pickings created")
|
||||
picking = self.env['stock.picking'].browse(res['res_id'])
|
||||
moves = picking.move_lines
|
||||
self.assertEquals(len(moves), 3,
|
||||
"Incorrect number of moves created")
|
||||
for line in self.rma_customer_id.rma_line_ids:
|
||||
@@ -383,13 +386,12 @@ class TestRma(common.TransactionCase):
|
||||
"Wrong qty to deliver")
|
||||
self.assertEquals(line.qty_outgoing, 2,
|
||||
"Wrong qty outgoing")
|
||||
picking_out.action_assign()
|
||||
picking_out.do_transfer()
|
||||
for line in self.rma_customer_id.rma_line_ids:
|
||||
self.assertEquals(line.qty_to_receive, 0,
|
||||
"Wrong qty to receive")
|
||||
self.assertEquals(line.qty_incoming, 0,
|
||||
"Wrong qty incoming")
|
||||
picking.action_confirm()
|
||||
picking.action_assign()
|
||||
for line in picking.move_line_ids:
|
||||
line.qty_done = line.product_uom_qty
|
||||
picking.action_done()
|
||||
for line in self.rma_customer_id.rma_line_ids[0]:
|
||||
self.assertEquals(line.qty_to_deliver, 0,
|
||||
"Wrong qty to deliver")
|
||||
self.assertEquals(line.qty_outgoing, 0,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
@@ -45,13 +44,11 @@ class TestRmaDropship(test_rma.TestRma):
|
||||
'active_model': 'rma.order.line',
|
||||
'picking_type': 'incoming',
|
||||
}).create({})
|
||||
procurements = wizard._create_picking()
|
||||
group_ids = set([proc.group_id.id for proc in procurements if
|
||||
proc.group_id])
|
||||
domain = [('group_id', 'in', list(group_ids))]
|
||||
picking = self.stockpicking.search(domain)
|
||||
self.assertEquals(len(picking), 1,
|
||||
"Incorrect number of pickings created")
|
||||
wizard._create_picking()
|
||||
res = supplier_rma.rma_line_ids.action_view_in_shipments()
|
||||
self.assertTrue('res_id' in res,
|
||||
"Incorrect number of pickings created")
|
||||
picking = self.env['stock.picking'].browse(res['res_id'])
|
||||
moves = picking.move_lines
|
||||
self.assertEquals(len(moves), 3,
|
||||
"Incorrect number of moves created")
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
@@ -22,13 +21,11 @@ class TestSupplierRma(test_rma.TestRma):
|
||||
'picking_type': 'outgoing',
|
||||
'active_id': 1
|
||||
}).create({})
|
||||
procurements = wizard._create_picking()
|
||||
group_ids = set([proc.group_id.id for proc in procurements if
|
||||
proc.group_id])
|
||||
domain = [('group_id', 'in', list(group_ids))]
|
||||
picking = self.stockpicking.search(domain)
|
||||
self.assertEquals(len(picking), 1,
|
||||
"Incorrect number of pickings created")
|
||||
wizard._create_picking()
|
||||
res = self.rma_supplier_id.rma_line_ids.action_view_out_shipments()
|
||||
self.assertTrue('res_id' in res,
|
||||
"Incorrect number of pickings created")
|
||||
picking = self.env['stock.picking'].browse(res['res_id'])
|
||||
moves = picking.move_lines
|
||||
self.assertEquals(len(moves), 3,
|
||||
"Incorrect number of moves created")
|
||||
@@ -62,9 +59,10 @@ class TestSupplierRma(test_rma.TestRma):
|
||||
"Wrong qty to deliver")
|
||||
self.assertEquals(line.qty_outgoing, 2,
|
||||
"Wrong qty outgoing")
|
||||
|
||||
picking.action_assign()
|
||||
picking.do_transfer()
|
||||
picking.force_assign()
|
||||
for line in picking.move_lines:
|
||||
line.quantity_done = line.product_uom_qty
|
||||
picking.button_validate()
|
||||
for line in self.rma_supplier_id.rma_line_ids:
|
||||
self.assertEquals(line.qty_incoming, 0,
|
||||
"Wrong qty incoming")
|
||||
@@ -76,12 +74,12 @@ class TestSupplierRma(test_rma.TestRma):
|
||||
self.assertEquals(line.qty_to_receive, 3,
|
||||
"Wrong qty to receive")
|
||||
if line.product_id == self.product_2:
|
||||
self.assertEquals(line.qty_outgoing, 0,
|
||||
self.assertEquals(line.qty_delivered, 5,
|
||||
"Wrong qty delivered")
|
||||
self.assertEquals(line.qty_to_receive, 5,
|
||||
"Wrong qty to receive")
|
||||
if line.product_id == self.product_3:
|
||||
self.assertEquals(line.qty_outgoing, 0,
|
||||
self.assertEquals(line.qty_delivered, 2,
|
||||
"Wrong qty delivered")
|
||||
self.assertEquals(line.qty_to_receive, 2,
|
||||
"Wrong qty to receive")
|
||||
@@ -91,65 +89,48 @@ class TestSupplierRma(test_rma.TestRma):
|
||||
'active_model': 'rma.order.line',
|
||||
'picking_type': 'incoming',
|
||||
}).create({})
|
||||
procurements = wizard._create_picking()
|
||||
group_ids = set([proc.group_id.id for proc in procurements if
|
||||
proc.group_id])
|
||||
domain = [('group_id', 'in', list(group_ids))]
|
||||
pickings = self.stockpicking.search(domain)
|
||||
self.assertEquals(len(pickings), 2,
|
||||
"Incorrect number of pickings created")
|
||||
picking_out = pickings[1]
|
||||
moves = picking_out.move_lines
|
||||
wizard._create_picking()
|
||||
res = self.rma_supplier_id.rma_line_ids.action_view_in_shipments()
|
||||
self.assertTrue('res_id' in res,
|
||||
"Incorrect number of pickings created")
|
||||
picking = self.env['stock.picking'].browse(res['res_id'])
|
||||
moves = picking.move_lines
|
||||
self.assertEquals(len(moves), 3,
|
||||
"Incorrect number of moves created")
|
||||
for line in self.rma_supplier_id.rma_line_ids:
|
||||
self.assertEquals(line.qty_incoming, 0,
|
||||
"Wrong qty incoming")
|
||||
self.assertEquals(line.qty_received, 0,
|
||||
"Wrong qty received")
|
||||
if line.product_id == self.product_1:
|
||||
self.assertEquals(line.qty_to_receive, 3,
|
||||
"Wrong qty to receive")
|
||||
self.assertEquals(line.qty_incoming, 0,
|
||||
self.assertEquals(line.qty_incoming, 3,
|
||||
"Wrong qty incoming")
|
||||
self.assertEquals(line.qty_delivered, 3,
|
||||
"Wrong qty delivered")
|
||||
if line.product_id == self.product_2:
|
||||
self.assertEquals(line.qty_to_receive, 5,
|
||||
"Wrong qty to receive")
|
||||
self.assertEquals(line.qty_to_deliver, 0,
|
||||
"Wrong qty to deliver")
|
||||
self.assertEquals(line.qty_incoming, 5,
|
||||
"Wrong qty incoming")
|
||||
if line.product_id == self.product_3:
|
||||
self.assertEquals(line.qty_to_receive, 2,
|
||||
"Wrong qty to receive")
|
||||
self.assertEquals(line.qty_to_deliver, 0,
|
||||
"Wrong qty to deliver")
|
||||
picking_out.action_assign()
|
||||
picking_out.do_transfer()
|
||||
self.assertEquals(line.qty_incoming, 2,
|
||||
"Wrong qty incoming")
|
||||
picking.action_assign()
|
||||
for line in picking.move_line_ids:
|
||||
line.qty_done = line.product_uom_qty
|
||||
picking.action_done()
|
||||
for line in self.rma_supplier_id.rma_line_ids[0]:
|
||||
self.assertEquals(line.qty_to_receive, 3,
|
||||
"Wrong qty to receive")
|
||||
self.assertEquals(line.qty_incoming, 0,
|
||||
"Wrong qty incoming")
|
||||
self.assertEquals(line.qty_delivered, 6,
|
||||
"Wrong qty deliver")
|
||||
self.assertEquals(line.qty_outgoing, 0,
|
||||
"Wrong qty outgoing")
|
||||
if line.product_id == self.product_1:
|
||||
self.assertEquals(line.qty_received, 0,
|
||||
self.assertEquals(line.qty_received, 3,
|
||||
"Wrong qty received")
|
||||
self.assertEquals(line.qty_delivered, 6,
|
||||
"Wrong qty delivered")
|
||||
if line.product_id == self.product_2:
|
||||
self.assertEquals(line.qty_received, 0,
|
||||
self.assertEquals(line.qty_received, 5,
|
||||
"Wrong qty received")
|
||||
self.assertEquals(line.qty_delivered, 5,
|
||||
"Wrong qty delivered")
|
||||
if line.product_id == self.product_3:
|
||||
self.assertEquals(line.qty_received, 2,
|
||||
"Wrong qty received")
|
||||
self.assertEquals(line.qty_delivered, 2,
|
||||
"Wrong qty delivered")
|
||||
for line in self.rma_supplier_id.rma_line_ids:
|
||||
line.action_rma_done()
|
||||
self.assertEquals(line.state, 'done',
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<record id="invoice_form" model="ir.ui.view">
|
||||
<field name="name">account.invoice.form</field>
|
||||
<field name="model">account.invoice</field>
|
||||
@@ -60,7 +58,6 @@
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<record id="view_invoice_supplier_rma_form" model="ir.ui.view">
|
||||
<field name="name">account.invoice.supplier.rma</field>
|
||||
@@ -105,5 +102,4 @@
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="account.view_invoice_line_form"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="rma_operation_tree" model="ir.ui.view">
|
||||
<field name="name">rma.operation.tree</field>
|
||||
<field name="model">rma.operation</field>
|
||||
<field name="inherit_id" ref="rma.rma_operation_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="refund_policy"/>
|
||||
</field>
|
||||
<record id="rma_operation_tree" model="ir.ui.view">
|
||||
<field name="name">rma.operation.tree</field>
|
||||
<field name="model">rma.operation</field>
|
||||
<field name="inherit_id" ref="rma.rma_operation_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="refund_policy"/>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="rma_operation_form" model="ir.ui.view">
|
||||
<field name="name">rma.operation.form</field>
|
||||
<field name="model">rma.operation</field>
|
||||
<field name="inherit_id" ref="rma.rma_operation_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="receipt_policy" position="before">
|
||||
<field name="refund_policy"/>
|
||||
</field>
|
||||
<record id="rma_operation_form" model="ir.ui.view">
|
||||
<field name="name">rma.operation.form</field>
|
||||
<field name="model">rma.operation</field>
|
||||
<field name="inherit_id" ref="rma.rma_operation_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="receipt_policy" position="before">
|
||||
<field name="refund_policy"/>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,47 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_rma_line_supplier_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.line.supplier.form</field>
|
||||
<field name="model">rma.order.line</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_line_supplier_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_view_out_shipments" position="after">
|
||||
<button type="object" name="action_view_refunds"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="refund_count" widget="statinfo"
|
||||
string="Refunds"/>
|
||||
</button>
|
||||
</button>
|
||||
<group name="main_info" position="inside">
|
||||
<field name="invoice_line_id"
|
||||
options="{'no_create': True}"
|
||||
domain="['|',
|
||||
('invoice_id.partner_id', '=', partner_id),
|
||||
('invoice_id.partner_id', 'child_of', partner_id)]"/>
|
||||
</group>
|
||||
<field name="operation_id" position="after">
|
||||
<field name="refund_policy"/>
|
||||
</field>
|
||||
<page name="stock" position="after">
|
||||
<page name="refunds" string="Refunds">
|
||||
<field name="refund_line_ids" nolabel="1"/>
|
||||
</page>
|
||||
</page>
|
||||
<field name="delivery_address_id" position="after">
|
||||
<field name="invoice_address_id"
|
||||
groups='rma.group_rma_delivery_invoice_address'/>
|
||||
</field>
|
||||
<group name="deliver" position="after">
|
||||
<group name="refund">
|
||||
<field name="qty_to_refund"/>
|
||||
<field name="qty_refunded"/>
|
||||
</group>
|
||||
</group>
|
||||
<record id="view_rma_line_supplier_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.line.supplier.form</field>
|
||||
<field name="model">rma.order.line</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_line_supplier_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_view_out_shipments" position="after">
|
||||
<button type="object" name="action_view_refunds"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="refund_count" widget="statinfo"
|
||||
string="Refunds"/>
|
||||
</button>
|
||||
</button>
|
||||
<group name="main_info" position="inside">
|
||||
<field name="invoice_line_id"
|
||||
options="{'no_create': True}"
|
||||
domain="['|',
|
||||
('invoice_id.partner_id', '=', partner_id),
|
||||
('invoice_id.partner_id', 'child_of', partner_id)]"/>
|
||||
</group>
|
||||
<field name="operation_id" position="after">
|
||||
<field name="refund_policy"/>
|
||||
</field>
|
||||
</record>
|
||||
<page name="stock" position="after">
|
||||
<page name="refunds" string="Refunds">
|
||||
<field name="refund_line_ids" nolabel="1"/>
|
||||
</page>
|
||||
</page>
|
||||
<field name="delivery_address_id" position="after">
|
||||
<field name="invoice_address_id"
|
||||
groups='rma.group_rma_delivery_invoice_address'/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_rma_line_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.line.form</field>
|
||||
@@ -69,47 +62,61 @@
|
||||
('invoice_id.partner_id', '=', partner_id),
|
||||
('invoice_id.partner_id', 'child_of', partner_id)]"/>
|
||||
</group>
|
||||
<field name="operation_id" position="after">
|
||||
<field name="refund_policy"/>
|
||||
</field>
|
||||
<page name="stock" position="after">
|
||||
<page name="refunds" string="Refunds">
|
||||
<field name="refund_line_ids" nolabel="1"/>
|
||||
</page>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_rma_line_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.line.form</field>
|
||||
<field name="model">rma.order.line</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_view_out_shipments" position="after">
|
||||
<button type="object" name="action_view_refunds"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="refund_count" widget="statinfo"
|
||||
string="Refunds"/>
|
||||
</button>
|
||||
</button>
|
||||
<group name="main_info" position="inside">
|
||||
<field name="invoice_line_id"
|
||||
options="{'no_create': True}"
|
||||
domain="['|',
|
||||
('invoice_id.partner_id', '=', partner_id),
|
||||
('invoice_id.partner_id', 'child_of', partner_id)]"/>
|
||||
</group>
|
||||
<field name="operation_id" position="after">
|
||||
<field name="refund_policy"/>
|
||||
</field>
|
||||
<page name="stock" position="after">
|
||||
<page name="refunds" string="Refunds">
|
||||
<field name="refund_line_ids" nolabel="1"/>
|
||||
</page>
|
||||
<field name="delivery_address_id" position="after">
|
||||
<field name="invoice_address_id"
|
||||
groups='rma.group_rma_delivery_invoice_address'/>
|
||||
</field>
|
||||
<group name="supplier_rma" position="after">
|
||||
<group name="refund">
|
||||
<field name="qty_to_refund"/>
|
||||
<field name="qty_refunded"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<field name="delivery_address_id" position="after">
|
||||
<field name="invoice_address_id"
|
||||
groups='rma.group_rma_delivery_invoice_address'/>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_rma_rma_line_filter" model="ir.ui.view">
|
||||
<field name="name">rma.order.line.select</field>
|
||||
<field name="model">rma.order.line</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_rma_line_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<filter name="to_refund" string="To Refund" domain="[('qty_to_refund', '>', 0)]"
|
||||
context="{'group_by':'partner_id'}"/>
|
||||
</field>
|
||||
<group name="stock_quantities" position="after">
|
||||
<group name="account_quantities" groups="account.group_account_user">
|
||||
<filter name="to_refund" domain="[('state','!=', 'done'),('qty_to_refund','>',0.0)]" help="To Refund"/>
|
||||
</group>
|
||||
<group name="supplier_rma" position="after">
|
||||
<group name="refund">
|
||||
<field name="qty_to_refund"/>
|
||||
<field name="qty_refunded"/>
|
||||
</group>
|
||||
<filter name="to_deliver" position="after">
|
||||
<filter name="group_to_refund" string="To Refund" domain="[('qty_to_refund', '>', 0)]"
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_rma_rma_line_filter" model="ir.ui.view">
|
||||
<field name="name">rma.order.line.select</field>
|
||||
<field name="model">rma.order.line</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<filter name="to_refund" string="To Refund" domain="[('qty_to_refund', '>', 0)]"
|
||||
context="{'group_by':'partner_id'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,68 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<record id="view_rma_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.form - rma_account</field>
|
||||
<field name="model">rma.order</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_view_out_shipments"
|
||||
position="after">
|
||||
<button type="object" name="action_view_invoice_refund"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="invoice_refund_count" widget="statinfo"
|
||||
string="Refunds"/>
|
||||
</button>
|
||||
<button type="object" name="action_view_invoice"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="invoice_count" widget="statinfo"
|
||||
string="Origin Inv"/>
|
||||
</button>
|
||||
<record id="view_rma_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.form - rma_account</field>
|
||||
<field name="model">rma.order</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_view_out_shipments"
|
||||
position="after">
|
||||
<button type="object" name="action_view_invoice_refund"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="invoice_refund_count" widget="statinfo"
|
||||
string="Refunds"/>
|
||||
</button>
|
||||
<!--
|
||||
<xpath expr="//field[@name='rma_line_ids']/tree/field[@name='price_unit']"
|
||||
position="after">
|
||||
<field name="invoice_line_id" invisible="True"/>
|
||||
</xpath>
|
||||
-->
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_rma_supplier_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.supplier.form</field>
|
||||
<field name="model">rma.order</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_supplier_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_view_out_shipments"
|
||||
position="after">
|
||||
<button type="object" name="action_view_invoice_refund"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="invoice_refund_count" widget="statinfo"
|
||||
string="Refunds"/>
|
||||
</button>
|
||||
<button type="object" name="action_view_invoice"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="invoice_count" widget="statinfo"
|
||||
string="Origin Inv"/>
|
||||
</button>
|
||||
<button type="object" name="action_view_invoice"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="invoice_count" widget="statinfo"
|
||||
string="Origin Inv"/>
|
||||
</button>
|
||||
<!--
|
||||
<xpath expr="//field[@name='rma_line_ids']/tree"
|
||||
position="inside">
|
||||
<field name="invoice_line_id" invisible="True"/>
|
||||
</xpath>
|
||||
-->
|
||||
</field>
|
||||
</record>
|
||||
</button>
|
||||
<!--
|
||||
<xpath expr="//field[@name='rma_line_ids']/tree/field[@name='price_unit']"
|
||||
position="after">
|
||||
<field name="invoice_line_id" invisible="True"/>
|
||||
</xpath>
|
||||
-->
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
<record id="view_rma_supplier_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.supplier.form</field>
|
||||
<field name="model">rma.order</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_supplier_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_view_out_shipments"
|
||||
position="after">
|
||||
<button type="object" name="action_view_invoice_refund"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="invoice_refund_count" widget="statinfo"
|
||||
string="Refunds"/>
|
||||
</button>
|
||||
<button type="object" name="action_view_invoice"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
groups="account.group_account_user">
|
||||
<field name="invoice_count" widget="statinfo"
|
||||
string="Origin Inv"/>
|
||||
</button>
|
||||
</button>
|
||||
<!--
|
||||
<xpath expr="//field[@name='rma_line_ids']/tree"
|
||||
position="inside">
|
||||
<field name="invoice_line_id" invisible="True"/>
|
||||
</xpath>
|
||||
-->
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
@@ -90,10 +89,6 @@ class RmaAddInvoice(models.TransientModel):
|
||||
def _get_rma_data(self):
|
||||
data = {
|
||||
'date_rma': fields.Datetime.now(),
|
||||
'delivery_address_id':
|
||||
self.invoice_line_ids[0].invoice_id.partner_id.id,
|
||||
'invoice_address_id':
|
||||
self.invoice_line_ids[0].invoice_id.partner_id.id
|
||||
}
|
||||
return data
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.tools.safe_eval import safe_eval as eval
|
||||
import odoo.addons.decimal_precision as dp
|
||||
|
||||
|
||||
@@ -38,6 +36,7 @@ class RmaRefund(models.TransientModel):
|
||||
lines the supplier field is empty otherwise is the unique line
|
||||
supplier.
|
||||
"""
|
||||
context = self._context.copy()
|
||||
res = super(RmaRefund, self).default_get(fields)
|
||||
rma_line_obj = self.env['rma.order.line']
|
||||
rma_line_ids = self.env.context['active_ids'] or []
|
||||
@@ -55,6 +54,7 @@ class RmaRefund(models.TransientModel):
|
||||
for line in lines:
|
||||
items.append([0, 0, self._prepare_item(line)])
|
||||
res['item_ids'] = items
|
||||
context.update({'items_ids': items})
|
||||
return res
|
||||
|
||||
date_invoice = fields.Date(
|
||||
@@ -96,11 +96,11 @@ class RmaRefund(models.TransientModel):
|
||||
new_invoice = self.compute_refund()
|
||||
action = 'action_invoice_tree1' if (
|
||||
new_invoice.type in ['out_refund', 'out_invoice']) \
|
||||
else 'action_invoice_tree2'
|
||||
else 'action_invoice_in_refund'
|
||||
result = self.env.ref('account.%s' % action).read()[0]
|
||||
invoice_domain = eval(result['domain'])
|
||||
invoice_domain.append(('id', '=', new_invoice.id))
|
||||
result['domain'] = invoice_domain
|
||||
form_view = self.env.ref('account.invoice_supplier_form', False)
|
||||
result['views'] = [(form_view and form_view.id or False, 'form')]
|
||||
result['res_id'] = new_invoice.id
|
||||
return result
|
||||
|
||||
@api.model
|
||||
@@ -189,8 +189,9 @@ class RmaRefundItem(models.TransientModel):
|
||||
related='line_id.rma_id',
|
||||
string='RMA',
|
||||
readonly=True)
|
||||
product_id = fields.Many2one('product.product', string='Product',
|
||||
readonly=True)
|
||||
product_id = fields.Many2one('product.product', string='Product')
|
||||
product = fields.Many2one('product.product', string='Product',
|
||||
readonly=True)
|
||||
name = fields.Char(string='Description', required=True)
|
||||
product_qty = fields.Float(
|
||||
string='Quantity Ordered', copy=False,
|
||||
|
||||
@@ -1,85 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<record id="view_rma_refund" model="ir.ui.view">
|
||||
<field name="name">rma.refund.form</field>
|
||||
<field name="model">rma.refund</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Credit Note">
|
||||
<group>
|
||||
<group>
|
||||
<field name="description"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date_invoice"/>
|
||||
<field name="date" groups="base.group_no_one"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="item_ids">
|
||||
<tree string="RMA Lines" editable="bottom">
|
||||
<field name="rma_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="name"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="uom_id" groups="product.group_uom"/>
|
||||
<field name="qty_to_refund" readonly="0"/>
|
||||
</tree>
|
||||
</field>
|
||||
<footer>
|
||||
<button string='Create Refund' name="invoice_refund" type="object" class="btn-primary"/>
|
||||
<button string="Cancel" class="btn-default" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_rma_refund" model="ir.actions.act_window">
|
||||
<field name="name">Create Refund</field>
|
||||
<field name="res_model">rma.refund</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_rma_refund"/>
|
||||
<field name="groups_id"
|
||||
eval="[(4, ref('account.group_account_invoice'))]"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record id="view_rma_line_button_refund_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.line.form</field>
|
||||
<field name="model">rma.order.line</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header" position="inside">
|
||||
<button name="%(action_rma_refund)d" states="approved"
|
||||
string="Create Refund" class="oe_highlight"
|
||||
type="action"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_rma_line_supplier_button_refund_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.line.supplier.form</field>
|
||||
<field name="model">rma.order.line</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_line_supplier_button_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header" position="inside">
|
||||
<button name="%(action_rma_refund)d" states="approved"
|
||||
string="Create Refund" class="oe_highlight"
|
||||
type="action"/>
|
||||
</xpath>
|
||||
</field>
|
||||
<record id="view_rma_refund" model="ir.ui.view">
|
||||
<field name="name">rma.refund.form</field>
|
||||
<field name="model">rma.refund</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Credit Note">
|
||||
<group>
|
||||
<group>
|
||||
<field name="description"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date_invoice"/>
|
||||
<field name="date" groups="base.group_no_one"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="item_ids">
|
||||
<tree string="RMA Lines" editable="bottom">
|
||||
<field name="rma_id"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="product"/>
|
||||
<field name="name"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="uom_id" groups="product.group_uom"/>
|
||||
<field name="qty_to_refund" readonly="0"/>
|
||||
</tree>
|
||||
</field>
|
||||
<footer>
|
||||
<button string='Create Refund' name="invoice_refund" type="object" class="btn-primary"/>
|
||||
<button string="Cancel" class="btn-default" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="values_action_rma_refund">
|
||||
<field name="model_id" ref="model_rma_order_line"/>
|
||||
<record id="action_rma_refund" model="ir.actions.act_window">
|
||||
<field name="name">Create Refund</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
<field name="value"
|
||||
eval="'ir.actions.act_window,' + str(ref('action_rma_refund'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">rma.order.line</field>
|
||||
<field name="res_model">rma.refund</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_rma_refund"/>
|
||||
<field name="groups_id"
|
||||
eval="[(4, ref('account.group_account_invoice'))]"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
<record id="view_rma_line_button_refund_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.line.form</field>
|
||||
<field name="model">rma.order.line</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header" position="inside">
|
||||
<button name="%(action_rma_refund)d" states="approved"
|
||||
string="Create Refund" class="oe_highlight"
|
||||
type="action"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_rma_line_supplier_button_refund_form" model="ir.ui.view">
|
||||
<field name="name">rma.order.line.supplier.form</field>
|
||||
<field name="model">rma.order.line</field>
|
||||
<field name="inherit_id" ref="rma.view_rma_line_supplier_button_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header" position="inside">
|
||||
<button name="%(action_rma_refund)d" states="approved"
|
||||
string="Create Refund" class="oe_highlight"
|
||||
type="action"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user