feat: Portal, Email Inbound, Discuss + module improvements

- Portal: /my/* routes, signup, password reset, portal user support
- Email Inbound: IMAP polling (go-imap/v2), thread matching
- Discuss: mail.channel, long-polling bus, DM, unread count
- Cron: ir.cron runner (goroutine scheduler)
- Bank Import, CSV/Excel Import
- Automation (ir.actions.server)
- Fetchmail service
- HR Payroll model
- Various fixes across account, sale, stock, purchase, crm, hr, project

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marc
2026-04-12 18:41:57 +02:00
parent 2c7c1e6c88
commit 66383adf06
87 changed files with 14696 additions and 654 deletions

View File

@@ -2,7 +2,6 @@ package models
import (
"fmt"
"math"
"odoo-go/pkg/orm"
)
@@ -221,8 +220,11 @@ func initStockLandedCost() {
_, err := env.Tx().Exec(env.Ctx(),
`UPDATE stock_valuation_layer
SET remaining_value = remaining_value + $1, value = value + $1
WHERE stock_move_id = $2 AND product_id = $3 AND remaining_qty > 0
LIMIT 1`,
WHERE id = (
SELECT id FROM stock_valuation_layer
WHERE stock_move_id = $2 AND product_id = $3 AND remaining_qty > 0
ORDER BY id LIMIT 1
)`,
adj.AdditionalCost, adj.MoveID, adj.ProductID,
)
if err != nil {
@@ -375,8 +377,3 @@ func initStockLandedCost() {
orm.Many2one("currency_id", "res.currency", orm.FieldOpts{String: "Currency"}),
)
}
// roundCurrency rounds a monetary value to 2 decimal places.
func roundCurrency(value float64) float64 {
return math.Round(value*100) / 100
}