mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] Issue #331
Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: contract-12.0/contract-12.0-agreement_legal Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_legal/
This commit is contained in:
committed by
Víctor Martínez
parent
50be8e26a4
commit
50e610913d
@@ -1,4 +1,12 @@
|
|||||||
# Copyright (C) 2018 - TODAY, Pavlov Media
|
# Copyright (C) 2018 - TODAY, Pavlov Media
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import api, SUPERUSER_ID
|
||||||
from . import models
|
from . import models
|
||||||
|
|
||||||
|
|
||||||
|
def post_init_agreement_legal(cr, registry):
|
||||||
|
env = api.Environment(cr, SUPERUSER_ID, dict())
|
||||||
|
cr.execute('UPDATE agreement SET stage_id = %s WHERE stage_id IS NULL;',
|
||||||
|
(env.ref('agreement_legal.agreement_stage_new').id,))
|
||||||
|
return True
|
||||||
|
|||||||
@@ -35,7 +35,11 @@
|
|||||||
"views/agreement.xml",
|
"views/agreement.xml",
|
||||||
"views/menu.xml",
|
"views/menu.xml",
|
||||||
],
|
],
|
||||||
|
"post_init_hook": "post_init_agreement_legal",
|
||||||
"application": True,
|
"application": True,
|
||||||
"development_status": "Beta",
|
"development_status": "Beta",
|
||||||
"maintainers": ["max3903", "ygol"],
|
"maintainers": [
|
||||||
|
"max3903",
|
||||||
|
"ygol"
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -8,9 +8,6 @@ class Agreement(models.Model):
|
|||||||
_name = "agreement"
|
_name = "agreement"
|
||||||
_inherit = ["agreement", "mail.thread"]
|
_inherit = ["agreement", "mail.thread"]
|
||||||
|
|
||||||
def _default_stage_id(self):
|
|
||||||
return self.env.ref("agreement_legal.agreement_stage_new")
|
|
||||||
|
|
||||||
# General
|
# General
|
||||||
name = fields.Char(string="Title", required=True)
|
name = fields.Char(string="Title", required=True)
|
||||||
is_template = fields.Boolean(
|
is_template = fields.Boolean(
|
||||||
@@ -339,7 +336,6 @@ class Agreement(models.Model):
|
|||||||
"agreement.stage",
|
"agreement.stage",
|
||||||
string="Stage",
|
string="Stage",
|
||||||
group_expand="_read_group_stage_ids",
|
group_expand="_read_group_stage_ids",
|
||||||
default=lambda self: self._default_stage_id(),
|
|
||||||
help="Select the current stage of the agreement.",
|
help="Select the current stage of the agreement.",
|
||||||
track_visibility="onchange",
|
track_visibility="onchange",
|
||||||
index=True)
|
index=True)
|
||||||
@@ -389,6 +385,9 @@ class Agreement(models.Model):
|
|||||||
vals["code"] = self.env["ir.sequence"].next_by_code(
|
vals["code"] = self.env["ir.sequence"].next_by_code(
|
||||||
"agreement"
|
"agreement"
|
||||||
) or _("New")
|
) or _("New")
|
||||||
|
if not vals.get('stage_id'):
|
||||||
|
vals["stage_id"] = \
|
||||||
|
self.env.ref("agreement_legal.agreement_stage_new").id
|
||||||
return super(Agreement, self).create(vals)
|
return super(Agreement, self).create(vals)
|
||||||
|
|
||||||
# Increments the revision on each save action
|
# Increments the revision on each save action
|
||||||
|
|||||||
Reference in New Issue
Block a user