[IMP] project_average_acceptable_time: migration to v14

This commit is contained in:
clementthomas
2023-07-24 12:17:43 +02:00
parent 5a30d61fee
commit 77b26fd755
4 changed files with 14 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ from odoo.addons.portal.controllers.portal import CustomerPortal
class CustomCustomerPortal(CustomerPortal):
@route(["/my/account"], type="http", auth="user", website=True)
def account(self, redirect=None, **post):
self.OPTIONAL_BILLING_FIELDS.append("average_acceptable_time")
self.OPTIONAL_BILLING_FIELDS.append("average_acceptable_time") #unecessary save in res partner, but necessary to avoid error on form post
response = super(CustomCustomerPortal, self).account(redirect, **post)

View File

@@ -1,2 +1,3 @@
from . import project_project
from . import res_partner

View File

@@ -0,0 +1,10 @@
from odoo import models, fields, _, api
class ResPartner(models.Model):
_inherit = "res.partner"
average_acceptable_time = fields.Float('Average acceptable time') # not used, but necessary to post custom field from /my/account

View File

@@ -24,6 +24,7 @@
<field name="inherit_id" ref="project.edit_project"/>
<field name="arch" type="xml">
<field name="subtask_project_id" position="after">
<label for="average_acceptable_time" />
<field name="average_acceptable_time" widget="float_time"/>
</field>
</field>