Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ofelix03/d68cb766cfbf37bb1fcb01fe125f519a to your computer and use it in GitHub Desktop.
Save ofelix03/d68cb766cfbf37bb1fcb01fe125f519a to your computer and use it in GitHub Desktop.
from odoo import fields, models
class Property(models.Model):
_name = "realtor.property"
_description = "Real Estate Property"
name = fields.Char(required=True)
manager_id = fields.Many2one(
comodel_name="realtor.property.manager", string="Manager", required=True
)
amenity_ids = fields.One2many(
comodel_name="realtor.property.amenity",
inverse_name="property_id",
required=True,
)
location = fields.Char(required=True)
cover_image = fields.Binary(attachment=True)
def action_interested(self):
template = self.env.ref("realtor.interested_property_template")
template.send_mail(self.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment