Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
8849 มุมมอง

Hello , plz i need your help : here is my module :

analyse.py

from openerp import addons 
from osv import fields, osv
import time

class analyse(osv.osv):
    _name='analyse'
    _description='fiche danalyse du patient'

    _columns={
        'name' : fields.char('pat', size=34 ,required=True),
    }
analyse()

and here is my XML file :

analyse.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
    <record model="ir.ui.view" id="analyse_tree_view">
        <field name="name">analyse.tree</field>
        <field name="model">analyse</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Analyse" version="7.0">
                <field name="name" />
            </tree>
        </field>
    </record>

    <record model="ir.ui.view" id="analyse_form_view">
        <field name="name">analyse.form</field>
        <field name="model">analyse</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Analyse" version="7.0">
                <group colspan="4" col="4" string=" Fiche d'analyse">
                    <field name="name" />
                </group>
            </form>
        </field>
    </record>

    <record model="ir.actions.act_window" id="analyse_form_1">
        <field name="name">analyse</field>
        <field name="res_model">analyse</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
    </record>

    <menuitem id="analys" name="Analyse"  parent="menu_patients_parent1" action="analyse_form_1" sequence="3"/>
    </data>
</openerp>

PS: menu_patients_parent1 , refers to a parents created in another .XML file , befor i added the analyse.py and analyse.XML the module worked just fine , but now while installing i get the following error :

ProgrammingError: ERREUR: erreur de syntaxe sur ou près de « analyse » LINE 1: COMMENT ON COLUMN analyse."name" IS 'pat'

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

ERROR: syntax error at or near "analyse"

analyse is a reserved keyword in in Postgresql. that's why you have encountered some problem.

so to resolved this problem change _name='analyse' to other name for example _name='my_analyse'.

Thanks.

อวตาร
ละทิ้ง
ผู้เขียน

thank you very much it Did work :)

Related Posts ตอบกลับ มุมมอง กิจกรรม
Created module , new moduel แก้ไขแล้ว
5
เม.ย. 19
6066
1
เม.ย. 16
4276
new module? แก้ไขแล้ว
10
พ.ค. 20
4808
Problem with inherited module แก้ไขแล้ว
6
ก.ค. 18
12025
3
เม.ย. 17
10463