Open
Conversation
b6d2dcf to
c6983da
Compare
2d8e108 to
45ef2ab
Compare
…h projects Implement new KRIS Project module for tracking post-contract academic service and research project revenue. Includes installment management, receipt recording, and automated allocation breakdown across 4 recipients (central, faculty, department, KRIS). Features: simple state machine (draft → confirmed → done/cancel), auto-generated project sequences, computed financial totals, and 3-tier security groups.
…vice & research projects Add comprehensive revenue tracking and allocation system for KRIS academic service and research projects. Key changes: - Created kris.project.type master data model with 2 categories (academic_service, research) and 6 default types - Refactored project_type from Selection to Many2one relation with kris.project.type - Changed project leader from free-text leader_name to leader_id Many2one to hr.employee - Added maintenance_deduction_amount computed field (allocatable_value × pct / 100) - Redesigned Tab 1 (มูลค่าและงวดงาน) with reorganized financial field layout - Enhanced Tab 2 (รายรับ) with auto-fill receipt amount from selected installment via onchange - Refactored Tab 3 (การจัดสรรรายได้): - estimated_amount now editable (stored) instead of computed - allocation_pct computed from estimated_amount / maintenance_deduction_amount × 100 - Users can now customize allocation percentages after initial computation - Added Tab 4 (เอกสารแนบ) for document attachments using chatter widget - Updated allocation line computation: estimated_amount auto-filled from 35-35-20-10 split, then user-editable - Added Configuration menu with Project Type CRUD for managers - Added kris.project.type model access control (managers full CRUD, users read-only) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…pe models Split the single kris.project.type model (with category Selection field) into two separate models: - kris.project.category: parent model (งานบริการวิชาการ, งานวิจัย) - kris.project.type: sub-type model linked to category via Many2one On the project form, users first select a category, then select a sub-type filtered by that category. Onchange clears the sub-type when category changes. Updated seed data, security access, views, and menus accordingly.
…rovements - Replace inline receipt entry with a wizard (kris.project.receipt.wizard) - auto-fills project, filters out already-used installments - shows ยอดรับสุทธิ = จำนวนเงิน - มูลค่าครุภัณฑ์ in real time - Add equipment_cost_in_installment and net_amount to receipt model - Add total_net_received computed total on project - Fix actual_amount formula: (total_net_received × %หักค่าบำรุง) × %จัดสรร - Add @constrains: sum of allocation_pct must not exceed 100% - Add sum footer for % จัดสรร column in allocation tree - Replace placeholder attachment div with many2many_binary field
Add a dashboard client action to the KRIS Project app showing: - Summary cards: total project value, total received, KRIS estimated/actual - Horizontal bar chart: KRIS revenue by project sub-type - Horizontal bar chart: Top 10 project leaders by receipts received - Combo chart: monthly receipts current year (bar) vs previous year (line) - Heatmap: allocation actual amounts by faculty × recipient type Filters: date range (receipt date), category, cascaded sub-type, fiscal year. Dashboard menu appears first (sequence=1) in the KRIS Project app.
…ceipts
1. Maintenance deduction type: add selection field (ขั้นบันได / กำหนดเอง).
- ขั้นบันได: progressive tiers 10%/9%/8%/7% on allocatable_value.
- กำหนดเอง: flat percentage (existing behaviour).
- Allocation actual_amount now uses effective_rate (maintenance_deduction_amount
/ allocatable_value) so it works correctly for both modes.
2. Receipt "ปันส่วนไป KRIS" flag: add allocate_to_kris boolean (default True)
to kris.project.receipt and the wizard. KRIS allocation line uses only the
net_amount from receipts where allocate_to_kris=True; all other lines use
total_net_received as before.
3. Delete receipts: remove readonly="1" from receipt_ids O2M in the form view
and add create="0" on the tree so users can delete rows but not add inline.
Fully readonly when project state is done or cancel.
…eceipt allocation breakdown - Add allocation item & template master data models with seed data (ส่วนกลาง/คณะ/ภาค/KRIS, 35/35/20/10 standard template) - Add per-installment and per-receipt allocation breakdown models - operating_expense: onchange auto-suggests project_value - equipment_cost - allocatable_value now equals operating_expense (split compute methods) - Replace action_compute_allocation with action_apply_allocation_template - Add installment wizard (replaces inline editable tree) - Receipt wizard: add allocation breakdown, default from installment - actual_amount simplified to sum of receipt allocation amounts - Remove allocate_to_kris field (replaced by per-receipt allocation lines) - Add security rules and access rights for all new models
Add allocation_line_id as column_invisible in installment and receipt wizard trees so the OWL client includes it when saving. Also add create="0" delete="0" to prevent adding rows without the required field.
…ient In Odoo 16, fields with readonly=True on the model are not sent by the OWL client during create. Remove readonly from wizard line models and enforce it view-side instead.
Add deduction_guarantee, deduction_advance, received_from_employer, maintenance_fee, extra_deduction, and amount_net fields to kris.project.installment. Update form and tree views accordingly.
Remove kris.project.installment.wizard and its line model. Move the pre-populate allocation logic and auto-sequence assignment into kris.project.installment itself via default_get and create overrides. Add estimated_amount, allocated_amount, remaining_amount display fields to kris.project.installment.allocation with a single read_group query (fixes N+1). Excludes current installment in edit mode to avoid double-counting (correctness fix). The installment form is now used for both create and edit, with the allocation tree showing full info columns identical to the old wizard.
…oject duration Add base.exception integration for state transition warnings: - 5 confirm-phase rules (project value, allocation, installments) - 2 done-phase rules (installments received, revenue collected) - 1 cancel-phase rule (receipts exist) All rules are non-blocking and ignorable via confirmation wizard. Change project_duration from free-text Char to computed Integer (days), auto-calculated from contract start/end dates.
…gle field Remove faculty_id, keep only department_id (renamed to "หน่วยงาน"). Update form, tree, search views and dashboard heatmap accordingly.
96872c1 to
e8e391f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New KRIS Project module for tracking post-contract academic service and research project revenue. Provides complete lifecycle management from project setup through revenue allocation.
Features
Testing
Install module and verify: project creation with all fields, installment/receipt management, allocation computation, state transitions, security rules.