You are currently viewing Internal Owner Transfer in Odoo By FAIRCHANCE FOR CRM

Internal Owner Transfer in Odoo By FAIRCHANCE FOR CRM

In businesses that rely on asset management, inventory control, or internal transfers, managing the ownership of items, such as products, equipment, or even stock, is crucial. One common use case in Internal Owner Transfer in Odoo which allows businesses to transfer items or products between departments, locations, or even change their owner within the company. While Odoo offers robust tools for managing products and inventory, internal owner transfers may require custom configurations to suit specific business needs.

In this article, we will explore how to handle internal owner transfers in Odoo, provide examples, and walk through some practical code snippets for customizing the process.

Also Read:

What is an Internal Owner Transfer in Odoo?

An internal owner transfer refers to the process of changing the ownership of a product or item within a company without any financial transaction. This process typically occurs when inventory items, such as stock, equipment, or tools, need to be reassigned from one department, employee, or warehouse to another. For example:

  • Transferring stock between warehouses.
  • Changing the owner of an item from one department to another.
  • Moving assets within the company for operational purposes.

Although Odoo has powerful inventory management features, it doesn’t always offer a built-in feature to specifically manage internal ownership changes. However, with a little customization, this process can be made efficient and well-tracked.

Key Features of Internal Owner Transfer in Odoo

  1. Tracking Ownership: Odoo typically tracks ownership through product movements (e.g., sales, purchases, or inventory adjustments), but internal owner transfers help manage internal tracking, especially when ownership needs to be changed without triggering an external transaction.
  2. Inventory Adjustments: Internal transfers can often be treated as stock movements, where no money is exchanged, but products are moved within locations or across departments.
  3. Departmental Transfers: The owner of an item might be assigned to a specific department or individual, and internal owner transfers help reflect these changes without the need for an external sale.
  4. Audit and Reporting: Proper tracking of internal owner transfers ensures that audits and internal reports remain accurate, showing where each item or asset is located and who owns it.

How to Implement Internal Owner Transfer in Odoo

To implement internal owner transfers, we’ll typically be working with custom models or extending existing models, especially the stock.move model, which manages stock movements. Additionally, you can integrate employee or department ownership into your custom workflow.

Example 1: Creating an Internal Transfer for a Product Ownership Change

Let’s walk through a simple scenario where we create an internal transfer of ownership from one employee to another for a given product in the inventory.

Code Snippet for Managing Internal Ownership Transfer

To track the internal owner transfer, we can create a custom model that records the ownership and handles the transfer logic.

python
from odoo import models, fields, api
from odoo.exceptions import UserError
class ProductOwnerTransfer(models.Model):
_name = ‘product.owner.transfer’
_description = ‘Product Owner Transfer’

product_id = fields.Many2one(‘product.product’, string=‘Product’, required=True)
current_owner = fields.Many2one(‘res.partner’, string=‘Current Owner’, required=True)
new_owner = fields.Many2one(‘res.partner’, string=‘New Owner’, required=True)
transfer_date = fields.Datetime(string=‘Transfer Date’, default=fields.Datetime.now)

@api.model
def transfer_ownership(self, product_id, new_owner_id):
product = self.env[‘product.product’].browse(product_id)
current_owner = product.owner_id # Assuming a relationship field for product owner

if not product:
raise UserError(“Product not found!”)

# Perform the transfer of ownership
product.write({‘owner_id’: new_owner_id})

# Record the transfer in the Product Owner Transfer model
self.create({
‘product_id’: product_id,
‘current_owner’: current_owner.id,
‘new_owner’: new_owner_id,
‘transfer_date’: fields.Datetime.now(),
})

return True

Key points in the code:

  • Product and Owner Relationship: This code assumes that each product has an associated owner, represented by a Many2one relation to res.partner (partners can be employees, departments, etc.).
  • Ownership Transfer Logic: The transfer_ownership method moves the ownership from the current owner to the new owner.
  • Audit Recording: The transfer is recorded in a custom model product.owner.transfer for audit and tracking purposes.

Example 2: Transfer Product Between Locations with Ownership Update

Another scenario could involve transferring a product between two warehouse locations while also changing the owner or department associated with that product.

python
class StockMove(models.Model):
_inherit = 'stock.move'
new_owner_id = fields.Many2one(‘res.partner’, string=‘New Owner’)

def action_done(self):
# Call the original action_done method
super(StockMove, self).action_done()

for move in self:
if move.new_owner_id:
# Update product ownership when the move is done
move.product_id.write({‘owner_id’: move.new_owner_id.id})
return True

Key points in this extension:

  • Custom Field: new_owner_id is added to the stock.move model to associate a new owner during stock transfers.
  • Override action_done: When a stock move is completed (via action_done), we also check if there’s a new owner defined and update the product’s owner accordingly.

FAQs on Internal Owner Transfer in Odoo

1. What is the difference between an internal owner transfer and a regular stock move?

An internal owner transfer is primarily focused on changing the ownership of a product or asset within the organization without involving any external financial transactions. A stock move, on the other hand, typically involves the physical movement of products between locations, and may or may not include ownership changes.

2. Can I track product ownership in Odoo by default?

Odoo does not have a built-in ownership field for products by default. However, you can extend the product.product model to add an owner_id field (linked to res.partner or any other entity) and track product ownership internally.

3. How can I create reports on internal owner transfers?

To track internal owner transfers, you can create custom reports based on the product.owner.transfer model (or similar custom models). These reports can show the historical changes in ownership, including product details, previous and new owners, and transfer dates.

Example SQL query for custom reporting:

sql
SELECT pt.product_id, pt.current_owner, pt.new_owner, pt.transfer_date
FROM product_owner_transfer pt
WHERE pt.transfer_date >= '2024-01-01' AND pt.transfer_date <= '2024-12-31'
ORDER BY pt.transfer_date;

4. Can I automate internal ownership transfers when a product is moved?

Yes, you can automate ownership transfers by overriding the stock move methods, as demonstrated in the examples above. When a product is moved from one location to another, you can add logic to check for a change in ownership and automatically update it based on predefined conditions.

5. Can employees directly transfer ownership of products to themselves?

Yes, depending on the permissions and configurations you set in Odoo, employees or other users with the right access can initiate ownership transfers. You may want to configure permissions carefully to ensure that only authorized users can perform this action.

Conclusion

Internal Owner Transfer in Odoo are a vital part of asset management, especially when it comes to tracking products, equipment, or resources within an organization. While Odoo doesn’t provide a dedicated feature for this, it offers a highly customizable framework that allows businesses to build internal ownership transfer systems based on their specific needs. By using custom fields, models, and logic for stock moves or transfers, businesses can efficiently track and manage ownership changes within their organization, ensuring smooth operations and compliance with internal processes.

For more information about Internal Owner Transfer in Odoo, visit this link.

If you want to Free Trail Zoho, click on this link.

Yasir Baig

My name is Mirza Yasir Baig. As an experienced content writer and web developer, I specialize in creating impactful digital experiences. With expertise in WordPress programming and the MERN stack, I have built and managed various web platforms, including the different a dedicated resource for both Pakistani and international students seeking quality courses and training programs. My work is driven by a passion for education and technology, ensuring that content is not only engaging but also optimized for search engines (SEO) to reach a wider audience.

Leave a Reply