Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
5d8b06b
Add support for cash counter
bodhish Jan 8, 2026
0145972
Clean up
bodhish Jan 8, 2026
84ec851
Fix circular dep
bodhish Jan 9, 2026
fb897c5
Add missing import
bodhish Jan 9, 2026
5553b2e
Validate session id in transfer accept/reject
amjithtitus09 Jan 9, 2026
81f97f2
Add support for creating public users
bodhish Jan 10, 2026
74a2e58
Remove account comission
bodhish Jan 10, 2026
6347ba1
Add support for x_care_id in users
bodhish Jan 10, 2026
e1d1a5c
Add more addons
bodhish Jan 10, 2026
ca765d7
Clean up accounting customisation
bodhish Jan 10, 2026
add8a9a
Remove customer balance
bodhish Jan 10, 2026
07446f6
Clean up unused modules
bodhish Jan 10, 2026
791d88d
Clean up product_category_customisationun
bodhish Jan 10, 2026
bc4a571
Clean up account discounts
bodhish Jan 10, 2026
c7415e0
Update to 19.0
bodhish Jan 10, 2026
6f39a98
Fix auth failure in 19
bodhish Jan 11, 2026
e0a76ae
update to odoo 19
bodhish Jan 11, 2026
b3ada94
Update cash denomination to 19
bodhish Jan 11, 2026
2b06ec2
Update account module
bodhish Jan 11, 2026
a556831
refact:_get_or_create_taxes
nandkishorr Jan 12, 2026
986fd8d
User Care Id view
amjithtitus09 Jan 13, 2026
69f7a92
Merge branch '19.0' of https://github.com/ohcnetwork/odoo_connector i…
amjithtitus09 Jan 13, 2026
1c58723
Tax fix
amjithtitus09 Jan 13, 2026
b4bd161
Tax fix 2
amjithtitus09 Jan 13, 2026
d7bbacd
Insurance module
amjithtitus09 Jan 16, 2026
e486bf7
Insurance model fix
amjithtitus09 Jan 16, 2026
9499fbb
Insurance company in invoice
amjithtitus09 Jan 16, 2026
ef5369e
Add HR payroll
bodhish Jan 16, 2026
4b0fceb
Merge branch '19.0' of https://github.com/ohcnetwork/odoo_connector i…
bodhish Jan 16, 2026
0a19d61
Insurance fix
amjithtitus09 Jan 16, 2026
651f68a
Merge branch '19.0' of https://github.com/ohcnetwork/odoo_connector i…
amjithtitus09 Jan 16, 2026
3565b82
Insurance print lines
amjithtitus09 Jan 16, 2026
e23f685
Add achievement report
bodhish Jan 16, 2026
f025f28
Merge branch '19.0' of https://github.com/ohcnetwork/odoo_connector i…
bodhish Jan 16, 2026
534fe4e
Fix issues in user creation
bodhish Jan 17, 2026
2da2a73
Sponsor account
amjithtitus09 Jan 17, 2026
c9ebc6c
Merge branch '19.0' of https://github.com/ohcnetwork/odoo_connector i…
amjithtitus09 Jan 17, 2026
0cff5f5
Insurance changes
amjithtitus09 Jan 17, 2026
925f016
Insurance Fields
amjithtitus09 Jan 17, 2026
46d43b3
Clean up sponsors
bodhish Jan 18, 2026
199fef0
Insurance format changes
amjithtitus09 Jan 19, 2026
4156d99
Fix cash counter computation
bodhish Jan 19, 2026
f6b3089
Add support for purchase refund
bodhish Jan 20, 2026
5c9c2d5
Insurance changes
amjithtitus09 Jan 20, 2026
99d4afd
Insurance print formatting
amjithtitus09 Jan 20, 2026
907524e
Fix cash balance
bodhish Jan 20, 2026
46eae6f
Ignore account cancel
bodhish Jan 20, 2026
ac3e2d2
Merge pull request #133 from ohcnetwork/bodhi/purchase_refund
bodhish Jan 20, 2026
a922074
Add support for care of account
bodhish Jan 21, 2026
c8a9d74
Insurance field and formatting changes
amjithtitus09 Jan 22, 2026
4da46f1
Vendor bill numebr and date
amjithtitus09 Jan 22, 2026
61edf4d
Vendor Bill reference number
amjithtitus09 Jan 22, 2026
ca09e0d
Insurance category changes, Room number and days, reversed line items
amjithtitus09 Jan 22, 2026
ac981df
Merge pull request #134 from ohcnetwork/bodhi/care-of-account
bodhish Jan 22, 2026
3dfed49
Insurance pull unpaid only
amjithtitus09 Jan 23, 2026
b64f202
Insurace Cleanup
amjithtitus09 Jan 23, 2026
6406531
Rounding to nearest rupee
amjithtitus09 Jan 27, 2026
6d354cd
Invoice Rounding config in settings
amjithtitus09 Jan 27, 2026
299550e
Recovered status
amjithtitus09 Jan 27, 2026
aebc01e
Payment method - add Debit
amjithtitus09 Jan 28, 2026
8ad23e8
Insurance print font size, Vendor create type fix
amjithtitus09 Jan 28, 2026
84c0a02
Template changes
amjithtitus09 Jan 28, 2026
1b95bd0
Add support for cash voucher
bodhish Jan 28, 2026
8296e0f
Fix hsn update
amjithtitus09 Jan 28, 2026
5e17f96
Merge branch '19.0' of https://github.com/ohcnetwork/odoo_connector i…
amjithtitus09 Jan 28, 2026
64a1ac6
Remove log
amjithtitus09 Jan 28, 2026
4239501
Removed DOB, Age editable
amjithtitus09 Jan 29, 2026
b630b88
Invoice and Insurance - Add IP bill number
amjithtitus09 Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion account_discounts/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import models,wizard
from . import models
18 changes: 9 additions & 9 deletions account_discounts/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "Account Discounts",
"summary": "This module defines and manages predefined discounts used in bills",
"version": "0.0.1",
"name": "Care: Account Discounts",
"summary": "Track discount groups on invoices using native Odoo discounts",
"version": "19.0.1.0.0",
"category": "Accounting",
"installable": True,
"depends": ["base","account","web","insurance_management"],
"license": "LGPL-3",
"author": "Custom",
"depends": ["account"],
"data": [
"security/ir.model.access.csv",
"views/discount_group_views.xml",
"views/account_move_views.xml",
"views/discount_groups_views.xml",
"views/product_template_views.xml",
"wizard/discount_category_report_wizard.xml",
],
}
"installable": True,
}
3 changes: 2 additions & 1 deletion account_discounts/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import account_move,discount_groups, product_template
from . import discount_group
from . import account_move
127 changes: 32 additions & 95 deletions account_discounts/models/account_move.py
Original file line number Diff line number Diff line change
@@ -1,112 +1,49 @@
import json
from odoo import api, fields, models
from odoo.tools.float_utils import float_is_zero


class AccountMove(models.Model):
_inherit = "account.move"

discount_list = fields.Char(
compute="_compute_discount_summary", string="Discount", store=False
discount_summary = fields.Text(
string="Discount Summary",
compute="_compute_discount_summary",
store=False,
)

@api.depends("invoice_line_ids.account_discount")
@api.depends("invoice_line_ids.discount", "invoice_line_ids.discount_group_id")
def _compute_discount_summary(self):
for move in self:
move.discount_list = None
if move.move_type == "out_invoice":
discount_dict = {}
for line in move.invoice_line_ids:
if line.account_discount:
for disc in line.account_discount:
# Check if it's amount-based or percentage-based discount
if disc.disc_amount:
# Amount-based discount
discount_amount = abs(disc.disc_amount * line.quantity)
else:
# Percentage-based discount
discount_amount = abs(
line.price_subtotal * (disc.disc_percent / 100.0)
)
discount_amount = round(discount_amount, 2)

if disc.discount_group.name not in discount_dict:
discount_dict[disc.discount_group.name] = 0.0

discount_dict[disc.discount_group.name] += discount_amount
discount_str = "\n".join(
f"{k} : {format(v, '.2f')}" for k, v in discount_dict.items()
)
move.discount_list = discount_str

@api.model
def create(self, vals):
move = super(AccountMove, self).create(vals)
if move.move_type == "out_invoice":
discount_lines = move.invoice_line_ids.filtered(
lambda l: l.account_discount
)

if not discount_lines:
return move
section_line_commands = []

section_line_commands.append(
(
0,
0,
{
"display_type": "line_section",
"name": "Discount",
},
move.discount_summary = False
if move.move_type not in ("out_invoice", "in_invoice"):
continue

discount_totals = {}
for line in move.invoice_line_ids.filtered(lambda l: l.discount > 0):
group_name = line.discount_group_id.name if line.discount_group_id else "General"
# Calculate discount amount from the native discount percentage
discount_amount = line.price_unit * line.quantity * line.discount / 100
discount_totals[group_name] = discount_totals.get(group_name, 0.0) + discount_amount

if discount_totals:
move.discount_summary = "\n".join(
f"{name}: {amount:.2f}" for name, amount in discount_totals.items()
)
)
discount_dict = {}
for line in discount_lines:
for disc in line.account_discount:
# Check if it's amount-based or percentage-based discount
if disc.disc_amount:
# Amount-based discount
discount_amount = abs(disc.disc_amount * line.quantity)
else:
# Percentage-based discount
discount_amount = abs(
line.price_subtotal * (disc.disc_percent / 100.0)
)
discount_amount = round(discount_amount, 2)

if disc.id not in discount_dict:
discount_dict[disc.id] = 0.0

discount_dict[disc.id] += discount_amount
if discount_dict:
for product_tmpl_id, amount in discount_dict.items():
product = self.env["product.product"].search(
[("product_tmpl_id", "=", product_tmpl_id)], limit=1
)
if product:
section_line_commands.append(
(
0,
0,
{
"product_id": product.id,
"received_qty": -1,
"quantity": -1,
"price_unit": amount,
"name": product.name,
},
)
)

if section_line_commands:
move.write({"invoice_line_ids": section_line_commands})
return move


class AccountMoveLine(models.Model):
_inherit = "account.move.line"

account_discount = fields.Many2many(
"product.template", string="Discount", domain=[("is_disc_item", "=", True)]
# Track discount metadata - the actual discount is in the native 'discount' field
discount_group_id = fields.Many2one(
"account.discount.group",
string="Discount Group",
help="The discount group/scheme applied to this line",
)
discount_type = fields.Selection([
('percentage', 'Percentage'),
('fixed', 'Fixed Amount'),
], string="Discount Type", default='percentage')
x_care_discount_id = fields.Char(
string="Care Discount ID",
help="Reference ID from Care system",
)
9 changes: 9 additions & 0 deletions account_discounts/models/discount_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from odoo import fields, models


class AccountDiscountGroup(models.Model):
_name = "account.discount.group"
_description = "Discount Group"

name = fields.Char(string="Group Name", required=True)
x_care_id = fields.Char(string="Care ID", readonly=True)
8 changes: 0 additions & 8 deletions account_discounts/models/discount_groups.py

This file was deleted.

9 changes: 0 additions & 9 deletions account_discounts/models/product_template.py

This file was deleted.

4 changes: 2 additions & 2 deletions account_discounts/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_discount_groups,account.discount.groups,model_account_discount_groups,base.group_user,1,1,1,1
access_discount_categ_wizard,discount.categ.wizard,model_discount_categ_wizard,base.group_user,1,1,1,1
access_account_discount_group_user,account.discount.group.user,model_account_discount_group,account.group_account_user,1,0,0,0
access_account_discount_group_manager,account.discount.group.manager,model_account_discount_group,account.group_account_manager,1,1,1,1
18 changes: 8 additions & 10 deletions account_discounts/views/account_move_views.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_move_discount_form" model="ir.ui.view">
<field name="name">account.move.form.care.discount</field>
<record id="view_move_form_discount" model="ir.ui.view">
<field name="name">account.move.form.discount</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_line_ids']/list/field[@name='price_unit']" position="after">
<field name="account_discount" widget="many2many_tags"/>
</xpath>
<xpath expr="//field[@name='invoice_line_ids']/list/field[@name='product_id']" position="attributes">
<attribute name="domain">[('is_disc_item', '!=', True)]</attribute>
<xpath expr="//field[@name='invoice_line_ids']/list/field[@name='discount']" position="after">
<field name="discount_group_id" optional="hide"/>
</xpath>
<field name="tax_totals" position="after">
<field name="discount_list" options="{'line_breaks': True}" widget="text" nolabel="1" readonly="1"/>
<field name="discount_summary" widget="text" readonly="1" nolabel="1"/>
</field>
</field>
</record>
</odoo>
</odoo>
42 changes: 42 additions & 0 deletions account_discounts/views/discount_group_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_account_discount_group_list" model="ir.ui.view">
<field name="name">account.discount.group.list</field>
<field name="model">account.discount.group</field>
<field name="arch" type="xml">
<list string="Discount Groups">
<field name="name"/>
<field name="x_care_id" optional="hide"/>
</list>
</field>
</record>

<record id="view_account_discount_group_form" model="ir.ui.view">
<field name="name">account.discount.group.form</field>
<field name="model">account.discount.group</field>
<field name="arch" type="xml">
<form string="Discount Group">
<sheet>
<group>
<field name="name"/>
<field name="x_care_id" groups="base.group_no_one"/>
</group>
</sheet>
</form>
</field>
</record>

<record id="action_account_discount_group" model="ir.actions.act_window">
<field name="name">Discount Groups</field>
<field name="res_model">account.discount.group</field>
<field name="view_mode">list,form</field>
</record>

<menuitem
id="menu_account_discount_group"
name="Discount Groups"
parent="account.menu_finance_configuration"
action="action_account_discount_group"
sequence="30"
/>
</odoo>
46 changes: 0 additions & 46 deletions account_discounts/views/discount_groups_views.xml

This file was deleted.

21 changes: 0 additions & 21 deletions account_discounts/views/product_template_views.xml

This file was deleted.

1 change: 0 additions & 1 deletion account_discounts/wizard/__init__.py

This file was deleted.

Loading