Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Timesheet Activities Invalid XML for View Architecture!'

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
timesheethuman_resource
1 Răspunde
6469 Vizualizări
Imagine profil
oussama Lachiheb

Hi , I'm working on openErp 7.0 ,on the module Timesheet i want to add 2 attributes to the tree view (start_at and end_at) but when updating the module i have the following error message : * Invalid XML for View Architecture!'* would some one tell me what i should correct in the following xml and python code : My XML hr_timesheet_view.xml

<record id="hr_timesheet_line_tree" model="ir.ui.view">
        <field name="name">hr.analytic.timesheet.tree</field>
        <field name="model">hr.analytic.timesheet</field>
        <field name="arch" type="xml">
            <tree editable="top" string="Timesheet Activities" version="7.0">                  
                <field name="date" on_change="on_change_date(date)"/>
                <field name="user_id" on_change="on_change_user_id(user_id)" required="1" options='{"no_open": True}'/>
                <field name="name"/>
                <field domain="[('type','=','normal'),('use_timesheets','=',1)]" name="account_id" context="{'default_use_timesheets': 1, 'default_type': 'contract'}"/>                                        
                <field name="unit_amount" string="Duration" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" sum="Total time" widget="float_time"/>                    
                <field name="start_at"/>
                <field name="end_at"/>
                <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" invisible="1"/>
                <field name="journal_id" invisible="1"/>                    
                <field name="amount" sum="Total cost" invisible="1"/>
                <field name="general_account_id" invisible="1"/>
                <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" required="1" domain="[('type','=','service')]" invisible="1"/>
            </tree>
        </field>
    </record>

my python code :

class hr_analytic_timesheet(osv.osv):
_name = "hr.analytic.timesheet"
_table = 'hr_analytic_timesheet'
_description = "Timesheet Line"
_inherits = {'account.analytic.line': 'line_id'}
_order = "id desc"
_columns = {
    'line_id': fields.many2one('account.analytic.line', 'Analytic Line', ondelete='cascade', required=True),
    'partner_id': fields.related('account_id', 'partner_id', type='many2one', string='Partner', relation='res.partner', store=True),                
    'start_at':fields.text('from'),
    'end_at':fields.text('to'),

}

With regards

0
Imagine profil
Abandonează
Imagine profil
Borni DHIFI
Cel mai bun răspuns

Hi,

should not modify the original code openerp , if you want add fields must create a

new module :

your_file.py

from osv import osv, fields
class hr_analytic_timesheet(osv.osv):
    _inherit = "hr.analytic.timesheet"
    _columns = {
               'start_at':fields.char('from'),
               'end_at':fields.char('to'),
                }          
hr_analytic_timesheet()

your_file.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record model="ir.ui.view" id="hr_timesheet_inherit">
            <field name="name">hr_timesheet_inherit_tree</field>
            <field name="model">hr.analytic.timesheet</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree" />
            <field name="arch" type="xml">
                <xpath expr="//field[@name='unit_amount']" position="after">
                    <field name="start_at" />
                    <field name="end_at" />
                </xpath>

            </field>
        </record>
    </data>
</openerp>
3
Imagine profil
Abandonează
patrick

Another thing to do when modifying code, is to restart the openERP server, than reload the module (Settings -> installed modules -> search for module and click on it -> Click button Upgrade)

oussama Lachiheb
Autor

Thank's a lot , it works now :)

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Human Resources / Approved timesheets
timesheet activity human_resource
Imagine profil
Imagine profil
2
sept. 15
5439
Additional _day & _total field require in Timesheet
v6.1 timesheet human_resource
Imagine profil
0
mar. 15
3689
How to make only selected tasks deduct hours from a fixed-hour support project in Odoo
timesheet
Imagine profil
0
nov. 25
236
Timesheet - "Add Custom Group" Dropdown Flickering (Unstable)
timesheet
Imagine profil
0
mai 25
1598
Time recording of employees with hardware that can read fingerprints
timesheet
Imagine profil
Imagine profil
1
apr. 25
1758
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now