mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-18 23:12:01 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import hr_contract
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# copyright 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class HrContract(models.Model):
|
||||
_inherit = "hr.contract"
|
||||
|
||||
name = fields.Char(
|
||||
"Contract Reference", required=False, readonly=True, copy=False, default="/"
|
||||
)
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for vals in vals_list:
|
||||
if vals.get("name", "/") == "/":
|
||||
vals["name"] = self.env["ir.sequence"].next_by_code("contract.ref")
|
||||
return super().create(vals_list)
|
||||
Loading…
Add table
Add a link
Reference in a new issue