I have add field which called project name in the invoice from view, and I want to add domain for to show which when I choose the customer name will show for me only the projects linked to him
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilitat
- Inventari
- PoS
- Project
- MRP
This question has been flagged
Hello Isa MArzooq,
To render project associated with customer, we need to update few things
At view level set below code
Also you need to set computer method
project_name = fields.Many2many(
'project.project', string="Project Names", compute='_compute_project_name')
@api.depends('partner_id')
def _compute_project_name(self):
for move in self:
if move.partner_id:
# Fetch all projects related to the partner_id
projects = self.env['project.project'].search(
[('partner_id', '=', move.partner_id.id)])
move.project_name = projects
else:
move.project_name = False
I hope this will help you. Please let me know if you need any further support.
Thanks
Vimal Rughani (Founder and CTO)
Himanjali Intelligent Automation Pvt Ltd
Contact: +91- 972-606-7737
Email: hello@himanjali.com
Newsletter: The Odoo Scoop
Website: www.himanjali.com
Hello,
I believe that you have created a new field "project_id" which is many2one of project.project model.
Now the project.project model has many2one field called "partner_id" of res.partner model.
As per your requirement, we need to allow the user to choose a project which has the same partner as selected in invoice.
Add following domain in form view to define project_id field:
Thanks & Regards,
CandidRoot Solutions Pvt. Ltd.
Mobile: (+91) 8849036209
Email: info@candidroot.com
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-se