mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[IMP] rma: public tags
Now we can decide which tags are visible for the customer. This way, we can use them as pseudo-states TT29594
This commit is contained in:
@@ -18,6 +18,10 @@ class RmaTag(models.Model):
|
||||
translate=True,
|
||||
copy=False,
|
||||
)
|
||||
is_public = fields.Boolean(
|
||||
string="Public Tag",
|
||||
help="The tag is visible in the portal view",
|
||||
)
|
||||
color = fields.Integer(string="Color Index")
|
||||
rma_ids = fields.Many2many(comodel_name="rma")
|
||||
|
||||
|
||||
@@ -115,6 +115,18 @@
|
||||
</a>
|
||||
</span>
|
||||
<span class="float-right">
|
||||
<!-- Tags -->
|
||||
<t
|
||||
t-set="tags"
|
||||
t-value="rma.tag_ids.filtered('is_public')"
|
||||
/>
|
||||
<!-- We don't have the color o_tag_color_# classes available in the frontend -->
|
||||
<t t-foreach="tags" t-as="tag">
|
||||
<span
|
||||
class="badge badge-pill badge-info label-text-align"
|
||||
t-esc="tag.name"
|
||||
/>
|
||||
</t>
|
||||
<t t-if="rma.state in ['refunded', 'returned', 'replaced']">
|
||||
<span
|
||||
class="small text-success orders_label_text_align"
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
</div>
|
||||
<group>
|
||||
<field name="name" />
|
||||
<field name="is_public" />
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
@@ -52,6 +53,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="RMA Tags">
|
||||
<field name="name" />
|
||||
<field name="is_public" />
|
||||
<field name="active" />
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user