تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
9265 أدوات العرض

I've made a personal module:

import datetime
import time
from openerp.osv import fields, osv
import logging

_logger = logging.getLogger("WORK2MEETING")
class project_task_work(osv.osv):
    _name = "project.task.work"
    _inherit="project.task.work"
    _columns = {
        'meeting_id': fields.many2one('crm.meeting', 'Meeting')
    }

    def create(self, cr, uid, vals, *args, **kwargs):
        _logger.debug('Create a %s with vals %s', self._name, vals)
        meeting_obj = self.pool.get('crm.meeting')
        varDeadline= datetime.date.today()#TODO deadline=date+hours
        meeting_vals = {
            'name': vals['name'],
            #'categ_ids': ,#TODO récup l'id du tag "avancement de projet"
            'duration': vals['hours'],
            'description':task_id.project_id.name+'->'+task_id.name+'->'+name,
            'user_id': vals['user_id'].id,
            'date': vals['date'],
            'end_date': varDeadline,
            'date_deadline': varDeadline,
            'state': 'open',# to block that meeting date in the calendar
        }
        meeting_id = meeting_obj.create(cr, uid, meeting_vals)
        vals['meeting_id'] = meeting_id
        return super(project_task_work,self).create(cr, uid, vals, *args, **kwargs)

When I check fields with dev mode I can see my personal field "meeting_id". But when I create a new task.work, I've no new meeting and there are no message on log file. Did I make a mistake?

الصورة الرمزية
إهمال
أفضل إجابة

Everytime you make a modification to server or addons's python code, you have to restart your instance in order to re-load the codebase including your modifications.

On a side note, if you modify an XML view, you'll have to update the module (-u mymodule in launching args) to take your modifications into account.

And finally, if you modify some JS code, a simple refresh in your browser will do the trick.

الصورة الرمزية
إهمال

and when modifying a RML file directly, just calling the report again do the trick

Bjr Anto, j'ai modifié un bout de code python dans openerp 7, mais quand je restart tous mes serveurs postgres, python, le code n'est pas modifié dans openerp. Pour info je suis en Win 7

الكاتب أفضل إجابة

I found the problem after 1 day of work. I have to restart openERP. This is the second time this solution resolve a problem and it's written nowhere in the doc. If this tips can help someone else: If nothing work : RESTART

الصورة الرمزية
إهمال

The question would have some sense if it was asking about some hot code reloading feature. But it is otherwise quite abvious that code changes are not visible to a running program.

الكاتب

yes but in a web environment i use to just refresh my page to update my script(php,javascript...)

المنشورات ذات الصلة الردود أدوات العرض النشاط
What's the context? تم الحل
9
مارس 24
117202
1
يونيو 20
11513
2
مارس 16
9899
1
مارس 15
3240
3
مارس 15
9308