Scott Recycling Odoo — Model Baselines¶
This file documents every field and method on core models. Before modifying any model, check this file to understand what exists and what other modules depend on.
Last updated: 2026-02-15
Table of Contents¶
- res.partner (sr_management)
- res.partner (sr_management_fixes)
- res.partner (sr_scheduling)
- customer.pickups (sr_management)
- customer.pickups (sr_scheduling)
- box.details (sr_management)
- box.content.line (sr_management)
- truck.schedule (sr_scheduling)
- add.note wizard (sr_scheduling)
- note.note (sr_management)
- agreement.mou (sr_management)
- weekly.attendance (sr_management)
- attendance.adjustment.request (sr_management)
- attendance.checkout.request (sr_management)
- email.pickup.response (sr_pickup_blast)
- mass.email.wizard (sr_pickup_blast)
- sr.kpi.daily (sr_operations_kpi)
- sr.wip.snapshot (sr_operations_kpi)
res.partner (sr_management)¶
File: sr_management/models/res_partner.py
Inherits: res.partner
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| followup_frequency_id | Many2one(followup.frequency) | tracked |
| cust_req_followup_frequency_id | Many2one(followup.frequency) | |
| customer_region_id | Many2one(customer.region) | tracked |
| account_type | Many2one(customer.category) | |
| county_id | Many2one(res.county) | tracked |
| county_name | Char | |
| followup_date | Datetime | stored, tracked |
| week_day | Selection | 'monday','tuesday','wednesday','thursday','friday','saturday','sunday' |
| phone_1 | Selection | 'business','mobile','home','n/a' |
| phone_2 | Selection | 'business','mobile','home','n/a' |
| preferred_contact | Selection | 'phone','na','email','null' |
| old_id | Integer | |
| fax | Char | |
| first_name | Char | |
| last_name | Char | |
| phone1Ext | Char | |
| phone2Ext | Char | |
| company_id_new | Char | copy=False |
| ok_to_email | Boolean | |
| is_weekly | Boolean | related=followup_frequency_id.is_weekly |
| firstContact | Datetime | |
| lastContact | Datetime | |
| flaggedForAttention | Boolean | |
| flaggedForAttentionComment | Text | |
| flaggedForAttentionDate | Date | |
| flaggedForAttentionUser | Many2one(res.users) | |
| special_comments | Text | |
| country_id | Many2one(res.country) | default=US |
| term_condition_ids | Many2many(terms.conditions) | tracked |
| term_condition_ids_domain | Binary | computed |
| pricing_approved_by | Many2one(res.users) | readonly, tracked |
| pricing_approved_date | Date | readonly |
| pricing_notes | Text | |
| partner_term_line_ids | One2many(partner.term.condition.line) | |
| charge_term_line_ids | One2many(partner.term.condition.line) | domain: we_pay=False |
| pay_term_line_ids | One2many(partner.term.condition.line) | domain: we_pay=True |
| pickups_count | Integer | computed, stored |
| pickups_ids | One2many(customer.pickups) | |
| state | Char | string='State Name' |
| last_decision_maker_date | Date | tracked |
| is_special_customer | Boolean | default=False |
| start_time | Float | |
| start_period | Selection | 'AM','PM' |
| end_time | Float | |
| end_period | Selection | 'AM','PM' |
| hoo_start_time | Float | required, tracked |
| hoo_end_time | Float | required, tracked |
| time_format | Selection | '12','24', default='24' |
| cust_tz_offset | Char | computed |
| cust_tz | Selection | timezone choices |
| hours_confirmed | Boolean | default=False, tracked |
| service_material_together | Boolean | |
| service_first_floor | Boolean | |
| service_need_help | Boolean | |
| service_cust_provides_help | Boolean | |
| service_profile_notes | Text | |
| job_description | Text | |
| customer_profile_verified | Boolean | default=False |
| service_profile_verified | Boolean | default=False |
| driver_notes_verified | Boolean | default=False |
| driver_notes | Html | |
| is_account_owner | Boolean | default=False |
| is_multi_account_owner | Boolean | default=False |
| last_account_owner_contact | Date | tracked |
| sub_company_ids | Many2many(res.partner) | domain: is_company=True |
| total_actual_weight | Float | computed, stored |
| total_glass_weight | Float | computed, stored |
| total_glass_percentage | Float | computed, stored |
| customer_request_callback_date | Date | |
| is_hot | Boolean | default=False |
| priority | Selection | '0','1','2','3' |
| cancel_pickup_count | Integer | computed |
| is_edit_csr | Boolean | computed |
| is_csr_user | Boolean | computed |
| is_team_leader | Boolean | computed |
| allowed_parents_ids | Many2many(res.partner) | |
| forklift | Selection | 'unknown','yes','no', default='unknown', tracked |
| dock | Selection | 'unknown','yes','no', default='unknown', tracked |
| material_all_together | Selection | 'unknown','yes','no', default='unknown', tracked |
| first_floor_only | Selection | 'unknown','yes','no', default='unknown', tracked |
| need_help | Selection | 'unknown','yes','no', default='unknown', tracked |
| customer_provides_help | Selection | 'unknown','yes','no', default='unknown', tracked |
| service_elevator | Selection | 'unknown','yes','no', default='unknown', tracked |
| note_ids | One2many(note.note) | |
| special_loading_condition | Char | |
| customerType | Selection | 'Recycling','Prospect','Dead' |
| is_vip | Boolean | default=False |
| parentAccountid | Integer | |
| import_dock_available | Boolean | default=False |
| import_hours_of_operation | Char | |
| import_forklift_available | Boolean | default=False |
| import_loading_help_available | Boolean | default=False |
| import_material_floor_number | Boolean | |
| import_service_elevator_available | Boolean | default=False |
Methods¶
| Line | Method | Description |
|---|---|---|
| 252 | _compute_total_glass_percentage | Compute glass % from pickups |
| 264 | _compute_total_glass_weight | Compute glass weight from pickups |
| 270 | _compute_total_actual_weight | Compute actual weight from pickups |
| 276 | onchange_account_owner | Update tags on account owner change |
| 291 | _compute_users | Check if user is CSR or team leader |
| 305 | onchange_sub_company_ids | Sync allowed_parents from sub_companies |
| 312 | _compute_is_edit_csr | Check edit_csr permission |
| 326 | _compute_term_condition_ids_domain | Domain for term conditions |
| 337 | _compute_cancel_pickup_count | Count cancelled pickups |
| 341 | get_cancelled_pickups | Action: view cancelled pickups |
| 357 | action_pickups | Action: view non-cancelled pickups |
| 371 | action_confirm_hours | Toggle hours_confirmed |
| 381 | action_copy_service_to_job | Copy service profile to job description |
| 386 | action_copy_job_to_driver | Copy job description to driver notes |
| 392 | assign_missing_company_ids | Assign unique company_id_new |
| 416 | default_get | Set default values for new partners |
| 425 | _convert_time | Convert float time to display format |
| 442 | _compute_display_time | Compute display time fields |
| 450 | onchange_state_name | Update state_id from state name |
| 459 | _assign_website_tag | Add website tag to partner |
| 465 | _assign_recycling_tag | Add recycling tag to partner |
| 472 | get_timezone_from_coords | Get timezone via Google Maps API |
| 551 | _compute_cust_tz_offset | Compute timezone offset string |
| 600 | _assign_unique_company_id_new_for_companies | Assign company IDs |
| 618 | create | Create partner with tags and company ID |
| 651 | _send_resolved_flag_for_attention_notification | Send flag resolution email |
| 683 | resolve_flagged_for_attention_query | Resolve flagged query |
| 695 | _sendFlaggedForAttentionEmail | Send flagged email to managers |
| 716 | write | Update partner with special handling |
| 777 | _compute_pickups_count | Count non-cancelled pickups |
| 782 | _get_default_followup_frequency | Get default frequency (1 month) |
| 789 | _onchange_country_id | Filter states by selected country |
| 797 | _onchange_followup_frequency_id | Set followup_date from frequency |
| 817 | action_suggest_edit | Open suggest-edit wizard |
| 829 | set_recycling_tag_as_default | Assign recycling tag to all companies |
| 841 | update_followup_dates | Update all customer followup dates |
| 852 | is_valid_last_decision_date | Check if within 90 days |
| 862 | _convert_to_24hr | Convert 12h to 24h float |
| 888 | onchange_time_format | Update HOO on format change |
| 906 | get_contact_name | Format first/last name |
| 913 | cron_assign_generate_recycling_leads | Daily cron: generate CRM leads |
| 961 | set_company_details_from_contacts | Copy first contact details to company |
| 974 | link_companies_with_contacts | Link contacts to parent companies |
| 989 | cron_create_individuals | Import individuals from Excel file |
| 1060 | set_prospect_to_recycling_company_tags | Set all companies to recycling tag |
| 1065 | clean_date | Parse date string, return None if invalid |
| 1073 | _get_clean_preferred_contact | Sanitize preferred_contact selection value |
| 1087 | _sanitize_phone_type | Sanitize phone type selection value |
| 1111 | _sanitize_company_id | Clean and validate company ID integer |
| 1130 | format_name | Format first/last into full name |
| 1138 | cron_create_new_contacts | Import contacts from CSV file |
| 1207 | cron_create_new_companies | Import companies from CSV file |
| 1315 | cron_create_companies | Import companies from Excel file |
| 1386 | cron_set_state_id_from_state | Set state_id from state field |
| 1409 | cron_set_county_based_on_address | Set county via geolocation |
| 1464 | cron_set_customer_data | Set default terms and frequency |
| 1475 | set_city_state_from_parent_company | Copy parent company address to contacts |
| 1488 | cron_find_prospect_to_recycling_companies | Convert prospects with pickups to recycling |
| 1512 | _haversine_distance | Calculate distance between two coordinates |
| 1521 | set_correct_region_based_latitude_longitude | Assign region from coordinates |
| 1594 | open_customer | Open customer form |
| 1614 | set_county_from_county_name | Set county_id from name |
| 1626 | cron_set_company_last_decision_maker_date | Set DM date from notes |
| 1647 | _get_dispatchers_emails | Get dispatcher emails |
| 1652 | _get_managers_emails | Get manager emails |
| 1657 | action_approve_pricing | Manager: approve pricing |
| 1602 | batch_assign_salesperson | Open batch assign salesperson wizard |
| 1667 | _create_default_term_lines | Create default term lines |
res.partner (sr_management_fixes)¶
File: sr_management_fixes/models/res_partner.py
Inherits: res.partner
Fields¶
Prospect Workflow:
| Field | Type | Key Attributes |
|---|---|---|
| prospect_stage | Selection | 'new','initial_call','dm_identified','packet_sent','followup_call','not_interested','closed','closed_lost', default='new', tracked |
| prospect_initial_call_date | Datetime | |
| prospect_dm_identified_date | Datetime | |
| prospect_packet_sent_date | Datetime | |
| prospect_followup_call_date | Datetime | |
| prospect_closed_date | Datetime | |
| dm_name | Char | |
| dm_title | Char | |
| dm_email | Char | |
| dm_phone | Char | |
| prospect_csr_id | Many2one(res.users) | tracked |
| prospect_contact_status | Selection | 'reachable','no_answer','wrong_number','disconnected','email_bounced','business_closed', default='reachable', tracked |
| prospect_contact_attempts | Integer | default=0 |
| not_interested_count | Integer | default=0 |
| not_interested_reason | Selection | 'no_budget','using_competitor','bad_timing','no_need','other' |
| not_interested_notes | Text | |
| prospect_not_interested_date | Datetime | |
| prospect_needs_review | Boolean | default=False |
| prospect_review_reason | Char | |
| prospect_callback_date | Date | |
| prospect_auto_followup_date | Date | computed, stored |
| prospect_next_action_date | Date | computed, stored |
Call Queue (CRITICAL - see ARCHITECTURE.md):
| Field | Type | Key Attributes |
|---|---|---|
| customer_queue | Selection | 'a','b','c','d', default=False. Badge display only |
| in_queue_a | Boolean | default=False. Use for filtering |
| in_queue_b | Boolean | default=False. Use for filtering |
| in_queue_c | Boolean | default=False. Use for filtering |
| in_queue_d | Boolean | default=False. Use for filtering |
| sr_contact_counter | Integer | default=0 |
| sr_last_contact_date | Date | |
| cycle_start_date | Date | |
| current_attempt | Integer | default=0 |
| next_call_date | Date | |
| missed_cycles | Integer | default=0 |
| escalated | Boolean | default=False |
| is_pickup_overdue | Boolean | default=False |
| expected_pickup_interval | Integer | default=0 |
| call_frequency_locked | Boolean | default=False |
Priority Stars:
| Field | Type | Key Attributes |
|---|---|---|
| priority_stars | Selection | '0','1','2','3', default='0' |
| yearly_pickup_weight | Float | default=0.0 |
| last_pickup_weight | Float | computed, stored |
| last_pickup_date | Date | computed, stored |
| last_dm_contact_date | Date |
Pickup Request (Queue D):
| Field | Type | Key Attributes |
|---|---|---|
| pickup_requested | Boolean | default=False |
| pickup_requested_date | Datetime |
Methods¶
| Line | Method | Description |
|---|---|---|
| 200 | _compute_last_pickup_weight | Get weight/date of most recent pickup (SQL batch) |
| 234 | _compute_prospect_auto_followup | Calculate auto follow-up date by stage |
| 280 | _compute_prospect_next_action | Set next action date |
| 289 | action_mark_initial_call | Mark initial call stage |
| 296 | action_mark_dm_identified | Mark DM identified (requires dm_email) |
| 306 | action_send_info_packet | Send info packet email |
| 319 | action_mark_followup_call | Mark follow-up call |
| 326 | action_mark_prospect_closed | Mark prospect closed |
| 333 | action_open_not_interested_wizard | Open not-interested wizard |
| 344 | action_open_contact_issue_wizard | Open contact issue wizard |
| 355 | action_escalate_to_manager | Escalate to manager review |
| 366 | action_return_to_csr_queue | Manager: return to CSR |
| 375 | action_archive_prospect | Manager: archive prospect |
| 382 | action_reactivate_prospect | Reactivate not-interested prospect |
| 391 | action_increment_contact_attempt | Increment contact attempt counter |
| 399 | _clear_satisfied_callback_requests | Clear callback if contact happened after |
| 448 | cron_assign_customer_queues | Daily cron: assign customers to queues A/B/C/D |
| 504 | _assign_customer_queues(customer, today) | Assign all applicable queue booleans |
| 589 | cron_calculate_pickup_overdue | Calculate overdue pickups |
| 654 | _clear_all_queue_booleans | Clear all in_queue_* flags and customer_queue |
| 662 | action_log_failed_contact | Log failed contact; after 3 attempts -> next cycle |
| 703 | action_log_successful_contact | Log successful contact; reset all cycle tracking |
| 731 | action_reset_contact_counter | Alias for action_log_successful_contact |
| 735 | action_increment_contact_counter | Alias for action_log_failed_contact |
| 739 | action_request_earlier_callback(new_date) | CSR: request earlier callback |
| 765 | action_open_earlier_callback_wizard | Open earlier callback wizard |
| 780 | action_manager_set_next_call_date(new_date) | Manager: set next_call_date |
| 810 | action_manager_clear_escalation | Manager: clear escalation |
| 832 | action_manager_move_to_next_cycle | Manager: move to next cycle |
| 856 | action_manager_remove_from_queue | Manager: remove from all queues |
| 876 | cron_calculate_call_frequency | Auto-assign call frequency from history |
| 989 | _calculate_best_52_week_period | Find max pickup-weeks in 52-week window |
| 1030 | _calculate_best_12_month_period | Find max pickup-months in 12-month window |
| 1070 | cron_calculate_priority_stars | Calculate stars from yearly weight |
| 1181 | _create_star_upgrade_notifications | Create activity for star upgrades |
| 1228 | action_recalculate_priority_stars | Manual: recalculate stars |
| 1237 | action_mark_pickup_requested | Mark pickup requested (Queue D) |
| 1246 | action_clear_pickup_requested | Clear pickup request + clear ALL queues |
res.partner (sr_scheduling)¶
File: sr_scheduling/models/res_partner.py
Inherits: res.partner
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| is_gmaps_updated | Boolean | default=False |
| pick_up_date | Date | |
| reminder_date | Date | |
| requested_pick_up_date | Date | tracked |
| driver_assigned_id | Many2one(hr.employee) | related=truck_assigned_id.driver_employee_id |
| no_of_box | Integer | tracked |
| truck_assigned_id | Many2one(fleet.vehicle) | tracked |
| expected_weight | Float | default=500 |
| memo | Text | tracked |
| contact_result_id | Many2one(contact.result) | tracked |
| suggested_pickup_date_msg | Char | |
| additional_time | Float | |
| suggested_pickup_date | Date | |
| rejected_dates | Json | default='[]' |
| contact_type | Selection | 'phone','email','other','customer_phone_in','walkin' |
| customer_travel_time | Float | stored |
| prospect_bucket | Selection | 'never_contacted','attempted_contact','contact_made','scheduled_pickup','email_attempt','email_response', computed, stored |
Methods¶
| Line | Method | Description |
|---|---|---|
| 127 | _compute_prospect_bucket | Compute prospect bucket from notes |
| 167 | generate_user_addresses | Debug: print formatted addresses for IDs |
| 176 | get_formatted_customer_address | Return formatted address string |
| 206 | update_latitude_longitude | Update lat/long for partners |
| 258 | find_matching_duplicate_lat_longs | Find partners with same lat/long |
| 271 | update_lat_lon_gmaps | Update via Google Maps |
| 279 | geo_localize | Inherit: auto-calculate timezone |
| 303 | get_gmaps_lat_long | Get lat/long from Google Geocoding |
| 340 | _get_scheduling_parameters | Get scheduling config params |
| 362 | estimate_travel_time_haversine | Estimate travel time |
| 377 | get_or_fetch_travel_time | Get travel time with caching |
| 415 | get_travel_time_in_minutes | Google Distance Matrix API |
| 441 | _get_customer_direction | Calculate direction from warehouse |
| 475 | _check_schedule_direction_compatible | Check direction compatibility |
| 491 | action_refresh_pick_up_date | Refresh suggested pickup date |
| 656 | _set_last_decision_maker_date | Set DM date to today |
| 660 | _manage_pickup | Create pickup from customer |
| 682 | schedule_pickup | Schedule pickup with validation |
| 711 | _check_hoo_times | Ensure lat/long set, geolocalize if missing |
| 716 | action_add_note | Open add-note wizard |
customer.pickups (sr_management)¶
File: sr_management/models/customer_pickups.py
Model name: customer.pickups
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| customer_id | Many2one(res.partner) | tracked, stored |
| active | Boolean | default=True, tracked |
| is_driver_edit | Boolean | computed |
| estimated_weight | Float | tracked |
| actual_weight | Float | computed, stored, tracked |
| no_of_box | Integer | required, tracked |
| actual_no_of_box | Integer | computed, stored, tracked |
| pickup_date | Date | required, tracked |
| requested_pick_up_date | Date | tracked |
| truck_assigned | Many2one(fleet.vehicle) | tracked |
| lead_id | Many2one(crm.lead) | tracked |
| customer_region_id | Many2one(customer.region) | related, stored, tracked |
| customer_state_id | Many2one(res.country.state) | related, stored, tracked |
| truck_name | Char | related, stored |
| driver_name | Char | related |
| customer_company_name | Char | related, stored |
| driver_id | Many2one(hr.employee) | readonly, stored |
| role | Char | |
| stage | Selection | 'expected','arrival','in_progress','next_end','cancelled', default='expected', tracked |
| current_status | Selection | 'todo','in_progress','completed', computed, stored, tracked |
| status | Selection | 'pending','on_time','late','not_reached','reached_on_time','reached_late', computed, stored |
| agreement_id | Many2one(agreement.mou) | domain: state=active |
| no_agreements_found | Boolean | default=False |
| term_condition_ids | Many2many(terms.conditions) | required, tracked |
| term_condition_ids_domain | Binary | computed |
| is_special | Boolean | stored |
| is_special_customer | Boolean | related, stored |
| is_fixed_appointment | Boolean | default=False, tracked |
| appointment_datetime | Datetime | tracked |
| appointment_window_minutes | Integer | default=15 |
| hoo_start_time | Float | required, tracked |
| hoo_end_time | Float | required, tracked |
| additional_time | Float | |
| location_lat | Float | related, stored |
| location_lon | Float | related, stored |
| box_ids | One2many(box.details) | |
| box_count | Integer | computed |
| remainder_ewaste_weight | Float | computed, stored |
| assorted_ewaste_weight | Float | computed |
| total_box_content_weight | Float | computed, stored |
| total_box_content_count | Float | computed, stored |
| total_crt_tv | Float | computed, stored |
| total_lcd_tv | Float | computed, stored |
| total_crt_monitors | Float | computed, stored |
| total_glass_weight | Float | computed, stored |
| samsara_stop_id | Char | tracked |
| samsara_state | Selection | 'scheduled','en_route','skipped','arrived','departed', default='scheduled', tracked |
| live_sharing_url | Char | |
| eta | Char | tracked |
| en_route_time | Char | tracked |
| scheduled_arrival | Char | tracked |
| scheduled_departure | Char | tracked |
| actual_arrival | Char | tracked |
| actual_departure | Char | tracked |
| scheduled_arrival_zulu | Char | |
| scheduled_departure_zulu | Char | |
| actual_arrival_zulu | Char | |
| actual_departure_zulu | Char | |
| cancelled_lead_id | Many2one(crm.lead) | |
| arrival_notified | Boolean | default=False |
| departure_notified | Boolean | default=False |
| old_lead_id | Integer | |
| box_category_data | Json | |
| delay_minutes | Integer | computed |
| delay_display | Char | computed |
| notes | Char | tracked |
| cancel_reason | Text | |
| stop_number | Integer | |
| is_old_pickup | Boolean | default=False |
| display_name | Char | computed |
| cor_status | Selection | 'sent','not_sent', default='not_sent' |
| task_ids | One2many(project.task) | |
| time_format | Selection | related |
| company_id | Many2one(res.company) | |
| is_dispatcher | Boolean | computed |
| tasks_created_arrival | Boolean | default=False |
| tasks_created_in_progress | Boolean | default=False |
| is_box_categories | Boolean | computed |
| sorted_box_count | Integer | computed |
| total_box_count | Integer | computed |
Methods¶
| Line | Method | Description |
|---|---|---|
| 182 | cron_update_glass_total_calculations | Update glass totals for recent pickups |
| 195 | _compute_glass_totals | Compute CRT/LCD/monitor/glass weights |
| 213 | _set_total_box_content_data | Sum content weight and count |
| 226 | _compute_is_box_categories | Check for non-zero box categories |
| 238 | get_formview_url | Return backend URL |
| 246 | _compute_box_progress | Sorted vs total box count |
| 253 | _compute_is_dispatcher | Check dispatcher group |
| 277 | _compute_pickup_current_status | Determine todo/in_progress/completed |
| 317 | _compute_assorted_ewaste_weight | Compute assorted e-waste weight from categories |
| 311 | _compute_remainder_ewaste_weight | Sum remainder from boxes |
| 323 | _compute_actual_no_of_box | Count non-theoretical boxes |
| 331 | _compute_actual_weight | Sum actual weight from boxes |
| 338 | _compute_term_condition_ids_domain | Domain for terms |
| 348 | _compute_is_driver_edit | Check if user is dispatcher for edit |
| 355 | _compute_delay | Delay in minutes |
| 376 | _compute_delay_display | Formatted delay string |
| 391 | _compute_status | Arrival status |
| 403 | _compute_display_name | Truck name + weight |
| 413 | read_group_stage_ids | Expand all stage selection keys in kanban |
| 416 | _compute_box_count | Total box count |
| 421 | get_box_details | Action: view box details |
| 434 | get_unfinished_boxes | Action: view non-theoretical boxes |
| 447 | generate_boxes | Create/remove boxes to match count |
| 491 | create | Validate lead uniqueness and dates |
| 515 | _move_box_next_stage | Move boxes to 'extent' |
| 520 | write | Handle stage transitions and tasks |
| 632 | create_pickup_tasks | Create project tasks |
| 650 | all_tasks_completed | Check all tasks done |
| 656 | _get_dispatcher_emails | Get email list of dispatcher group |
| 663 | _get_dispatcher_users | Get user IDs of dispatcher group |
| 670 | send_dispatcher_notifications | Send to dispatcher channel |
| 702 | _get_current_timestamp | Return formatted current time in timezone |
| 706 | get_signature_data | Get customer signature from task |
| 711 | print_label | Generate label report |
| 714 | print_mou_agreement | Generate MOU report |
| 719 | print_certificate | Print certificate of recycling report |
| 723 | print_signature | Print signature report action |
| 726 | _get_special_order_comments | Get comments from special terms/conditions |
| 737 | _prepare_pickup_details | Build pickup detail dict for reports |
| 760 | get_all_box_logs | Open barcode scan logs for all boxes |
| 775 | onchange_customer | Populate agreement from customer |
| 796 | set_to_cancel | Cancel pickup with reschedule |
| 841 | safe_int | Convert value to int, default zero |
| 849 | cron_create_recycling_orders | Import orders from CSV |
| 895 | public_get_non_zero_category_data | Public wrapper for non-zero category data |
| 898 | _get_non_zero_category_data | Category data with non-zero weight |
| 912 | get_box_category_data | Group content by category |
| 941 | cron_force_refresh_pickup_details | Recalculate computed fields |
| 949 | display_notification | Return success notification action dict |
| 960 | batch_send_cor_report | Batch send COR emails |
| 964 | send_cor_report | Send COR email |
| 989 | website_set_requested_pickup_date_format | Format requested date as MM-DD-YYYY |
customer.pickups (sr_scheduling)¶
File: sr_scheduling/models/customer_pickups.py
Inherits: customer.pickups
Additional Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| truck_schedule_id | Many2one(truck.schedule) | tracked |
| customer_full_address | Char | computed, stored |
| cancelled_truck_schedule_id | Many2one(truck.schedule) | tracked |
| is_rescheduled | Boolean | default=False, tracked |
| rescheduled_lead_id | Many2one(crm.lead) | tracked |
| pushed_to_samsara | Boolean | default=False, tracked |
| duration_in_hours | Float | stored |
| sequence | Integer | default=10 |
| hoo_status | Selection | 'inside','risky','outside','unknown', computed, stored |
| lateness | Float | computed, stored |
| is_forced | Boolean | default=False |
| force_user_id | Many2one(res.users) | tracked |
| direction | Selection | 'N','NE','E','SE','S','SW','W','NW', computed, stored |
| direction_quadrant | Selection | 'north','east','south','west', computed, stored |
| direction_bearing | Float | computed, stored |
| direction_conflict | Boolean | computed |
| current_eta | Datetime | |
| eta_variance_minutes | Integer | computed, stored |
| eta_status | Selection | 'on_time','early','late','at_risk', computed, stored |
| stop_duration_actual | Float | computed, stored |
Methods¶
| Line | Method | Description |
|---|---|---|
| 76 | _compute_customer_full_address | Get formatted address |
| 85 | _compute_direction | Calculate direction from warehouse |
| 134 | _compute_direction_conflict | Check direction conflicts on route |
| 160 | _compute_eta_variance | Calculate ETA variance |
| 175 | _compute_eta_status | Determine ETA status |
| 191 | _compute_stop_duration | Calculate actual time at stop |
| 204 | action_driver_arrived | Driver: mark arrival |
| 220 | action_driver_leaving | Driver: mark departure |
| 236 | _get_scheduling_parameters | Get config params |
| 248 | _get_max_boxes_for_truck | Max boxes by truck type |
| 255 | _validate_schedule_capacity | Validate weight/box/hours limits |
| 307 | _validate_service_window | Validate HOO window |
| 331 | get_status_label | Return display label for status selection |
| 345 | _compute_hoo_flags | Inside/risky/outside HOO |
| 449 | _check_region_whs | Validate region warehouse |
| 461 | _check_validations | Run all validations |
| 465 | _set_schedule_arrival_departure_time | Set arrival/departure times |
| 528 | _check_schedule_has_capacity | Check schedule capacity |
| 560 | _check_direction_compatibility | Check direction compatibility |
| 593 | _find_first_available_schedule | Find available schedule |
| 661 | _manage_truck_schedule | Manage schedule on pickup create (triggers ORS routing) |
| 717 | _create_truck_schedule | Create new schedule |
| 738 | create | Override: manages truck schedule (set is_old_pickup=True to bypass) |
| 748 | open_pickup | Open pickup form view action |
| 758 | _get_scheduling_admin_emails | Get scheduling admin group emails |
| 764 | cron_send_warning_msg_notification | Send low-weight route warnings |
| 817 | update_route | Update Samsara route |
| 877 | optimize_route | Optimize via Samsara |
| 888 | cancel_pickup_from_samsara | Cancel from Samsara |
| 1048 | set_to_cancel | Cancel + manage schedule archival |
| 1060 | handle_from_pickup_cancel | Open cancel schedule wizard for last pickup |
| 1075 | _redirect_to_lead | Return action to open lead form |
| 1087 | redirect_to_reschedule_pickup | Navigate to rescheduled lead form |
| 1093 | reschedule_pickup | Create new lead for reschedule |
| 1113 | action_open_reschedule_date | Open reschedule wizard |
| 1125 | action_open_change_truck | Open change truck wizard |
| 1137 | _clear_pickup_data | Clear Samsara/schedule data |
| 1147 | push_pickup_to_samsara | Placeholder for pushing pickup to Samsara |
| 1151 | _update_schedule_times | Update times via ORS routing |
box.details (sr_management)¶
File: sr_management/models/box_details.py
Model name: box.details
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| name | Char | copy=False |
| tare_weight | Float | tracked |
| gross_weight | Float | tracked |
| actual_weight | Float | tracked |
| pickup_id | Many2one(customer.pickups) | required |
| box_content_line_ids | One2many(box.content.line) | |
| attachment_ids | One2many(ir.attachment) | |
| scan_logs_ids | One2many(barcode.scan.logs) | |
| is_special | Boolean | related, stored |
| customer_id | Many2one(res.partner) | related, stored |
| pickup_date | Date | related, stored |
| warehouse_id | Many2one(stock.warehouse) | tracked |
| location_id | Many2one(stock.location) | tracked |
| transfer_user_id | Many2one(res.users) | tracked |
| status | Selection | 'theoretical','extent','scanned_remote','in_transfer','scanned_hq','sort_line','sorted', default='theoretical', tracked |
| active | Boolean | default=True |
| sorted_date | Datetime | tracked |
| remainder_ewaste_weight | Integer | computed, stored |
| total_content_weight | Float | computed, stored |
| total_content_count | Float | computed, stored |
| images_count | Integer | computed |
| gallery_display_name | Char | computed |
| box_url | Char | computed |
Methods¶
| Line | Method | Description |
|---|---|---|
| 57 | _compute_images_count | Count attachments |
| 61 | _get_box_url | Generate form view URL |
| 67 | _compute_gallery_display_name | Format display name |
| 76 | _set_total_content_data | Sum content weight and count |
| 86 | onchange_gross_tare_weight | Validate gross >= tare |
| 94 | _compute_remainder_ewaste_weight | gross - tare - content weight |
| 100 | _check_actual_weight | Constrain weight >= 0 |
| 108 | _generate_general_content_lines | Create general category lines |
| 137 | _generate_special_content_lines | Create special category lines |
| 169 | generate_box_contents | Generate all content lines |
| 175 | create | Auto-generate content lines on create |
| 181 | write | Validate remainder weight on write |
| 195 | cron_generate_box_contents | Generate missing content lines |
| 215 | _create_logs | Create scan log entry |
| 245 | update_box_details_weight | Update weights with logging |
| 279 | _get_qr_code_url | Generate QR code URL |
| 288 | get_box_weight_details | Return weight dict |
| 296 | _prepare_box_details | Prepare data for frontend |
| 326 | get_status_label | Return status label |
| 331 | set_in_transit_stage | Set to 'in_transfer' |
| 344 | fetch_barcode_box_details | Fetch by barcode with status update |
| 398 | get_box_logs | Action: view scan logs |
| 417 | get_boxes_with_images | Return boxes with images in date range |
| 445 | action_move_to_sorted_confirmation | Open sort confirmation wizard |
| 452 | server_action_move_to_sorted | Mark as sorted |
box.content.line (sr_management)¶
File: sr_management/models/box_content_line.py
Model name: box.content.line
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| name | Char | computed, stored |
| quantity | Integer | default=1 |
| total_weight_lbs | Integer | |
| result | Selection | 'yes','no' |
| user_id | Many2one(res.users) | |
| box_id | Many2one(box.details) | required, ondelete='cascade' |
| term_condition_category_id | Many2one(term.condition.category) | required |
| category_type_id | Many2one(term.condition.category.type) | |
| unit_of_measure | Selection | 'count','weight','both', default='weight' |
| is_special | Boolean | related, stored |
truck.schedule (sr_scheduling)¶
File: sr_scheduling/models/truck_schedule.py
Model name: truck.schedule
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| name | Char | tracked |
| truck_id | Many2one(fleet.vehicle) | tracked |
| dispatch_location_id | Many2one(stock.location) | related |
| driver_id | Many2one(hr.employee) | stored, tracked |
| customer_region_id | Many2one(customer.region) | stored |
| company_id | Many2one(res.company) | |
| pickup_date | Date | |
| pickup_ids | One2many(customer.pickups) | domain: stage!=cancelled |
| truck_route_log_ids | One2many(truck.route.log) | |
| truck_schedule_log_ids | One2many(truck.schedule.logs) | |
| total_pickup_weight | Float | computed, stored |
| total_estimated_no_boxes | Float | computed, stored |
| total_actual_no_boxes | Float | computed, stored |
| status | Selection | 'draft','in_progress','completed','cancel', default='draft' |
| is_completed | Boolean | computed, stored |
| is_dispatcher | Boolean | computed |
| samsara_route_id | Char | stored, tracked |
| samsara_route_key | Char | tracked |
| samsara_response_data | Json | |
| samsara_route_url | Char | computed |
| scheduled_route_start_time | Char | |
| scheduled_route_end_time | Char | |
| actual_route_start_time | Char | |
| actual_route_end_time | Char | |
| org_timezone | Char | |
| delay_minutes | Integer | computed, stored |
| delay_display | Char | computed |
| total_stops_count | Integer | computed |
| is_today_or_tomorrow | Boolean | computed, stored |
| pushed_to_samsara | Boolean | computed, stored |
| return_trip_time | Float | stored, default=0.0 |
| total_trip_time | Float | computed, stored |
| total_trip_time_readable | Char | computed, stored |
| is_over_hours | Boolean | computed, stored |
| driver_start_time | Float | stored |
| force_manual_pickups | Boolean | default=False |
| is_show_push_to_samsara | Boolean | computed |
| active | Boolean | default=True |
| is_rescheduled | Boolean | |
| reschedule_count | Integer | default=0 |
| lunch_start_time | Datetime | tracked |
| lunch_end_time | Datetime | tracked |
| lunch_duration | Float | default=0.5 |
| is_on_lunch | Boolean | computed, stored |
| lunch_after_pickup_id | Many2one(customer.pickups) | |
| warehouse_departure_location | Char | computed, stored |
| warehouse_return_location | Char | computed, stored |
| return_eta | Datetime | computed, stored |
| route_status | Selection | 'not_started','en_route','on_time','ahead','at_risk','behind','on_lunch','completed', computed, stored |
| current_stop_number | Integer | computed, stored |
| total_pickups | Integer | computed, stored |
| progress_percent | Float | computed, stored |
| departure_variance | Char | computed, stored |
| is_behind_schedule | Boolean | computed, stored |
| alert_level | Selection | 'none','warning','critical', computed, stored |
| has_missed_pickup | Boolean | computed, stored |
| missed_pickup_count | Integer | computed, stored |
| needs_attention | Boolean | computed, stored |
| alert_message | Char | computed, stored |
| dispatcher_notes | Text | |
| dispatcher_notes_updated | Datetime | |
| last_critical_alert_sent | Datetime | |
| critical_alert_acknowledged | Boolean | default=False |
| predicted_completion_time | Datetime | computed, stored |
| predicted_status | Selection | 'on_track','at_risk','will_be_late', computed, stored |
| avg_minutes_per_stop | Float | computed, stored |
| on_time_departure | Boolean | computed, stored |
| on_time_completion | Boolean | computed, stored |
| total_delay_minutes | Integer | computed, stored |
| truck_capacity_boxes | Integer | default=12 |
| projected_boxes | Integer | computed, stored |
| actual_boxes | Integer | computed, stored |
| remaining_capacity | Integer | computed, stored |
| capacity_warning | Boolean | computed, stored |
| capacity_status | Selection | 'ok','warning','critical', computed, stored |
| box_variance | Integer | computed, stored |
| capacity_forecast | Selection | 'ok','tight','over', computed, stored |
| last_completed_customer | Char | computed, stored |
| photo_count | Integer | computed |
| primary_direction | Selection | 'N','NE','E','SE','S','SW','W','NW', computed, stored |
| primary_quadrant | Selection | 'north','east','south','west', computed, stored |
| direction_list | Char | computed, stored |
| has_opposite_directions | Boolean | computed, stored |
| is_warning | Boolean | computed |
| is_max_box_warning | Boolean | computed |
| direction_coherence | Float | computed, stored |
Methods¶
| Line | Method | Description |
|---|---|---|
| 196 | _compute_dispatcher_fields | Total pickups, progress, variance |
| 237 | _compute_alert_fields | Alert level, delay, missed pickups |
| 337 | _compute_predicted_eta | Predict completion time |
| 408 | _compute_performance_metrics | On-time metrics |
| 449 | _compute_box_tracking | Box capacity tracking |
| 487 | _compute_capacity_forecast | End-of-route capacity forecast |
| 524 | _compute_last_completed_customer | Last completed customer name |
| 532 | action_open_calloff_wizard | Open call-off wizard |
| 560 | _compute_photo_count | Count photos across pickups |
| 576 | action_view_photos | View all photos |
| 597 | action_open_dispatch_monitor | Open dispatch monitor page in new tab |
| 606 | action_view_as_driver | Open driver route view in new tab |
| 616 | _compute_route_direction | Primary direction and coherence |
| 675 | action_send_critical_alert | Send critical alert |
| 708 | action_acknowledge_alert | Acknowledge alert |
| 713 | action_call_driver | Call driver |
| 726 | action_text_driver | Text driver |
| 739 | action_add_dispatcher_note | Add dispatcher note |
| 753 | write | Override: track changes, check direction conflicts |
| 772 | _onchange_pickup_ids_direction_check | Warn on opposite direction pickups |
| 798 | cron_check_critical_alerts | Cron: check critical alerts |
| 812 | cron_send_daily_summary | Cron: daily summary |
| 860 | _compute_is_dispatcher | Check if current user is dispatcher |
| 864 | _check_unarchive_validations | Prevent unarchive if active route exists |
| 870 | action_unarchive | Unarchive with validation checks |
| 875 | _compute_is_show_push_to_samsara | Check if push button should show |
| 882 | default_get | Set default driver_start_time from config |
| 889 | _compute_is_over_hours | Check if exceeds daily hours |
| 899 | _compute_is_today_or_tomorrow | Check if pickup date is today/tomorrow |
| 906 | _compute_pushed_to_samsara | Check if all pickups pushed to Samsara |
| 912 | _compute_total_trip_time | Total trip time |
| 936 | _compute_total_stops_count | Count number of pickup stops |
| 941 | _compute_delay_display | Format delay as human-readable string |
| 954 | _compute_delay | Calculate delay minutes from scheduled vs actual |
| 973 | _compute_is_on_lunch | Check if on lunch |
| 986 | _compute_warehouse_locations | Warehouse locations |
| 1005 | _compute_return_eta | Return ETA |
| 1036 | _compute_route_status | Overall route status |
| 1067 | _compute_current_stop | Current stop number |
| 1088 | action_start_lunch | Start lunch break |
| 1101 | action_end_lunch | End lunch break |
| 1111 | _recalculate_remaining_etas | Recalculate remaining ETAs |
| 1167 | _compute_samsara_route_url | Generate Samsara route URL dynamically |
| 1178 | open_samsara_map | Open Samsara route URL in new tab |
| 1188 | get_formview_url | Return backend form view URL |
| 1195 | _compute_is_completed | Check if all pickups reached, mark complete |
| 1208 | _compute_total_pickup_weight | Sum pickup weights |
| 1213 | _compute_boxes | Sum estimated and actual box counts |
| 1218 | _compute_is_warning | Check if weight below minimum threshold |
| 1226 | _compute_is_max_box_warning | Check if boxes exceed maximum limit |
| 1234 | get_datetime_from_ms | Convert ms to datetime |
| 1246 | get_start_end_ms | Get start/end milliseconds for pickup date |
| 1256 | fetch_samsara_location | Fetch vehicle location from Samsara API |
| 1271 | has_reached_stop | Check if vehicle within threshold of stop |
| 1278 | get_truck_location | Get location from Samsara |
| 1293 | haversine | Distance between coordinates |
| 1304 | get_vehicle_trips | Fetch vehicle trips from Samsara API |
| 1322 | get_route_details | Fetch route details from Samsara API |
| 1337 | set_samsara_stop_ids | Set stop IDs on pickups |
| 1359 | update_truck_schedule_status | Update status from Samsara |
| 1365 | convert_utc_to_usa_time | Convert UTC timestamp to Eastern time |
| 1399 | convert_to_naive_utc | Convert Zulu time to naive UTC datetime |
| 1486 | _set_pickup_time_details | Set timing details |
| 1568 | _set_schedule_details | Write schedule data dictionary |
| 1571 | _combine_date_and_float_time | Combine date + float time to string |
| 1585 | recompute_all_route_logs | Regenerate warehouse route log entries |
| 1648 | update_route_data | Update route after changes |
| 1845 | _get_scheduling_admin_emails | Get scheduling admin group emails |
| 1850 | _get_system_admin_emails | Get system admin group emails |
| 1855 | _get_dispatchers_emails | Get dispatcher group emails |
| 1860 | _get_scheduling_admin_ids | Get scheduling admin user records |
| 1879 | send_route_status_update | Send email for route stop updates |
| 1928 | _send_route_log_update_sms | Send SMS for truck route log updates |
| 1963 | _send_pickup_route_update_sms | Send SMS for pickup route updates |
| 2067 | update_truck_route_status | Cron: update route data and send notifications |
| 2143 | _delete_truck_schedule | Delete route from Samsara API |
| 2163 | _clear_pickup_samsara_fields | Placeholder: clear pickup Samsara fields |
| 2166 | _clear_truck_samsara_fields | Clear Samsara route fields on schedule |
| 2174 | cancel_schedule | Cancel schedule and all its pickups |
| 2185 | set_pickups_stop_number | Set stop numbers |
| 2206 | download_pickups_label_report | Generate label report |
| 2279 | download_trip_log_report | Placeholder: download trip log report |
| 2282 | _send_sys_admin_route_map_fail_notifications | Email admin on route map failure |
| 2296 | _send_dispatcher_notifications | Email dispatchers about pushed schedule |
| 2315 | reschedule_route | Open change truck wizard |
| 2327 | reschedule_driver | Open change driver wizard |
| 2339 | _push_force_manual_pickups_to_samsara | Push manually ordered pickups to Samsara |
| 2363 | push_pickups_to_samsara | Push to Samsara |
| 2420 | update_pickup_hoo_status | Recompute HOO flags for all pickups |
| 2428 | send_label_report | Email pickup label PDF to driver |
| 2470 | send_driver_label_notifications | Cron: send label emails to drivers |
| 2511 | cron_push_pickups_to_samsara | Cron: push to Samsara |
| 2554 | optimize_route | Optimize via Samsara |
| 2696 | _get_pickup_order | Get sorted pickups with lat/lon map |
| 2719 | get_osrm_route_duration | Get route duration/distance from ORS (truck routing) |
| 2778 | archive_truck_schedule | Archive schedule |
| 2782 | action_reschedule_route | Reschedule route to different truck |
| 2878 | cron_send_daily_late_route_notifications | Cron: late route alerts |
| 2911 | create_log | Create log entry |
| 2936 | _reschedule_with_new_driver | Update driver on schedule and all pickups |
| 2950 | _prepare_ltl_pickup_data | Build LTL pickup calendar event data |
| 2993 | _prepare_truck_schedule_calendar_data | Build truck schedule calendar event data |
| 3038 | prepare_tt_calendar_data | Prepare tractor-trailer calendar events |
| 3113 | prepare_schedule_details | Return schedule summary dict |
add.note wizard (sr_scheduling)¶
File: sr_scheduling/wizard/add_note.py
Model name: add.note (TransientModel)
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| contact_type | Selection | 'phone','email','other','customer_phone_in','walkin' |
| contact_result_id | Many2one(contact.result) | |
| comment | Text | string='Memo' |
| customer_id | Many2one(res.partner) | |
| customer_region_id | Many2one(customer.region) | related, stored |
| is_schedule_pickup | Boolean | default=False |
| pick_up_date | Date | |
| reminder_date | Date | |
| requested_pick_up_date | Date | tracked |
| driver_assigned_id | Many2one(hr.employee) | related |
| no_of_box | Integer | tracked |
| truck_assigned_id | Many2one(fleet.vehicle) | tracked |
| expected_weight | Float | default=500 |
| suggested_pickup_date | Date | |
| suggested_pickup_date_msg | Char | |
| additional_time | Float | |
| term_condition_ids | Many2many(terms.conditions) | tracked |
| term_condition_ids_domain | Binary | computed |
| rejected_dates | Json | default='[]' |
| driver_notes | Text | |
| show_scheduling_config_html | Html | computed |
| hoo_start_time | Float | required |
| hoo_end_time | Float | required |
| is_fixed_appointment | Boolean | default=False |
| appointment_datetime | Datetime | |
| appointment_window_minutes | Integer | default=15 |
| route_summary_html | Html | computed |
| related_truck_schedule_id | Many2one(truck.schedule) | |
| is_forced | Boolean | default=False |
| is_driver_holiday | Boolean | computed |
| leave_display | Char | computed |
| is_public_holiday | Boolean | computed |
| public_leave_display | Char | computed |
| forklift | Selection | related to customer, readonly=False |
| dock | Selection | related, readonly=False |
| material_all_together | Selection | related, readonly=False |
| service_elevator | Selection | related, readonly=False |
| first_floor_only | Selection | related, readonly=False |
| need_help | Selection | related, readonly=False |
| customer_provides_help | Selection | related, readonly=False |
| service_profile_notes | Text | related, readonly=False |
| job_description | Text | related, readonly=False |
| customer_profile_verified | Boolean | related, readonly=False |
| service_profile_verified | Boolean | related, readonly=False |
| driver_notes_verified | Boolean | related, readonly=False |
| customer_profile_complete | Boolean | computed |
Methods¶
| Line | Method | Description |
|---|---|---|
| 104 | _compute_customer_profile_complete | Check all profile fields not 'unknown' |
| 116 | action_generate_service_profile | Auto-generate service profile text |
| 208 | action_copy_service_to_job | Copy service profile to job |
| 254 | _compute_public_holiday_leave_display | Compute public holidays display |
| 284 | _compute_driver_leave_display | Compute driver leave display |
| 315 | _compute_scheduling_config_html | Generate config HTML |
| 352 | default_get | Set defaults from customer |
| 369 | _check_validations | Validate required fields |
| 471 | confirm_add_note | Create note + handle pickup scheduling |
| 564 | onchange_pick_up_date | Update related truck schedule |
| 590 | _prepare_routing_data | Prepare routing with TSP |
| 819 | _check_service_window_fits | Verify HOO compatibility |
| 869 | _return_valid_schedules | Filter by capacity constraints |
| 930 | _set_forced_pickup | Mark pickup as forced |
| 935 | action_refresh_pick_up_date | Suggest suitable pickup date |
| 1083 | set_customer_time | Set customer HOO |
| 1089 | _compute_route_summary | Generate route summary HTML |
note.note (sr_management)¶
File: sr_management/models/note_note.py
Inherits: note.note
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| name | Char | |
| comment | Text | |
| old_id | Integer | |
| company_id_new | Char | related, stored |
| customer_id | Many2one(res.partner) | |
| customer_region_id | Many2one(customer.region) | related, stored |
| is_company | Boolean | related, stored |
| lead_id | Many2one(crm.lead) | |
| last_updated | Datetime | default=now |
| result | Char | |
| contact_type | Selection | 'phone','email','other','customer_phone_in','walkin', required, default='phone' |
| contact_result_id | Many2one(contact.result) | required |
| user_id | Many2one(res.users) | default=current user |
| is_updated_yesterday | Boolean | computed, stored |
| is_updated_recently | Boolean | computed, stored |
| is_updated_today | Boolean | computed, stored |
Methods¶
| Line | Method | Description |
|---|---|---|
| 35 | _compute_update_flags | Compute today/yesterday/recently flags |
| 52 | open_customer | Open customer form |
| 87 | cron_create_old_notes | Import old notes from CSV |
| 150 | create | Create note + trigger DM date updates |
| 163 | _set_last_decision_maker_date | Set DM date if valid result |
| 183 | _set_last_contact | Set customer last contact to now |
| 190 | _set_customer_last_account_owner_contact | Set account owner contact date |
agreement.mou (sr_management)¶
File: sr_management/models/agreement_mou.py
Model name: agreement.mou
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| name | Char | required, tracked |
| reference | Char | readonly, copy=False, tracked |
| term_condition_ids | Many2many(terms.conditions) | required, tracked |
| term_condition_ids_domain | Binary | computed |
| state | Selection | 'draft','signed','active','expired', default='draft', tracked |
| responsible_user_id | Many2one(res.users) | tracked |
| customer_id | Many2one(res.partner) | tracked |
| description | Text | |
| company_signature | Binary | |
| customer_signature | Binary | |
| customer_signed_by | Char | tracked |
| signed_on | Datetime | |
| company_signed_on | Datetime | |
| attachments_count | Integer | computed |
| start_date | Date | required, tracked |
| end_date | Date | required, tracked |
| message | Html | computed |
| is_special_agreement | Boolean | |
| special_category_ids | Many2many(terms.conditions) |
Methods¶
| Line | Method | Description |
|---|---|---|
| 75 | create | Create with auto-generated reference |
| 102 | set_signed_stage | draft -> signed |
| 106 | set_active_stage | signed -> active (requires signature) |
| 112 | set_expired_stage | active -> expired |
| 149 | send_customer_email | Send notification email |
| 156 | cron_expire_agreements | Cron: expire past end_date |
| 277 | cron_send_pre_expiry_notifications | Cron: send pre-expiry alerts |
weekly.attendance (sr_management)¶
File: sr_management/models/weekly_attendance.py
Model name: weekly.attendance
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| name | Char | |
| employee_id | Many2one(hr.employee) | required |
| attendance_ids | One2many(hr.attendance) | required |
| start_date | Date | |
| end_date | Date | |
| state | Selection | 'new','partially_approved','approved','rejected', default='new' |
| total_worked_hours | Float | computed |
| admin_approved_by_id | Many2one(res.users) | readonly |
| approver_approved_by_id | Many2one(res.users) | readonly |
| rejected_by_user_id | Many2one(res.users) | |
| is_attendance_approver | Boolean | computed |
| reject_reason | Text |
Methods¶
| Line | Method | Description |
|---|---|---|
| 42 | _compute_is_attendance_approver | Check if user is attendance manager |
| 53 | _compute_total_worked_hours | Sum worked hours |
| 63 | create | Set name from start_date |
| 92 | action_approve | Two-level approval (admin + approver) |
| 131 | action_reject(reason) | Reject with reason |
| 144 | action_reject_with_reason | Open rejection wizard |
attendance.adjustment.request (sr_management)¶
File: sr_management/models/attendance_adjustment_request.py
Model name: attendance.adjustment.request
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| employee_id | Many2one(hr.employee) | required |
| attendance_id | Many2one(hr.attendance) | required |
| check_in | Datetime | stored |
| check_out | Datetime | stored |
| request_type | Selection | 'check_in','check_out','extra_work', required, default='check_out' |
| requested_check_in | Datetime | |
| requested_check_out | Datetime | |
| extra_work_duration | Float | |
| description | Text | |
| reject_reason | Text | readonly |
| state | Selection | 'pending','submitted','partially_approved','approved','rejected', default='pending' |
| rejected_by_id | Many2one(res.users) | readonly |
| admin_approved_by_id | Many2one(res.users) | readonly |
| approver_approved_by_id | Many2one(res.users) | readonly |
| is_attendance_approver | Boolean | computed |
Methods¶
| Line | Method | Description |
|---|---|---|
| 49 | action_submit | pending -> submitted |
| 72 | action_approve | Two-level approval + update attendance |
| 103 | action_reject(reason) | Reject with reason |
attendance.checkout.request (sr_management)¶
File: sr_management/models/attendance_checkout_request.py
Model name: attendance.checkout.request
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| employee_id | Many2one(hr.employee) | required |
| attendance_id | Many2one(hr.attendance) | required |
| check_in | Datetime | related, stored |
| check_out | Datetime | related, stored |
| requested_checkout | Datetime | required |
| description | Text | |
| state | Selection | 'pending','submitted','approved','rejected', default='pending' |
| approved_by_id | Many2one(res.users) | readonly |
| rejected_by_id | Many2one(res.users) | readonly |
Methods¶
| Line | Method | Description |
|---|---|---|
| 42 | action_approve | Approve + send notification |
| 54 | action_reject | Reject + send notification |
email.pickup.response (sr_pickup_blast)¶
File: sr_pickup_blast/models/email_pickup_response.py
Model name: email.pickup.response
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| partner_id | Many2one(res.partner) | required, ondelete='cascade', index |
| token | Char | required, index, default=uuid4 |
| response_type | Selection | 'pending','need_pickup','no_pickup_needed', default='pending', required |
| response_date | Datetime | |
| created_date | Datetime | default=now, required |
| expires_at | Datetime | |
| is_expired | Boolean | computed |
| mailing_id | Many2one(mailing.mailing) | ondelete='set null', index |
| ab_variant | Selection | 'a','b' |
| is_test | Boolean | default=False |
| lead_id | Many2one(crm.lead) | ondelete='set null' |
| note_id | Many2one(note.note) | ondelete='set null' |
| partner_name | Char | related, stored |
| partner_email | Char | related |
| company_id_new | Char | related |
| response_time_hours | Float | computed, stored |
| response_day | Char | computed, stored |
| response_week | Char | computed, stored |
| response_month | Char | computed, stored |
Methods¶
| Line | Method | Description |
|---|---|---|
| 92 | _compute_is_expired | Check if token expired |
| 117 | is_token_valid | Check if token not expired |
| 125 | generate_token_for_partner | Generate token (one per mailing) |
| 162 | process_need_pickup | Process "need pickup" response |
| 228 | process_no_pickup | Process "no pickup" response |
| 256 | _create_response_note | Create note with 'Receive Email' result |
| 291 | get_response_by_token | Find response by token |
| 343 | get_campaign_stats(mailing_id) | Get aggregate campaign stats |
mass.email.wizard (sr_pickup_blast)¶
File: sr_pickup_blast/models/mass_email_wizard.py
Model name: mass.email.wizard (TransientModel)
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| mailing_type | Selection | 'direct','create_list', default='direct', required |
| selection_method | Selection | 'filter','manual', default='filter', required |
| filter_id | Many2one(ir.filters) | domain: model=res.partner |
| partner_ids | Many2many(res.partner) | |
| list_name | Char | |
| mailing_subject | Char | default text |
| subject_char_count | Integer | computed |
| subject_char_status | Char | computed |
| mailing_preheader | Char | default text |
| preheader_char_count | Integer | computed |
| preheader_char_status | Char | computed |
| test_email_address | Char | |
| schedule_date | Datetime | |
| segment_filter | Selection | 'all','never_mailed','mailed_no_response','responders','pickup_requesters','not_mailed_30d','not_mailed_60d','not_mailed_90d', default='all' |
| enable_ab_testing | Boolean | default=False |
| ab_split_percentage | Integer | default=50 |
| subject_variant_b | Char | |
| preheader_variant_b | Char | |
| include_pickup_links | Boolean | default=False |
| contact_count | Integer | computed |
Methods¶
| Line | Method | Description |
|---|---|---|
| 129 | _compute_char_counts | Character count status |
| 176 | _compute_contact_count | Count filtered contacts |
| 192 | _get_filter_domain | Get domain from filter + segmentation |
| 210 | _apply_segment_filter | Apply customer segmentation |
| 299 | action_create_mailing | Create mailing from contacts |
| 373 | _generate_pickup_response_tokens | Generate tokens for contacts |
| 396 | action_create_pickup_mailing | Create mailing with pickup links |
| 479 | _create_ab_test_mailings | Create A/B test mailings |
| 585 | _get_pickup_email_body(base_url, preheader) | Generate email HTML body |
| 703 | action_send_test_email | Send test email |
sr.kpi.daily (sr_operations_kpi)¶
File: sr_operations_kpi/models/kpi_daily.py
Model name: sr.kpi.daily
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| date | Date | required, default=today, index |
| employee_id | Many2one(hr.employee) | required, ondelete='cascade', index |
| user_id | Many2one(res.users) | related, stored, index |
| kpi_template_id | Many2one(sr.kpi.template) | index |
| department_id | Many2one | related, stored, index |
| calls_made | Integer | |
| conversations | Integer | |
| pickups_booked | Integer | |
| new_customers | Integer | |
| queue_items_completed | Integer | |
| avg_call_time_seconds | Integer | |
| laptops_processed | Integer | |
| laptops_cleaned | Integer | |
| desktops_processed | Integer | |
| phones_processed | Integer | |
| tablets_processed | Integer | |
| total_devices_processed | Integer | computed, stored |
| boxes_sorted | Integer | |
| drives_processed | Integer | |
| drives_shredded | Integer | |
| da_gaylords_processed | Float | |
| scrap_lbs | Float | |
| routes_completed | Integer | |
| stops_completed | Integer | |
| boxes_picked_up | Integer | |
| ebay_listings | Integer | |
| ebay_orders_shipped | Integer | |
| memory_processed | Integer | |
| cpus_processed | Integer | |
| total_components_processed | Integer | computed, stored |
| target_calls | Integer | |
| target_new_customers | Integer | |
| target_laptops | Integer | |
| target_boxes | Integer | |
| target_drives | Integer | |
| target_devices | Integer | |
| status | Selection | 'below','on_track','above','no_target', computed, stored |
| performance_pct | Float | computed, stored |
| last_updated | Datetime | |
| data_source | Selection | 'auto','manual', default='auto' |
Methods¶
| Line | Method | Description |
|---|---|---|
| 83 | _compute_total_devices | Sum laptops+desktops+phones+tablets |
| 93 | _compute_total_components | Sum drives+memory+CPUs |
| 104 | _compute_status | Performance % vs targets |
| 149 | cron_compute_kpis | Main cron: aggregate KPI data |
| 444 | _send_daily_kpi_sms | Send daily KPI SMS |
| 458 | action_refresh_data | Manual re-aggregate |
sr.wip.snapshot (sr_operations_kpi)¶
File: sr_operations_kpi/models/wip_snapshot.py
Model name: sr.wip.snapshot
Fields¶
| Field | Type | Key Attributes |
|---|---|---|
| timestamp | Datetime | required, index |
| snapshot_type | Selection | 'scheduled','manual', default='scheduled', index |
| da_gaylords | Integer | |
| da_daily_capacity | Float | default=3.0 |
| da_wip_days | Float | computed, stored |
| laptop_queue | Integer | |
| laptop_daily_capacity | Float | default=20.0 |
| laptop_wip_days | Float | computed, stored |
| desktop_queue | Integer | |
| desktop_daily_capacity | Float | default=10.0 |
| sort_wip_boxes | Integer | |
| hd_queue_drives | Integer | |
| hd_daily_capacity | Float | default=100.0 |
| hd_wip_days | Float | computed, stored |
| lcd_wip_units | Integer | |
| today_routes | Integer | |
| today_stops | Integer | |
| next_week_solid_days | Integer | |
| next_week_light_days | Integer | |
| schedule_fill_pct | Float | computed, stored |
| total_reusable_devices | Integer | |
| total_scrap_devices | Integer | |
| devices_processed_today | Integer |
Methods¶
| Line | Method | Description |
|---|---|---|
| 58 | _compute_wip_days | Calculate WIP days for DA/laptop/HD |
| 65 | _compute_schedule_fill | Schedule fill % from solid days |
| 79 | cron_compute_wip_snapshot | Cron: aggregate inventory + route data |
| 178 | action_create_manual_snapshot | Create manual snapshot |