Hello all
Sorry for my simple question, maybe,
- I created a small module call project to be able to see different informations related to a project,like sale order, purchase order, delivery, etc... I could add documents by my project form, and see all project i created on my tree view.
- I add on sale order a project number field by inherit. On this field i could add my project, no problem.
What I want to do is, when I add my project number to my sale order form, I could record the sale order number to my project record
- And in the other way when I add my sale order number in my project form, it will update my project number field in the sale order
Model to add project field in sale.order
class orders(models.Model):
_inherit = 'sale.order'
project_number = fields.Many2one('xxxx.project', string="Project #")
class project(models.Model):
_name = 'xxxx.project'
_description = '****'
_rec_name = 'project_seq'
project_seq = fields.Char(string='Project ID', required=True, copy=False, readonly=True, index=True, default='New')
project_name = fields.Char(string='Project Name', required=True)
project_branch_name = fields.Many2one('res.partner', string="Branch")
project_customer_name = fields.Many2one('res.partner', string="Client")
project_start_date = fields.Date(string='Project Date', default=datetime.today(), readonly=True, required=True)
project_purchase_order = fields.Many2one('purchase.order', string="Purchase Order #")
project_sale_order = fields.Many2one('sale.order', string="Sales Order #")
As I'm starting to dev on odoo, my dev level is really poor ;) If someone could explain me how to process will be really really cool :)
Let me now if you need more info to help me
Thanks a lot!!