Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

insertion line in hr.payslip.input

Odoberať

Get notified when there's activity on this post

This question has been flagged
payslip
2 Replies
10113 Zobrazenia
Avatar
jihene

welcome every body, I need help in add some line to my database i have a problem in my function

def button_pointage(self, cr, uid, ids, context=None):

        for line in self.pool.get('hr.pointagedet').browse(cr, uid, ids):
            if( line['hsup75'] != 0):
                id = self.pool.get('hr.payslip.input.line').create(cr, uid, {
                    'amount': hsup75,
                    'code': 'HS75',
                    'name': 'Heures supp75',
                    'contract_id': line.contract_id.employee_id,
                    'payslip_id': line.payslip_id.employee_id})

            elif (line.hsup100 != 0.0):
                    id = self.pool.get('hr.payslip.input.line').create(cr, uid, {
                    'amount': hsup100,
                    'code': 'HS100',
                    'name': 'Heures supp100',
                    'contract_id': line.contract_id.employee_id,
                    'payslip_id': line.payslip_id.employee_id})

            elif (line.conge_paye != 0.0):
                    id = self.pool.get('hr_payslip_worked_days.line').create(cr, uid, {
                    'number_of_days': conge_paye,
                    'number_of_hours': conge_paye,
                    'code': 'CONG',
                    'name': 'Conge paye',
                    'contract_id': line.contract_id.employee_id,
                    'payslip_id': line.payslip_id.employee_id})

            elif (line.nb_jours != 0.0):
                    id = self.pool.get('hr_payslip_worked_days.line').create(cr, uid, {
                    'number_of_days': line.nb_jours,
                    'code': 'WORK100',
                    'name': 'work days',
                    'contract_id': line.contract_id.employee_id,
                    'payslip_id': line.payslip_id.employee_id})

            elif (line.nb_heures != 0.0):
                    id = self.pool.get('hr_payslip_worked_days.line').create(cr, uid, {
                    'number_of_hours': nb_heures,
                    'code': 'WORK100',
                    'name': 'work hours',
                    'contract_id': line.contract_id.employee_id,
                    'payslip_id': line.payslip_id.employee_id})

            elif (line.nb_presence != 0.0):
                    id = self.pool.get('hr_payslip_worked_days.line').create(cr, uid, {
                    'number_of_days': nb_jours,
                    'code': 'WORK100',
                    'name': 'work days',
                    'contract_id': line.contract_id.employee_id,
                    'payslip_id': line.payslip_id.employee_id})

        return 0

the bug : File "C:\Program Files\OpenERP 7\Server\server\openerp\addons\hr_payroll_tn_tn\hr_tn_payroll.py", line 67, in button_pointage File "C:\Program Files\OpenERP 7\Server\server.\openerp\osv\orm.py", line 492, in __iter__ NotImplementedError: Iteration is not allowed on browse_record(hr.pointagedet, 1)

0
Avatar
Zrušiť
jihene
Autor

line bug : File "C:\Program Files\OpenERP 7\Server\server\openerp\addons\hr_payroll_tn_tn\hr_tn_payroll.py", line 68, in button_pointage File "C:\Program Files\OpenERP 7\Server\server.\openerp\osv\orm.py", line 419, in __getitem__ KeyError: 'Field hsup75 not found in browse_record(hr.pointagedet, 1)'

Avatar
Borni DHIFI
Best Answer

Hi,

your code seems correct ,

Field hsup75 not found in browse_record(hr.pointagedet, 1) :

model hr.pointagedet does not contain a field hsup75 .so verify the model hr.pointagedet or post your code here.


-- 'amount': hsup75, 
++ 'amount': line.hsup75

-- 'amount': hsup100,
++ 'amount':  line.hsup75
.... replace all values  of amount
0
Avatar
Zrušiť
Avatar
jihene
Autor Best Answer

Hi, this is my class hr.pointagedet

class hr_pointage(osv.osv): _name = 'hr.pointage' _description = "Pointage" def button_pointage(self, cr, uid, ids, context=None):

    for line in self.pool.get('hr.pointagedet').browse(cr, uid, ids):
        if( line['hsup75'] != 0):
            id = self.pool.get('hr.payslip.input.line').create(cr, uid, {
                'amount': hsup75,
                'code': 'HS75',
                'name': 'Heures supp75',
                'contract_id': line.contract_id.employee_id,
                'payslip_id': line.payslip_id.employee_id})

        elif (line.hsup100 != 0.0):
                id = self.pool.get('hr.payslip.input.line').create(cr, uid, {
                'amount': hsup100,
                'code': 'HS100',
                'name': 'Heures supp100',
                'contract_id': line.contract_id.employee_id,
                'payslip_id': line.payslip_id.employee_id})

        elif (line.conge_paye != 0.0):
                id = self.pool.get('hr_payslip_worked_days.line').create(cr, uid, {
                'number_of_days': conge_paye,
                'number_of_hours': conge_paye,
                'code': 'CONG',
                'name': 'Conge paye',
                'contract_id': line.contract_id.employee_id,
                'payslip_id': line.payslip_id.employee_id})

        elif (line.nb_jours != 0.0):
                id = self.pool.get('hr_payslip_worked_days.line').create(cr, uid, {
                'number_of_days': line.nb_jours,
                'code': 'WORK100',
                'name': 'work days',
                'contract_id': line.contract_id.employee_id,
                'payslip_id': line.payslip_id.employee_id})

        elif (line.nb_heures != 0.0):
                id = self.pool.get('hr_payslip_worked_days.line').create(cr, uid, {
                'number_of_hours': nb_heures,
                'code': 'WORK100',
                'name': 'work hours',
                'contract_id': line.contract_id.employee_id,
                'payslip_id': line.payslip_id.employee_id})

        elif (line.nb_presence != 0.0):
                id = self.pool.get('hr_payslip_worked_days.line').create(cr, uid, {
                'number_of_days': nb_jours,
                'code': 'WORK100',
                'name': 'work days',
                'contract_id': line.contract_id.employee_id,
                'payslip_id': line.payslip_id.employee_id})

    return 0

_columns = {
    'annee':fields.integer('Annee'),
    'mois':fields.integer('Mois'),
    'det':fields.one2many('hr.pointagedet','ind', 'pointage'),

}
hr_pointage()
class hr_pointagedet(osv.osv):
    _name = 'hr.pointagedet'
    _description = "Pointagedet"
    _columns = {
        'employer':fields.many2one('hr.employee', 'Employer'),
        'ind':fields.integer('Ind'),
        'nb_jours':fields.float('Nombre jours'),
        'nb_heures':fields.float('Nombre Heures'),
        'nb_presence':fields.float('Nombre presence'),
        'hsup75':fields.float('Heures sup 75%'),
        'hsup100':fields.float('Heures sup 100%'),
        'hferier':fields.float('Heures Ferier'),
        'conge_paye':fields.float('Conge paye'),
    }
    _defaults = {
        'ind': 1,
    }
hr_pointagedet()
0
Avatar
Zrušiť
Borni DHIFI

I modified my answer . now must it works!!

jihene
Autor

no and the same error !!

jihene
Autor

I have create a new data base and i have another error: AttributeError: "Field 'contract_id' does not exist in object 'browse_record(hr.pointagedet, 1)'"

Borni DHIFI

Jihene , It is very clear your model don't contain a field named contract_id, it contain a field employer .so replace line.contract_id.employee_id by line.employer . (not line.employer )

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

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
How can I get the number of days of the period in Payslip
payslip
Avatar
0
dec 23
1823
Where I can see this field "hourly_wage" ?
payslip
Avatar
1
feb 23
3010
Payslip wrong categories result
payslip
Avatar
0
dec 22
2426
Payslip Printing in Odoo 11 Giving Error When Printing by a user (Employee) with ReadOnly Access on Payslip
payslip
Avatar
Avatar
1
dec 18
4548
Deleting payslips in done state
payslip
Avatar
Avatar
2
nov 18
6851
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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