Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Problem with module in V7 and other in V8

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
performancev8modulefieldsv7
3821 Weergaven
Avatar
Algode

I have a Module1 in V7, this is part of the code, when call a function of Module2 in V8:

#--Code in Module1 
class calc_hours_employees(models.Model): _name = 'calc.hours.employees' _description = 'Somes computes' employees_ids = fields.Many2many('hr.employee', 'hr_employee_calcs_rel', 'calcs_id', 'employee_id', 'Funcionarios')
   def compute_sheet(self, cr, uid, ids, context=None): emp_pool = self.pool.get('hr.employee') ext_pool = self.pool.get('hr.py.calc.hours') run_pool = self.pool.get('hr.py.calc.hours.run') ext_ids = [] if context is None: context = {} data = self.read(cr, uid, ids, context=context)[0] run_data = {} if context and context.get('active_id', False): run_data = run_pool.read(cr, uid, [context['active_id']], ['date_start', 'date_end'])[0] from_date = run_data.get('date_start', False) to_date = run_data.get('date_end', False)
        if not data['employees_ids']:     raise osv.except_osv(_("Warning!"), _("Select one, please"))
        for emp in emp_pool.browse(cr, uid, data['employees_ids'], context=context)
           ext_data = ext_pool.do_employee(cr, uid, [], 2, emp.id, from_date, to_date, emp.department_id, emp.id_inter, contract_id=False, context=context     
            res = {     
                'employee': emp.id,     
                'office': emp.department_id.name,     
                'matricu': emp.id_inter,     
                'date_from': from_date,      
                'date_to': to_date,     
                'calcs_run_ids': context.get('active_id', False),      
            }     ext_ids.append(ext_pool.create(cr, uid, res, context=context)
    return {'type': 'ir.actions.act_window_close'}

And this is a part of code that have the function do_employee():

#--Part of code in Module2  
class hr_py_calc_hours(models.Model): _name = 'hr.py.calc.hours'

employee = fields.Many2one('hr.employee', string='Employee', required=True)
hor_repo = fields.Float('Hor Repo', digits=(16,2), default=0.0)
#####have more fields but not is necesary for the example :)
....
    @api.multi
    @api.onchange('employee')
    def do_employee(self, type_calc=1, emp_id=False, from_date=False, to_date=False, emp_off=False, emp_matr=False, contract_id=False, context=None):     def _do_create(date1,turnid,ent,sal,work,rep,abse,ear,bef,att,ad30,ex50,ex100,hours_to_create):     hours_to_create += [((0,0,{'date_work':date1,'turno_id':turnid,'entrad':ent,'salida':sal,'times_worked':work,'repose':rep,'absence':abse,'early':ear, 'before':bef,'attestation':att,'adic_30':ad30,'ext_50':ex50,'ext_100':ex100}))]
....
        if not type_calc==1:     repo = self.get('hor_repo',0) ############ HERE ARE THE PROBLEM self.write({'hor_repo': repo + ocho}) else: self.hor_repo += ocho datew += timedelta(days=1)
.....

The function of Module2 need can execute from the onchange employee, and need can execute from the Module1. 

I need the value of hor_repo for increase this at one to somes computes, them i need take the value at the moment in the field an increase this. 

I see in many parts from google but all is only for V7 or only for V8. How can solve this problem ? 


Posd.: This module is similar to performance of the payslip, need can do only for a employee(as module hr.payslip) or for more that one in the same time(as module hr.payslip.run). 


Edit: Nothing ?





0
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Can V7 and V8 code coexist in the same .py file? Opgelost
v8 fields v7 api
Avatar
Avatar
1
mrt. 15
4782
Problem to write datas in field
v8 module field v7 write
Avatar
0
jun. 15
3927
Loading wrong configuration file? Opgelost
v8 v7
Avatar
Avatar
1
apr. 15
9355
"No handler found" - CRITICAL ? openerp.modules.module - How to downgrade/uninstall a module in command line?
module v7
Avatar
Avatar
1
mrt. 15
7806
new module doesn't show in module list? Opgelost
module v7
Avatar
Avatar
Avatar
3
dec. 23
30758
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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