Browse Source

[ADD] agreement.stage data

pull/194/head
Maxime Chambreuil 6 years ago
parent
commit
fe8aeb1741
  1. 1
      agreement/__manifest__.py
  2. 49
      agreement/data/agreement_stage.xml
  3. 8
      agreement/models/agreement.py

1
agreement/__manifest__.py

@ -21,6 +21,7 @@
'data': [
'data/ir_sequence.xml',
'data/module_category.xml',
'data/agreement_stage.xml',
'security/res_groups.xml',
'security/ir.model.access.csv',
'views/res_config_settings.xml',

49
agreement/data/agreement_stage.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="agreement_stage_new" model="agreement.stage">
<field name="name">New</field>
<field name="sequence">10</field>
</record>
<record id="agreement_stage_draft" model="agreement.stage">
<field name="name">Draft</field>
<field name="sequence">20</field>
</record>
<record id="agreement_stage_reviewed" model="agreement.stage">
<field name="name">Reviewed</field>
<field name="sequence">30</field>
</record>
<record id="agreement_stage_negotiation" model="agreement.stage">
<field name="name">Negotiation</field>
<field name="sequence">40</field>
</record>
<record id="agreement_stage_out" model="agreement.stage">
<field name="name">Out for Customer Signature</field>
<field name="sequence">50</field>
</record>
<record id="agreement_stage_internal" model="agreement.stage">
<field name="name">Waiting Internal Signature</field>
<field name="sequence">60</field>
</record>
<record id="agreement_stage_active" model="agreement.stage">
<field name="name">Active</field>
<field name="sequence">70</field>
</record>
<record id="agreement_stage_expired" model="agreement.stage">
<field name="name">Expired</field>
<field name="sequence">80</field>
</record>
<record id="agreement_stage_cancelled" model="agreement.stage">
<field name="name">Cancelled</field>
<field name="sequence">100</field>
<field name="fold">True</field>
</record>
</odoo>

8
agreement/models/agreement.py

@ -8,6 +8,9 @@ class Agreement(models.Model):
_name = 'agreement'
_inherit = ['mail.thread']
def _default_stage_id(self):
return self.env.ref('agreement.agreement_stage_new')
# General
name = fields.Char(
string="Title",
@ -348,7 +351,10 @@ class Agreement(models.Model):
'agreement.stage',
string="Stage",
group_expand='_read_group_stage_ids',
help="Select the current stage of the agreement."
help="Select the current stage of the agreement.",
track_visibility='onchange',
index=True,
default=lambda self: self._default_stage_id(),
)
# Create New Version Button

Loading…
Cancel
Save