[NEW] Addons creation - product_rental_inspection
This commit is contained in:
27
product_rental_inspection/models/stock_picking.py
Normal file
27
product_rental_inspection/models/stock_picking.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = "stock.picking"
|
||||
|
||||
def action_view_inspections(self):
|
||||
product_ids = [
|
||||
product.product_id.id for product in self.move_ids_without_package
|
||||
]
|
||||
ctx = {
|
||||
"default_customer_id": self.partner_id.id,
|
||||
"default_source_document": self.origin,
|
||||
"default_location_id": self.location_id.id,
|
||||
"default_phone": self.partner_id.phone,
|
||||
"product_list": product_ids,
|
||||
}
|
||||
return {
|
||||
"name": _("Rental Inspection"),
|
||||
"view_type": "form",
|
||||
"view_mode": "tree,form",
|
||||
"res_model": "rental.product.inspection",
|
||||
"type": "ir.actions.act_window",
|
||||
"context": ctx,
|
||||
}
|
Reference in New Issue
Block a user