Skip to content

Commit

Permalink
Fixed pre-commit issues
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamg9 committed Aug 14, 2024
1 parent b70901b commit c82dda0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
10 changes: 10 additions & 0 deletions g2p_enumerator/data/sequence.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<record id="seq_enumerator_code" model="ir.sequence">
<field name="name">EID</field>
<field name="code">enumeratorCode</field>
<field name="prefix">EID-</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
</record>
</odoo>
2 changes: 1 addition & 1 deletion g2p_enumerator/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class G2PRegistrant(models.Model):
def create(self, vals):
if not vals.get("eid"):
vals["eid"] = "New"
res = super(G2PRegistrant, self).create(vals)
res = super().create(vals)
if res.eid == "New" and res.supplier_rank > 0:
res.eid = res.generate_eid()
return res
Expand Down
40 changes: 40 additions & 0 deletions g2p_enumerator/views/registration_portal_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<odoo>
<record id="view_res_partner_eid_form" model="ir.ui.view">
<field name="name">res.partner.eid.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field
name="eid" context="{'default_supplier_rank': active_id and active_id or 1}"
/>
</xpath>
</field>
</record>

<record id="view_res_partner_eid_tree" model="ir.ui.view">
<field name="name">res.partner.tree</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='display_name']" position="after">
<field name="eid" context="{'default_supplier_rank': active_id and active_id or 1}"
/>
</xpath>
</field>
</record>

<record id="view_groups_form_inherit_eid" model="ir.ui.view">
<field name="name">view.groups.form.inherit.eid</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="g2p_registry_group.view_groups_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='create_uid']" position="after">
<field name="creator_eid" readonly="1"/>
</xpath>
</field>
</record>

</odoo>

<!-- invisible="context.get('default_supplier_rank') &lt; 1" -->

0 comments on commit c82dda0

Please sign in to comment.