feat(workorders): move address to contact and auto-compute zone
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
from . import dsrpt_communication_type
|
||||
from . import dsrpt_contact
|
||||
from . import dsrpt_contact_address
|
||||
from . import dsrpt_contact_communication
|
||||
from . import contact_event
|
||||
from . import contact_source
|
||||
|
||||
@@ -38,6 +38,11 @@ class Contact(models.Model):
|
||||
'contact_id',
|
||||
string='Events'
|
||||
)
|
||||
address_ids = fields.One2many(
|
||||
'dsrpt.contact.address',
|
||||
'contact_id',
|
||||
string='Addresses'
|
||||
)
|
||||
# call_ids moved to dsrpt_calls module to avoid circular dependencies
|
||||
|
||||
# Computed fields
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ContactAddress(models.Model):
|
||||
_name = "dsrpt.contact.address"
|
||||
_description = "Contact Address"
|
||||
_order = "id desc"
|
||||
_rec_name = "description"
|
||||
|
||||
contact_id = fields.Many2one("dsrpt.contact", required=True, ondelete="cascade", index=True)
|
||||
description = fields.Char(required=True)
|
||||
latitude = fields.Float(digits=(10, 6))
|
||||
longitude = fields.Float(digits=(10, 6))
|
||||
Reference in New Issue
Block a user