active=fields.Boolean(string="Active",default=True,help="If unchecked, it will allow you to hide the agreement without removing it.")
name=fields.Char(
string="Title",
required=True
)
clause_sequence=fields.Integer(
string="Sequence"
)
agreement_id=fields.Many2one(
'agreement',
string="Agreement",
ondelete="cascade"
)
section_id=fields.Many2one(
'agreement.section',
string="Section",
ondelete="cascade"
)
content=fields.Html(
string="Clause Content"
)
active=fields.Boolean(
string="Active",
default=True,
help="If unchecked, it will allow you to hide the agreement without "
"removing it."
)
# Placeholder fields
# Placeholder fields
model_id=fields.Many2one('ir.model',string="Applies to",help="The type of document this template can be used with.")
model_object_field=fields.Many2one('ir.model.fields',string="Field",help="Select target field from the related document model. If it is a relationship field you will be able to select a target field at the destination of the relationship.")
sub_object=fields.Many2one('ir.model',string="Sub-model",help="When a relationship field is selected as first field, this field shows the document model the relationship goes to.")
sub_model_object_field=fields.Many2one('ir.model.fields',string="Sub-field",help="When a relationship field is selected as first field, this field lets you select the target field within the destination document model (sub-model).")
null_value=fields.Char(string="Default Value",help="Optional value to use if the target field is empty.")
copyvalue=fields.Char(string="Placeholder Expression",help="Final placeholder expression, to be copy-pasted in the desired template field.")
model_id=fields.Many2one(
'ir.model',
string="Applies to",
help="The type of document this template can be used with."
)
model_object_field_id=fields.Many2one(
'ir.model.fields',
string="Field",
help="Select target field from the related document model. If it is a "
"relationship field you will be able to select a target field at "
"the destination of the relationship."
)
sub_object_id=fields.Many2one(
'ir.model',
string="Sub-model",
help="When a relationship field is selected as first field, this "
"field shows the document model the relationship goes to."
)
sub_model_object_field_id=fields.Many2one(
'ir.model.fields',
string="Sub-field",
help="When a relationship field is selected as first field, this "
"field lets you select the target field within the destination "
"document model (sub-model)."
)
null_value=fields.Char(
string="Default Value",
help="Optional value to use if the target field is empty."
)
copyvalue=fields.Char(
string="Placeholder Expression",
help="Final placeholder expression, to be copy-pasted in the desired "
active=fields.Boolean(string="Active",default=True,help="If unchecked, it will allow you to hide the agreement without removing it.")
name=fields.Char(
string="Title",
required=True
)
section_sequence=fields.Integer(
string="Sequence"
)
agreement_id=fields.Many2one(
'agreement',
string="Agreement",
ondelete="cascade"
)
clauses_ids=fields.One2many(
'agreement.clause',
'section_id',
string="Clauses"
)
content=fields.Html(
string="Section Content"
)
active=fields.Boolean(
string="Active",
default=True,
help="If unchecked, it will allow you to hide the agreement without "
"removing it."
)
# Placeholder fields
# Placeholder fields
model_id=fields.Many2one('ir.model',string="Applies to",help="The type of document this template can be used with.")
model_object_field=fields.Many2one('ir.model.fields',string="Field",help="Select target field from the related document model. If it is a relationship field you will be able to select a target field at the destination of the relationship.")
sub_object=fields.Many2one('ir.model',string="Sub-model",help="When a relationship field is selected as first field, this field shows the document model the relationship goes to.")
sub_model_object_field=fields.Many2one('ir.model.fields',string="Sub-field",help="When a relationship field is selected as first field, this field lets you select the target field within the destination document model (sub-model).")
null_value=fields.Char(string="Default Value",help="Optional value to use if the target field is empty.")
copyvalue=fields.Char(string="Placeholder Expression",help="Final placeholder expression, to be copy-pasted in the desired template field.")
model_id=fields.Many2one(
'ir.model',
string="Applies to",
help="The type of document this template can be used with."
)
model_object_field_id=fields.Many2one(
'ir.model.fields',
string="Field",
help="Select target field from the related document model. If it is a "
"relationship field you will be able to select a target field at "
"the destination of the relationship."
)
sub_object_id=fields.Many2one(
'ir.model',
string="Sub-model",
help="When a relationship field is selected as first field, this "
"field shows the document model the relationship goes to."
)
sub_model_object_field_id=fields.Many2one(
'ir.model.fields',
string="Sub-field",
help="When a relationship field is selected as first field, this "
"field lets you select the target field within the destination "
"document model (sub-model)."
)
null_value=fields.Char(
string="Default Value",
help="Optional value to use if the target field is empty."
)
copyvalue=fields.Char(
string="Placeholder Expression",
help="Final placeholder expression, to be copy-pasted in the desired "
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
fromodooimportmodels,fields,api
fromodooimportmodels,fields,api
# Main Agreement Records Model
# Main Agreement Records Model
classAgreement(models.Model):
classAgreement(models.Model):
_name='partner_agreement.agreement'
_name='agreement'
_inherit=['mail.thread']
_inherit=['mail.thread']
# General
# General
name=fields.Char(string="Title",required=True)
is_template=fields.Boolean(string="Is a Template?",default=False,copy=False,help="Make this agreement a template.")
version=fields.Integer(string="Version",default=1,help="The versions are used to keep track of document history and previous versions can be referenced.",copy=False)
revision=fields.Integer(string="Revision",default=0,help="The revision will increase with every save event.",copy=False)
description=fields.Text(string="Description",help="Description of the agreement",track_visibility='onchange')
start_date=fields.Date(string="Start Date",help="When the agreement starts.",track_visibility='onchange')
end_date=fields.Date(string="End Date",help="When the agreement ends.",track_visibility='onchange')
name=fields.Char(
string="Title",
required=True
)
is_template=fields.Boolean(
string="Is a Template?",
default=False,
copy=False,
help="Make this agreement a template."
)
version=fields.Integer(
string="Version",
default=1,
copy=False,
help="The versions are used to keep track of document history and "
"previous versions can be referenced."
)
revision=fields.Integer(
string="Revision",
default=0,
copy=False,
help="The revision will increase with every save event."
)
description=fields.Text(
string="Description",
track_visibility='onchange',
help="Description of the agreement"
)
start_date=fields.Date(
string="Start Date",
track_visibility='onchange',
help="When the agreement starts."
)
end_date=fields.Date(
string="End Date",
track_visibility='onchange',
help="When the agreement ends."
)
color=fields.Integer()
color=fields.Integer()
active=fields.Boolean(string="Active",default=True,help="If unchecked, it will allow you to hide the agreement without removing it.")
company_signed_date=fields.Date(string="Company Signed Date",help="Date the contract was signed by Company.",track_visibility='onchange')
customer_signed_date=fields.Date(string="Customer Signed Date",help="Date the contract was signed by Customer.",track_visibility='onchange')
customer_term=fields.Integer(string="Customer Term (Months)",help="Number of months this agreement/contract is in effect with customer.",track_visibility='onchange')
vendor_term=fields.Integer(string="Vendor Term (Months)",help="Number of months this agreement/contract is in effect with vendor.",track_visibility='onchange')
expiration_notice=fields.Integer(string="Exp. Notice (Days)",help="Number of Days before expiration to be notified.",track_visibility='onchange')
change_notice=fields.Integer(string="Change Notice (Days)",help="Number of Days to be notified before changes.",track_visibility='onchange')
special_terms=fields.Text(string="Special Terms",help="Any terms that you have agreed to and want to track on the agreement/contract.",track_visibility='onchange')
contract_value=fields.Monetary(compute='_compute_contract_value',string="Contract Value",help="Total value of the contract over ther entire term.",store=True)
contract_id=fields.Char(string="ID",help="ID used for internal contract tracking.",track_visibility='onchange')
total_company_mrc=fields.Monetary('Company MRC',currency_field='currency_id',help="Total company monthly recurring costs.")#, compute='_compute_company_mrc')
increase_type=fields.Many2one('partner_agreement.increasetype',string="Increase Type",help="The amount that certain rates may increase.",track_visibility='onchange')
termination_requested=fields.Date(string="Termination Requested Date",help="Date that a request for termination was received.",track_visibility='onchange')
termination_date=fields.Date(string="Termination Date",help="Date that the contract was terminated.",track_visibility='onchange')
type=fields.Many2one('partner_agreement.type',string="Agreement Type",help="Select the type of agreement.",track_visibility='onchange')
subtype=fields.Many2one('partner_agreement.subtype',string="Agreement Sub-type",help="Select the sub-type of this agreement. Sub-Types are related to agreement types.",track_visibility='onchange')
sale_order=fields.Many2one('sale.order',string="Sales Order",help="Select the Sales Order that this agreement is related to.",copy=False,track_visibility='onchange')
payment_term=fields.Many2one('account.payment.term',string="Payment Term",help="Terms of payments.",track_visibility='onchange')
assigned_to=fields.Many2one('res.users',string="Assigned To",help="Select the user who manages this agreement.",track_visibility='onchange')
company_signed_by=fields.Many2one('res.users',string="Company Signed By",help="The user at our company who authorized/signed the agreement or contract.",track_visibility='onchange')
customer_signed_by=fields.Many2one('res.partner',string="Customer Signed By",help="Contact on the account that signed the agreement/contract.",track_visibility='onchange')
parent_agreement=fields.Many2one('partner_agreement.agreement',string="Parent Agreement",help="Link this agreement to a parent agreement. For example if this agreement is an amendment to another agreement. This list will only show other agreements related to the same account.")
renewal_type=fields.Many2one('partner_agreement.renewaltype',string="Renewal Type",help="Describes what happens after the contract expires.",track_visibility='onchange')
notification_address=fields.Many2one('res.partner',string="Notification Address",help="The address to send notificaitons to, if different from customer address.(Address Type = Other)")