diff --git a/rma_account/__manifest__.py b/rma_account/__manifest__.py
index d09316bd..602c560e 100644
--- a/rma_account/__manifest__.py
+++ b/rma_account/__manifest__.py
@@ -3,12 +3,12 @@
{
"name": "RMA Account",
- "version": "13.0.1.0.0",
+ "version": "14.0.1.0.0",
"license": "LGPL-3",
"category": "RMA",
"summary": "Integrates RMA with Invoice Processing",
"author": "ForgeFlow",
- "website": "https://github.com/OCA/account-budgeting",
+ "website": "https://github.com/OCA/https://github.com/ForgeFlow/stock-rma",
"depends": ["stock_account", "rma"],
"data": [
"security/ir.model.access.csv",
diff --git a/rma_account/models/rma_order.py b/rma_account/models/rma_order.py
index 7680c7f2..747316c2 100644
--- a/rma_account/models/rma_order.py
+++ b/rma_account/models/rma_order.py
@@ -103,7 +103,6 @@ class RmaOrder(models.Model):
"domain": [("id", "in", move_ids)],
"name": "Refunds",
"res_model": "account.move",
- "type": "ir.actions.act_window",
"views": [(tree_view_ref.id, "tree"), (form_view_ref.id, "form")],
}
@@ -116,6 +115,5 @@ class RmaOrder(models.Model):
"domain": [("id", "in", move_ids)],
"name": "Originating Invoice",
"res_model": "account.move",
- "type": "ir.actions.act_window",
"views": [(tree_view_ref.id, "tree"), (form_view_ref.id, "form")],
}
diff --git a/rma_account/models/rma_order_line.py b/rma_account/models/rma_order_line.py
index 1f871392..64b1f0b8 100644
--- a/rma_account/models/rma_order_line.py
+++ b/rma_account/models/rma_order_line.py
@@ -119,18 +119,26 @@ class RmaOrderLine(models.Model):
res = super(RmaOrderLine, self)._onchange_product_id()
if not res.get("domain"):
res["domain"] = {}
- domain = [
- "&",
- "&",
- ("rma_line_id", "=", False),
- ("exclude_from_invoice_tab", "=", False),
- "|",
- ("move_id.partner_id", "=", self.partner_id.id),
- ("move_id.partner_id", "child_of", self.partner_id.id),
- ]
- # if self.product_id:
- # domain.insert(2, ("product_id", "=", self.product_id.id))
- res["domain"]["account_move_line_id"] = domain
+ if not self.product_id:
+ domain = [
+ "&",
+ "|",
+ ("move_id.partner_id", "=", self.partner_id.id),
+ ("move_id.partner_id", "child_of", self.partner_id.id),
+ ("exclude_from_invoice_tab", "=", False),
+ ]
+ res["domain"]["account_move_line_id"] = domain
+ else:
+ domain = [
+ "&",
+ "&",
+ "|",
+ ("move_id.partner_id", "=", self.partner_id.id),
+ ("move_id.partner_id", "child_of", self.partner_id.id),
+ ("exclude_from_invoice_tab", "=", False),
+ ("product_id", "=", self.product_id.id),
+ ]
+ res["domain"]["account_move_line_id"] = domain
return res
def _prepare_rma_line_from_inv_line(self, line):
diff --git a/rma_account/security/ir.model.access.csv b/rma_account/security/ir.model.access.csv
index 74b1c356..75b11edf 100644
--- a/rma_account/security/ir.model.access.csv
+++ b/rma_account/security/ir.model.access.csv
@@ -3,3 +3,9 @@ access_account_move_customer_user,access_account_move,account.model_account_move
access_account_move_supplier_user,access_account_move,account.model_account_move,rma.group_rma_supplier_user,1,0,0,0
access_account_move_line_customer_user,access_account_move_line,account.model_account_move_line,rma.group_rma_customer_user,1,0,0,0
access_account_move_line_supplier_user,access_account_move_line,account.model_account_move_line,rma.group_rma_supplier_user,1,0,0,0
+access_rma_refund_customer_user_item,rma.refund.customer.user,model_rma_refund,rma.group_rma_customer_user,1,1,1,1
+access_rma_refund_supplier_user_item,rma.refund.supplier.user,model_rma_refund,rma.group_rma_supplier_user,1,1,1,1
+access_rma_refund_item_customer_user_item,rma.refund.item.customer.user,model_rma_refund_item,rma.group_rma_customer_user,1,1,1,1
+access_rma_refund_item_supplier_user_item,rma.refund.item.supplier.user,model_rma_refund_item,rma.group_rma_supplier_user,1,1,1,1
+access_rma_add_account_move_customer_user_item,rma.add.account.move.customer.user,model_rma_add_account_move,rma.group_rma_customer_user,1,1,1,1
+access_rma_add_account_move_supplier_user_item,rma.add.account.move.supplier.user,model_rma_add_account_move,rma.group_rma_supplier_user,1,1,1,1
diff --git a/rma_account/tests/test_rma_account.py b/rma_account/tests/test_rma_account.py
index ab237287..c6ffc803 100644
--- a/rma_account/tests/test_rma_account.py
+++ b/rma_account/tests/test_rma_account.py
@@ -78,7 +78,7 @@ class TestRmaAccount(common.SingleTransactionCase):
cls.invoices = cls.env["account.move"].create(
[
{
- "type": "out_invoice",
+ "move_type": "out_invoice",
"partner_id": customer1.id,
"invoice_date": fields.Date.from_string("2016-01-01"),
"currency_id": cls.currency_id.id,
@@ -106,7 +106,7 @@ class TestRmaAccount(common.SingleTransactionCase):
],
},
{
- "type": "in_invoice",
+ "move_type": "in_invoice",
"partner_id": supplier1.id,
"invoice_date": fields.Date.from_string("2016-01-01"),
"currency_id": cls.currency_id.id,
diff --git a/rma_account/views/account_move_view.xml b/rma_account/views/account_move_view.xml
index 553f8559..19c96358 100644
--- a/rma_account/views/account_move_view.xml
+++ b/rma_account/views/account_move_view.xml
@@ -55,11 +55,10 @@
diff --git a/rma_account/views/rma_order_line_view.xml b/rma_account/views/rma_order_line_view.xml
index c6671dcf..20bc2aef 100644
--- a/rma_account/views/rma_order_line_view.xml
+++ b/rma_account/views/rma_order_line_view.xml
@@ -29,7 +29,7 @@
name="account_move_line_id"
options="{'no_create': True}"
context="{'rma': True}"
- domain="['|',
+ domain="[('move_id.move_type', 'not in', ['entry','out_invoice','out_refund']), '|',
('move_id.partner_id', '=', partner_id),
('move_id.partner_id', 'child_of', partner_id)]"
/>
@@ -86,7 +86,7 @@
name="account_move_line_id"
options="{'no_create': True}"
context="{'rma': True}"
- domain="['|',
+ domain="[('move_id.move_type', '!=', 'entry'), '|',
('move_id.partner_id', '=', partner_id),
('move_id.partner_id', 'child_of', partner_id)]"
/>
diff --git a/rma_account/wizards/rma_add_account_move.xml b/rma_account/wizards/rma_add_account_move.xml
index 70047ed8..fbc0ba11 100644
--- a/rma_account/wizards/rma_add_account_move.xml
+++ b/rma_account/wizards/rma_add_account_move.xml
@@ -7,17 +7,12 @@