[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:
david
2021-05-25 12:01:54 +02:00
committed by Pedro M. Baeza
parent 4450bd1ae6
commit 3e01644e8a
3 changed files with 18 additions and 0 deletions

View File

@@ -18,6 +18,10 @@ class RmaTag(models.Model):
translate=True, translate=True,
copy=False, copy=False,
) )
is_public = fields.Boolean(
string="Public Tag",
help="The tag is visible in the portal view",
)
color = fields.Integer(string="Color Index") color = fields.Integer(string="Color Index")
rma_ids = fields.Many2many(comodel_name="rma") rma_ids = fields.Many2many(comodel_name="rma")

View File

@@ -115,6 +115,18 @@
</a> </a>
</span> </span>
<span class="float-right"> <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']"> <t t-if="rma.state in ['refunded', 'returned', 'replaced']">
<span <span
class="small text-success orders_label_text_align" class="small text-success orders_label_text_align"

View File

@@ -40,6 +40,7 @@
</div> </div>
<group> <group>
<field name="name" /> <field name="name" />
<field name="is_public" />
</group> </group>
</sheet> </sheet>
</form> </form>
@@ -52,6 +53,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="RMA Tags"> <tree string="RMA Tags">
<field name="name" /> <field name="name" />
<field name="is_public" />
<field name="active" /> <field name="active" />
</tree> </tree>
</field> </field>