Purpose ======= Some formviews are useless since there are so few relevant fields https://nimb.ws/1EdMV7 For instance, to create a new lost reason the user is forced to: 1. Hit create 2. Type in the name of the record 3. Hit save 4. Go back to the treeview While he could simply type them away in an editable treeview. The goal of this task is to allow for creation/edition of records in such models directly from the treeview. Specification ============= Modify tree views from a given list of models for which the treeview has to be made editable bottom. If not specified otherwise, the content treeview should stay the same. If a field is readonly/required/etc. in the formview, it should be in the editable treeview as well. Relabeling has to be done of the field itself, not in the view. TaskID: 2026126 closes odoo/odoo#34577 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
30 lines
747 B
Python
30 lines
747 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class UtmMedium(models.Model):
|
|
# OLD crm.case.channel
|
|
_name = 'utm.medium'
|
|
_description = 'UTM Medium'
|
|
_order = 'name'
|
|
|
|
name = fields.Char(string='Medium Name', required=True)
|
|
active = fields.Boolean(default=True)
|
|
|
|
|
|
class UtmCampaign(models.Model):
|
|
# OLD crm.case.resource.type
|
|
_name = 'utm.campaign'
|
|
_description = 'UTM Campaign'
|
|
|
|
name = fields.Char(string='Campaign Name', required=True, translate=True)
|
|
|
|
|
|
class UtmSource(models.Model):
|
|
_name = 'utm.source'
|
|
_description = 'UTM Source'
|
|
|
|
name = fields.Char(string='Source Name', required=True, translate=True)
|