mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-16 04:02:56 -06:00
[IMP] : black, isort, prettier
This commit is contained in:
parent
1db2bc547e
commit
09e64ff125
@ -11,13 +11,20 @@ class IrAttachmentCategory(models.Model):
|
||||
_parent_store = True
|
||||
|
||||
name = fields.Char()
|
||||
display_name = fields.Char(compute="_compute_display_name", store=True,)
|
||||
parent_id = fields.Many2one("ir.attachment.category",)
|
||||
display_name = fields.Char(
|
||||
compute="_compute_display_name",
|
||||
store=True,
|
||||
)
|
||||
parent_id = fields.Many2one(
|
||||
"ir.attachment.category",
|
||||
)
|
||||
parent_path = fields.Char(index=True)
|
||||
attachment_ids = fields.Many2many(
|
||||
compute="_compute_attachment_count", comodel_name="ir.attachment"
|
||||
)
|
||||
attachment_count = fields.Integer(compute="_compute_attachment_count",)
|
||||
attachment_count = fields.Integer(
|
||||
compute="_compute_attachment_count",
|
||||
)
|
||||
|
||||
@api.depends("name", "parent_id.display_name")
|
||||
def _compute_display_name(self):
|
||||
@ -28,7 +35,8 @@ class IrAttachmentCategory(models.Model):
|
||||
for category in self:
|
||||
if category.parent_id.display_name:
|
||||
category.display_name = "{}/{}".format(
|
||||
category.parent_id.display_name, category.name,
|
||||
category.parent_id.display_name,
|
||||
category.name,
|
||||
)
|
||||
else:
|
||||
category.display_name = category.name
|
||||
|
@ -52,12 +52,8 @@
|
||||
<field name="res_model">ir.attachment.category</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Create a new document
|
||||
</p>
|
||||
<p>
|
||||
Also you will find here all the related document categories.
|
||||
</p>
|
||||
<p class="o_view_nocontent_smiling_face">Create a new document</p>
|
||||
<p>Also you will find here all the related document categories.</p>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.menu" id="ir_attachment_category_menu">
|
||||
|
Loading…
Reference in New Issue
Block a user