Files
odoo_source/addons/website/wizard/website_robots.py
T
Victor Feyens 5dc8b7bdd8 [IMP] *: replace default_get overrides by default attribute on fields.
Leave the generic management of fields default to the orm as much as
possible.

* Default method is not called unless necessary.
* Default values are correctly post-processed by the orm when necessary.
2020-07-23 16:38:17 +00:00

15 lines
507 B
Python

# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class WebsiteRobots(models.TransientModel):
_name = "website.robots"
_description = "Robots.txt Editor"
content = fields.Text(default=lambda s: s.env['website'].get_current_website().robots_txt)
def action_save(self):
self.env['website'].get_current_website().robots_txt = self.content
return {'type': 'ir.actions.act_window_close'}