# -*- coding: utf-8 -*- # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from odoo import fields, models, api class ResPartnerEmancipate(models.TransientModel): _name = "res.partner.emancipate" _description = "Partner Emancipation Wizard" _rec_name = "partner_id" partner_id = fields.Many2one("res.partner", string="Partner", required=True) emancipation_date = fields.Date( string="Emancipation date", required=True, ) def emancipate_partner(self): if self.partner_id.is_company: return {"type": "ir.actions.act_window_close"} self.partner_id.write({"emancipation_date": self.emancipation_date})