mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-17 04:32:55 -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
|
_parent_store = True
|
||||||
|
|
||||||
name = fields.Char()
|
name = fields.Char()
|
||||||
display_name = fields.Char(compute="_compute_display_name", store=True,)
|
display_name = fields.Char(
|
||||||
parent_id = fields.Many2one("ir.attachment.category",)
|
compute="_compute_display_name",
|
||||||
|
store=True,
|
||||||
|
)
|
||||||
|
parent_id = fields.Many2one(
|
||||||
|
"ir.attachment.category",
|
||||||
|
)
|
||||||
parent_path = fields.Char(index=True)
|
parent_path = fields.Char(index=True)
|
||||||
attachment_ids = fields.Many2many(
|
attachment_ids = fields.Many2many(
|
||||||
compute="_compute_attachment_count", comodel_name="ir.attachment"
|
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")
|
@api.depends("name", "parent_id.display_name")
|
||||||
def _compute_display_name(self):
|
def _compute_display_name(self):
|
||||||
@ -28,7 +35,8 @@ class IrAttachmentCategory(models.Model):
|
|||||||
for category in self:
|
for category in self:
|
||||||
if category.parent_id.display_name:
|
if category.parent_id.display_name:
|
||||||
category.display_name = "{}/{}".format(
|
category.display_name = "{}/{}".format(
|
||||||
category.parent_id.display_name, category.name,
|
category.parent_id.display_name,
|
||||||
|
category.name,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
category.display_name = category.name
|
category.display_name = category.name
|
||||||
|
@ -52,12 +52,8 @@
|
|||||||
<field name="res_model">ir.attachment.category</field>
|
<field name="res_model">ir.attachment.category</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">Create a new document</p>
|
||||||
Create a new document
|
<p>Also you will find here all the related document categories.</p>
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Also you will find here all the related document categories.
|
|
||||||
</p>
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.ui.menu" id="ir_attachment_category_menu">
|
<record model="ir.ui.menu" id="ir_attachment_category_menu">
|
||||||
|
Loading…
Reference in New Issue
Block a user