mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[MIG] rma: Migration to 17.0
This commit is contained in:
@@ -235,8 +235,6 @@ class RmaOrderLine(models.Model):
|
||||
delivery_address_id = fields.Many2one(
|
||||
comodel_name="res.partner",
|
||||
string="Partner delivery address",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
help="This address will be used to deliver repaired or replacement "
|
||||
"products.",
|
||||
)
|
||||
@@ -250,8 +248,6 @@ class RmaOrderLine(models.Model):
|
||||
string="Reference",
|
||||
required=True,
|
||||
default="/",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
help="Add here the supplier RMA #. Otherwise an internal code is" " assigned.",
|
||||
copy=False,
|
||||
)
|
||||
@@ -259,8 +255,6 @@ class RmaOrderLine(models.Model):
|
||||
conditions = fields.Html(string="Terms and conditions")
|
||||
origin = fields.Char(
|
||||
string="Source Document",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
help="Reference of the document that produced this rma.",
|
||||
)
|
||||
date_rma = fields.Datetime(
|
||||
@@ -298,8 +292,6 @@ class RmaOrderLine(models.Model):
|
||||
required=True,
|
||||
store=True,
|
||||
tracking=True,
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
sequence = fields.Integer(
|
||||
default=10, help="Gives the sequence of this line when displaying the rma."
|
||||
@@ -308,38 +300,28 @@ class RmaOrderLine(models.Model):
|
||||
comodel_name="product.product",
|
||||
ondelete="restrict",
|
||||
required=True,
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
product_tracking = fields.Selection(related="product_id.tracking")
|
||||
lot_id = fields.Many2one(
|
||||
comodel_name="stock.lot",
|
||||
string="Lot/Serial Number",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
product_qty = fields.Float(
|
||||
string="Return Qty",
|
||||
copy=False,
|
||||
default=1.0,
|
||||
digits="Product Unit of Measure",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
uom_id = fields.Many2one(
|
||||
comodel_name="uom.uom",
|
||||
string="Unit of Measure",
|
||||
required=True,
|
||||
readonly=True,
|
||||
compute="_compute_uom_id",
|
||||
precompute=True,
|
||||
store=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
price_unit = fields.Monetary(
|
||||
string="Unit cost",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
help="Unit cost of the items under RMA",
|
||||
)
|
||||
in_shipment_count = fields.Integer(
|
||||
@@ -355,8 +337,6 @@ class RmaOrderLine(models.Model):
|
||||
comodel_name="stock.move",
|
||||
string="Originating Stock Move",
|
||||
copy=False,
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
currency_id = fields.Many2one(
|
||||
"res.currency",
|
||||
@@ -375,13 +355,9 @@ class RmaOrderLine(models.Model):
|
||||
)
|
||||
customer_to_supplier = fields.Boolean(
|
||||
"The customer will send to the supplier",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
supplier_to_customer = fields.Boolean(
|
||||
"The supplier will send to the customer",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
receipt_policy = fields.Selection(
|
||||
[
|
||||
@@ -409,45 +385,35 @@ class RmaOrderLine(models.Model):
|
||||
string="Inbound Route",
|
||||
required=True,
|
||||
domain=[("rma_selectable", "=", True)],
|
||||
readonly=True,
|
||||
compute="_compute_in_route_id",
|
||||
precompute=True,
|
||||
store=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
out_route_id = fields.Many2one(
|
||||
"stock.route",
|
||||
string="Outbound Route",
|
||||
required=True,
|
||||
domain=[("rma_selectable", "=", True)],
|
||||
readonly=True,
|
||||
compute="_compute_out_route_id",
|
||||
precompute=True,
|
||||
store=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
in_warehouse_id = fields.Many2one(
|
||||
comodel_name="stock.warehouse",
|
||||
string="Inbound Warehouse",
|
||||
required=True,
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
default=lambda self: self._default_warehouse_id(),
|
||||
)
|
||||
out_warehouse_id = fields.Many2one(
|
||||
comodel_name="stock.warehouse",
|
||||
string="Outbound Warehouse",
|
||||
required=True,
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
default=lambda self: self._default_warehouse_id(),
|
||||
)
|
||||
location_id = fields.Many2one(
|
||||
comodel_name="stock.location",
|
||||
string="Send To This Company Location",
|
||||
required=True,
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
default=lambda self: self._default_location_id(),
|
||||
)
|
||||
customer_rma_id = fields.Many2one(
|
||||
@@ -459,15 +425,11 @@ class RmaOrderLine(models.Model):
|
||||
)
|
||||
supplier_address_id = fields.Many2one(
|
||||
comodel_name="res.partner",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
string="Supplier Address",
|
||||
help="Address of the supplier in case of Customer RMA operation " "dropship.",
|
||||
)
|
||||
customer_address_id = fields.Many2one(
|
||||
comodel_name="res.partner",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
string="Customer Address",
|
||||
help="Address of the customer in case of Supplier RMA operation " "dropship.",
|
||||
)
|
||||
@@ -526,9 +488,7 @@ class RmaOrderLine(models.Model):
|
||||
compute="_compute_qty_supplier_rma",
|
||||
store=True,
|
||||
)
|
||||
under_warranty = fields.Boolean(
|
||||
string="Under Warranty?", readonly=True, states={"draft": [("readonly", False)]}
|
||||
)
|
||||
under_warranty = fields.Boolean(string="Under Warranty?")
|
||||
|
||||
def _prepare_rma_line_from_stock_move(self, sm, lot=False):
|
||||
if not self.type:
|
||||
|
||||
Reference in New Issue
Block a user