You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
692 B
20 lines
692 B
# -*- 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})
|