mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[IMP] COPIER UPDATE: black, isort, prettier
This commit is contained in:
committed by
DavidJForgeFlow
parent
0a89002a19
commit
3e7ab5452e
@@ -26,7 +26,7 @@ class AccountMove(models.Model):
|
||||
"product_uom_id": line.uom_id.id,
|
||||
"product_id": line.product_id.id,
|
||||
"account_id": invoice_line.with_context(
|
||||
{"journal_id": self.journal_id.id, "type": "in_invoice"}
|
||||
**{"journal_id": self.journal_id.id, "type": "in_invoice"}
|
||||
)._default_account(),
|
||||
"price_unit": line.company_id.currency_id.with_context(
|
||||
date=self.date
|
||||
|
||||
@@ -14,7 +14,6 @@ class RmaOperation(models.Model):
|
||||
("delivered", "Based on Delivered Quantities"),
|
||||
("received", "Based on Received Quantities"),
|
||||
],
|
||||
string="Refund Policy",
|
||||
default="no",
|
||||
)
|
||||
|
||||
|
||||
@@ -90,13 +90,11 @@ class RmaOrderLine(models.Model):
|
||||
("delivered", "Based on Delivered Quantities"),
|
||||
("received", "Based on Received Quantities"),
|
||||
],
|
||||
string="Refund Policy",
|
||||
required=True,
|
||||
default="no",
|
||||
readonly=False,
|
||||
)
|
||||
qty_to_refund = fields.Float(
|
||||
string="Qty To Refund",
|
||||
copy=False,
|
||||
digits="Product Unit of Measure",
|
||||
readonly=True,
|
||||
@@ -104,7 +102,6 @@ class RmaOrderLine(models.Model):
|
||||
store=True,
|
||||
)
|
||||
qty_refunded = fields.Float(
|
||||
string="Qty Refunded",
|
||||
copy=False,
|
||||
digits="Product Unit of Measure",
|
||||
readonly=True,
|
||||
@@ -252,9 +249,9 @@ class RmaOrderLine(models.Model):
|
||||
if len(matching_inv_lines) > 1:
|
||||
raise UserError(
|
||||
_(
|
||||
"There's an rma for the invoice line %s "
|
||||
"and invoice %s"
|
||||
% (line.account_move_line_id, line.account_move_line_id.move_id)
|
||||
"There's an rma for the invoice line %(arg1)s and invoice %(arg2)s",
|
||||
arg1=line.account_move_line_id,
|
||||
arg2=line.account_move_line_id.move_id,
|
||||
)
|
||||
)
|
||||
return {}
|
||||
|
||||
@@ -155,7 +155,7 @@ class TestRmaAccount(common.SingleTransactionCase):
|
||||
def test_01_add_from_invoice_customer(self):
|
||||
"""Test wizard to create RMA from a customer invoice."""
|
||||
add_inv = self.rma_add_invoice_wiz.with_context(
|
||||
{
|
||||
**{
|
||||
"customer": True,
|
||||
"active_ids": self.rma_group_customer.id,
|
||||
"active_model": "rma.order",
|
||||
@@ -178,7 +178,7 @@ class TestRmaAccount(common.SingleTransactionCase):
|
||||
def test_02_add_from_invoice_supplier(self):
|
||||
"""Test wizard to create RMA from a vendor bill."""
|
||||
add_inv = self.rma_add_invoice_wiz.with_context(
|
||||
{
|
||||
**{
|
||||
"supplier": True,
|
||||
"active_ids": self.rma_group_supplier.id,
|
||||
"active_model": "rma.order",
|
||||
@@ -217,7 +217,11 @@ class TestRmaAccount(common.SingleTransactionCase):
|
||||
self.assertEqual(rma.qty_to_refund, 2.0)
|
||||
self.assertEqual(rma.qty_refunded, 0.0)
|
||||
make_refund = self.rma_refund_wiz.with_context(
|
||||
{"customer": True, "active_ids": rma.ids, "active_model": "rma.order.line"}
|
||||
**{
|
||||
"customer": True,
|
||||
"active_ids": rma.ids,
|
||||
"active_model": "rma.order.line",
|
||||
}
|
||||
).create({"description": "Test refund"})
|
||||
make_refund.invoice_refund()
|
||||
rma.refund_line_ids.move_id.action_post()
|
||||
@@ -242,7 +246,7 @@ class TestRmaAccount(common.SingleTransactionCase):
|
||||
def test_06_default_journal(self):
|
||||
self.operation_1.write({"refund_journal_id": self.journal_sale.id})
|
||||
add_inv = self.rma_add_invoice_wiz.with_context(
|
||||
{
|
||||
**{
|
||||
"customer": True,
|
||||
"active_ids": self.rma_group_customer_2.id,
|
||||
"active_model": "rma.order",
|
||||
@@ -255,7 +259,11 @@ class TestRmaAccount(common.SingleTransactionCase):
|
||||
rma.action_rma_to_approve()
|
||||
rma.action_rma_approve()
|
||||
make_refund = self.rma_refund_wiz.with_context(
|
||||
{"customer": True, "active_ids": rma.ids, "active_model": "rma.order.line"}
|
||||
**{
|
||||
"customer": True,
|
||||
"active_ids": rma.ids,
|
||||
"active_model": "rma.order.line",
|
||||
}
|
||||
).create({"description": "Test refund"})
|
||||
make_refund.invoice_refund()
|
||||
rma.refund_line_ids.move_id.action_post()
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
name="line_ids"
|
||||
domain="[('move_id.partner_id', '=', partner_id)]"
|
||||
>
|
||||
<tree string="Invoice Lines">
|
||||
<tree name="Invoice Lines">
|
||||
<field name="move_id" />
|
||||
<field name="name" />
|
||||
<field
|
||||
@@ -62,7 +62,7 @@
|
||||
name="line_ids"
|
||||
domain="[('move_id.partner_id', '=', partner_id)]"
|
||||
>
|
||||
<tree string="Invoice Lines">
|
||||
<tree name="Invoice Lines">
|
||||
<field name="move_id" />
|
||||
<field name="name" />
|
||||
<field
|
||||
|
||||
@@ -195,7 +195,7 @@ class RmaRefundItem(models.TransientModel):
|
||||
)
|
||||
rma_id = fields.Many2one("rma.order", related="line_id.rma_id", string="RMA")
|
||||
product_id = fields.Many2one("product.product", string="Product (Technical)")
|
||||
product = fields.Many2one("product.product", string="Product", required=True)
|
||||
product = fields.Many2one("product.product", required=True)
|
||||
name = fields.Char(string="Description", required=True)
|
||||
product_qty = fields.Float(
|
||||
string="Quantity Ordered",
|
||||
@@ -215,5 +215,4 @@ class RmaRefundItem(models.TransientModel):
|
||||
("ordered", "Based on Ordered Quantities"),
|
||||
("received", "Based on Received Quantities"),
|
||||
],
|
||||
string="Refund Policy",
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</group>
|
||||
</group>
|
||||
<field name="item_ids">
|
||||
<tree string="RMA Lines" editable="bottom">
|
||||
<tree name="RMA Lines" editable="bottom">
|
||||
<field name="rma_id" invisible="1" readonly="1" />
|
||||
<field name="product_id" invisible="1" readonly="1" />
|
||||
<field name="product" />
|
||||
|
||||
Reference in New Issue
Block a user