Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
Hi,
Link a specific service product (e.g., "10-Session Personal Training Package") to a contact (e.g., a personal trainer) in Odoo using a Many2one field.
Steps to Implement:
1. Create the Service Product
Go to Sales > Products.
Click Create.
Set:
Name: 10-Session Personal Training Package
Product Type: Service
Add other details (price, invoice policy, etc.)
Save the product.
2. Add a Many2one Field to Contacts (res.partner)
Use custom code or Odoo Studio.
Field details:
Name: training_package_id
Type: Many2one
Related Model: product.product
Domain: [('type', '=', 'service')] - so only service products appear.
3. Code Example (if using Python code)
class ResPartner(models.Model):
_inherit = 'res.partner'
training_package_id = fields.Many2one(
'product.product',
string='Assigned Training Package',
domain=[('type', '=', 'service')],
)
4. Use It in Contacts
Go to Contacts > Open a Trainer's Profile.
You’ll see the new dropdown field.
Select the desired service product (e.g., the 10-session package).
5. Result
Each trainer/contact can be linked to one specific training service.
Can be used for filtering, reporting, or invoicing logic later.
Hope it helps.
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire