Hello,
To calculate the commission for employees in Odoo, you can create a custom module or use an existing one that supports commission calculation. In your scenario, you can create a rule to attribute the fee for each service to the respective doctor. Here’s a high-level idea of how you can do it:
Create a new model for the commission rule. This model should have fields like doctor_id, service_id, and commission_percentage.
Create records for each doctor-service pair. For example, you can create a record with doctor_id of David, service_id of stomach checkup, and commission_percentage of 10%.
Override the create/write method of the sales order line. In this method, check if the product in the sales order line is a service and if the sales order has a doctor assigned. If both conditions are met, find the commission rule for the doctor-service pair and calculate the commission amount.
Store the commission amount in a new field in the sales order line. This way, you can see the commission for each service in the sales order.
Create a scheduled action to pay out the commission. This action should sum up the commission amounts for each doctor and create accounting entries to pay out the commission.
Please note that this is a high-level idea and the actual implementation may vary depending on your specific requirements and the version of Odoo you are using. If you are not familiar with Odoo development, I recommend hiring a professional Odoo developer or consulting with Odoo’s professional services.
Regards,
Maciej