mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[MIG]rma_sale v13
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2020 ForgeFlow S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from . import rma_order_line_make_sale_order
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2020 ForgeFlow S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
@@ -80,8 +80,11 @@ class RmaAddSale(models.TransientModel):
|
||||
"product_qty": line.product_uom_qty,
|
||||
"delivery_address_id": self.sale_id.partner_id.id,
|
||||
"invoice_address_id": self.sale_id.partner_id.id,
|
||||
"price_unit": line.currency_id.compute(
|
||||
line.price_unit, line.currency_id, round=False
|
||||
"price_unit": line.currency_id._convert(
|
||||
line.price_unit,
|
||||
line.currency_id,
|
||||
line.company_id,
|
||||
line.order_id.date_order,
|
||||
),
|
||||
"rma_id": self.rma_id.id,
|
||||
"in_route_id": operation.in_route_id.id or route.id,
|
||||
@@ -101,11 +104,7 @@ class RmaAddSale(models.TransientModel):
|
||||
|
||||
@api.model
|
||||
def _get_rma_data(self):
|
||||
data = {
|
||||
"date_rma": fields.Datetime.now(),
|
||||
"delivery_address_id": self.sale_id.partner_id.id,
|
||||
"invoice_address_id": self.sale_id.partner_id.id,
|
||||
}
|
||||
data = {"date_rma": fields.Datetime.now()}
|
||||
return data
|
||||
|
||||
@api.model
|
||||
@@ -115,7 +114,6 @@ class RmaAddSale(models.TransientModel):
|
||||
existing_sale_lines.append(rma_line.sale_line_id)
|
||||
return existing_sale_lines
|
||||
|
||||
@api.multi
|
||||
def add_lines(self):
|
||||
rma_line_obj = self.env["rma.order.line"]
|
||||
existing_sale_lines = self._get_existing_sale_lines()
|
||||
|
||||
@@ -54,8 +54,6 @@
|
||||
<field name="name">Add Sale Order</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">rma_add_sale</field>
|
||||
<field name="src_model">rma.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="view_id" ref="view_rma_add_sale"/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2020 ForgeFlow S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2020 ForgeFlow S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from odoo import _, api, exceptions, fields, models
|
||||
|
||||
import odoo.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class RmaLineMakeSaleOrder(models.TransientModel):
|
||||
_name = "rma.order.line.make.sale.order"
|
||||
@@ -96,7 +94,6 @@ class RmaLineMakeSaleOrder(models.TransientModel):
|
||||
vals["price_unit"] = 0.0
|
||||
return vals
|
||||
|
||||
@api.multi
|
||||
def make_sale_order(self):
|
||||
res = []
|
||||
sale_obj = self.env["sale.order"]
|
||||
@@ -139,9 +136,7 @@ class RmaLineMakeSaleOrderItem(models.TransientModel):
|
||||
)
|
||||
product_id = fields.Many2one(comodel_name="product.product", string="Product")
|
||||
name = fields.Char(string="Description")
|
||||
product_qty = fields.Float(
|
||||
string="Quantity to sell", digits=dp.get_precision("Product UoS")
|
||||
)
|
||||
product_qty = fields.Float(string="Quantity to sell", digits="Product UoS")
|
||||
product_uom_id = fields.Many2one(comodel_name="uom.uom", string="UoM")
|
||||
out_warehouse_id = fields.Many2one(
|
||||
comodel_name="stock.warehouse", string="Outbound Warehouse"
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
<field name="name">Create Sales Quotation</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">rma.order.line.make.sale.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_rma_order_line_make_sale_order"/>
|
||||
<field name="target">new</field>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# Copyright 2020 ForgeFlow S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
Reference in New Issue
Block a user