Repository
OCA/sustainability · module folder · Try on Runboat
Module version
1.2.1
Category
Accounting/Sustainability
Folder size
0.1 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/sustainability-suite/sustainability-odoo
Last tracking update
2026-09-21 11:18:10
Authors
Open Net Sàrl, MCO2
Maintainers
Open Net Sàrl, MCO2
Committers
Julien Guenat, SustainabilityBot, sustainabilitybot, Adam Bonnet
Odoo dependencies
Python dependencies
openupgradelib, packaging
System dependencies
None
Required by
None
Description

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
res_config_settings_view_form res.config.settings.view.form.inherit.sustainability.commuting res.config.settings form Inherits sustainability.res_config_settings_view_form
view_employee_form_commuting hr.employee.form.inherit.commuting hr.employee form Inherits hr.view_employee_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (6)

New fields (4)
  • employee_commuting_carbon_date Date
    copy=False default=False args: 'Employee commuting date'
  • employee_remote_work_carbon_date Date
    copy=False default=False
  • is_employee_commuting_carbon Boolean
    copy=False default=False args: "Employees' commuting carbon emissions"
  • is_employee_remote_work_carbon Boolean
    copy=False default=False
Public methods (0)

No public methods.

New fields (4)
  • allowed_carbon_factor_ids Many2many → carbon.factor
    domain=<expr> related='employee_id.company_id.employee_commuting_carbon_factor_id.descendant_ids' args: 'carbon.factor'
  • carbon_factor_id Many2one → carbon.factor
    domain="[('id', 'in', allowed_carbon_factor_ids),('carbon_value', '!=', False)]" required=True string='Transport mean' args: 'carbon.factor'
  • distance_km Integer
    string='Average weekly distance in kilometers'
  • employee_id Many2one → hr.employee
    string='Employee' args: 'hr.employee'
Public methods (1)
  • get_commuting_carbon_value_at_date(self, date)

New fields (1)
  • carbon_commuting_ids One2many → carbon.hr.commuting
    string='Employee commuting records' args: 'carbon.hr.commuting', 'employee_id'
Public methods (0)

No public methods.

New fields (2)
  • has_location Boolean
    default=False store=True
  • work_days_home Integer
    compute='_compute_work_days_home' help='Number of days per week the employee works from home.' store=True string='Work Days at Home'
Public methods (0)

No public methods.

New fields (9)
  • employee_commuting_account_id Many2one → account.account
    domain="[('deprecated', '=', False)]" string='Employee Commuting Account' args: 'account.account'
  • employee_commuting_carbon_cronjob_active Boolean
    default=False string='Cronjob active'
  • employee_commuting_carbon_factor_id Many2one → carbon.factor
    args: 'carbon.factor'
  • employee_commuting_journal_id Many2one → account.journal
    args: 'account.journal'
  • employee_commuting_post_account_move_active Boolean
    default=False string='Post account move when cron is finished'
  • employee_remote_work_account_id Many2one → account.account
    domain="[('deprecated', '=', False)]" string='Employee Remote Work Account' args: 'account.account'
  • employee_remote_work_carbon_cronjob_active Boolean
    default=False string='Remote Work Cronjob Active'
  • employee_remote_work_carbon_factor_id Many2one → carbon.factor
    args: 'carbon.factor'
  • employee_remote_work_journal_id Many2one → account.journal
    args: 'account.journal'
Public methods (7)
  • calculate_average(self, metric_sum, count)
    Calculates the average of a given metric if the count is non-zero.
  • carbon_commuting_create_account_move(self, account_move_date, to_post=False)
  • create_account_move(self, ref, journal_id, account_move_date, aml_vals_list, mode)
    Creates an account move with the given parameters.
  • delete_existing_account_moves(self, account_move_date, mode)
    Deletes existing account moves for a given date to avoid duplicates.
  • get_employees_with_contracts(self, account_move_date, employees_domain=None)
    Retrieves employees with active contracts in the company.
  • prepare_account_move_line(self, employee, carbon_value, account_id, description)
    Prepares account move line dictionary for an employee.
  • remote_work_create_account_move(self, account_move_date, to_post=False)
    Generate account move for employee remote work carbon emissions. Calculates carbon emissions based on remote work days for each employee, fallback to average if no employees with remote work set.

New fields (9)
  • employee_commuting_account_id Many2one → account.account
    readonly=False related='company_id.employee_commuting_account_id' args: 'account.account'
  • employee_commuting_carbon_cronjob_active Boolean
    readonly=False related='company_id.employee_commuting_carbon_cronjob_active' args: 'Cron job active'
  • employee_commuting_carbon_factor_id Many2one → carbon.factor
    readonly=False related='company_id.employee_commuting_carbon_factor_id' args: 'carbon.factor'
  • employee_commuting_journal_id Many2one → account.journal
    readonly=False related='company_id.employee_commuting_journal_id' args: 'account.journal'
  • employee_commuting_post_account_move_active Boolean
    readonly=False related='company_id.employee_commuting_post_account_move_active' string='Post account move when cron is finished'
  • employee_remote_work_account_id Many2one → account.account
    readonly=False related='company_id.employee_remote_work_account_id' args: 'account.account'
  • employee_remote_work_carbon_cronjob_active Boolean
    readonly=False related='company_id.employee_remote_work_carbon_cronjob_active' args: 'Cron job'
  • employee_remote_work_carbon_factor_id Many2one → carbon.factor
    domain=<expr> readonly=False related='company_id.employee_remote_work_carbon_factor_id' args: 'carbon.factor'
  • employee_remote_work_journal_id Many2one → account.journal
    readonly=False related='company_id.employee_remote_work_journal_id' args: 'account.journal'
Public methods (1)
  • set_values(self)

Loading…

Loading…

Status
Open migration PR — not merged yet for this version
CI status
green — ready to merge
Open since
206 days ago
Last activity
206 days ago
Repository
OCA/sustainability
Pull request
[19.0][MIG] sustainability_employee_commuting: Migration to 19.0 (#525)