-
Notifications
You must be signed in to change notification settings - Fork 0
Odoo Connector Review #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
amjithtitus09
wants to merge
282
commits into
snapshot/first
Choose a base branch
from
main
base: snapshot/first
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
282 commits
Select commit
Hold shift + click to select a range
dc54b32
[IMP]:Separate pydantic for account move return
Visakhdc 182e7bc
Merge pull request #17 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 147bac8
[IMP]:Added product taxes
Visakhdc e28f396
Merge pull request #18 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 3926e0c
[FIX]:Error response fix
Visakhdc aaad018
Merge pull request #19 from ohcnetwork/visakh_care_connector_improvement
Visakhdc a539052
[IMP]: Removed tax from inv lines
Visakhdc 64d7684
Merge pull request #20 from ohcnetwork/visakh_care_connector_improvement
Visakhdc dbdf10f
[IMP]: Change partner_type to payment_mode
Visakhdc 3141c94
Merge pull request #21 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 508f9d7
[IMP]: Avoid duplicate return, cancel payment, partner data update
Visakhdc d3e9fbd
Merge pull request #22 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 8a2c217
[IMP]: Added new cancel payment endpoint
Visakhdc 57db7ba
Merge pull request #23 from ohcnetwork/visakh_care_connector_improvement
Visakhdc ebdc577
[FIX]: Vendor bill in draft state
Visakhdc 9ad4240
Merge pull request #24 from ohcnetwork/visakh_care_connector_improvement
Visakhdc d2b6bc2
[ADD]: partner_ledger_excel_report
Visakhdc 7fec78c
Merge pull request #25 from ohcnetwork/visakh_partner_ledger_xlsx
Visakhdc a2748d9
[ADD]: invoice_reports
Visakhdc f0f2c14
Merge pull request #26 from ohcnetwork/visakh_Invoice_reports
Visakhdc 179ddcd
[IMP]: Add bill counters
Visakhdc d2e605b
Merge pull request #27 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 52e35c7
[IMP]: Petty cash
Visakhdc 0a66a70
Merge pull request #28 from ohcnetwork/visakh_cash_denomination
Visakhdc af35b0a
[FIX]: Updating related partner, product taxes
Visakhdc 93da390
Merge pull request #29 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 18b8849
[IMP]: add or updating product hsn code
Visakhdc c08baa7
Merge pull request #30 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 9eefefb
[FIX]: Rounding cash in hand
Visakhdc 48ae44c
Merge pull request #31 from ohcnetwork/visakh_cash_denomination
Visakhdc 4c02b3e
[ADD]:account_discounts
Visakhdc 1c467c2
Merge pull request #32 from ohcnetwork/visakh_account_discount
Visakhdc fb2cd92
[IMP]:add discounts in account move line
Visakhdc 235de60
Merge pull request #33 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 1aa5812
[IMP]:add sale and return purchase and return, hsn reports
Visakhdc b4de9f8
Merge pull request #34 from ohcnetwork/visakh_Invoice_reports
Visakhdc abc8c99
[FIX]: separate from accounting kit reports
Visakhdc ba0420e
Merge pull request #35 from ohcnetwork/visakh_partner_ledger_xlsx
Visakhdc c9a51e3
[IMP]: added xlsx in partner ledger
Visakhdc 3637759
Merge pull request #36 from ohcnetwork/visakh_partner_ledger_xlsx
Visakhdc 7f5643a
[FIX]: Changed GSTIN to PAN,multiple cashier in a location
Visakhdc 78cf2bc
Merge pull request #37 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 082b886
[FIX]: Free products calculation issue fix
Visakhdc ece7d23
Merge pull request #38 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 3d7c60b
[ADD]: vendor_tds_auto_apply
Visakhdc ad62eda
Merge pull request #39 from ohcnetwork/visakh_vendor_tds_auto_apply
Visakhdc 23bb87a
[IMP]:Product archive or unarchive
Visakhdc 5b05423
Merge pull request #40 from ohcnetwork/visakh_care_connector_improvement
Visakhdc f1e732b
[IMP]:vendor tds report
Visakhdc f5078b3
Merge pull request #41 from ohcnetwork/visakh_vendor_tds_auto_apply
Visakhdc 74befce
[IMP]:Product archive or unarchive using status
Visakhdc 544034e
Merge pull request #42 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 7944572
[IMP]:Active product in draft or active status
Visakhdc 93b26e3
Merge pull request #43 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 352b675
[FIX]:Report column wise tax
Visakhdc 4a8ba4b
Merge pull request #44 from ohcnetwork/visakh_Invoice_reports
Visakhdc f4d4fa8
[IMP]:Partner wise filtering
Visakhdc 0b0a66a
Merge pull request #45 from ohcnetwork/visakh_partner_ledger_xlsx
Visakhdc 29a4de3
[IMP]:partner and product category archive and unarchive
Visakhdc 34e9271
Merge pull request #46 from ohcnetwork/visakh_care_connector_improvement
Visakhdc b0e22be
[ADD]:grn_number_in_vendor_bill
Visakhdc d1fedf4
Merge pull request #47 from ohcnetwork/visakh_grn_number_in_vendor_bill
Visakhdc 03ab0ce
[IMP]:Adding discount products
Visakhdc 75e7487
Merge pull request #48 from ohcnetwork/visakh_account_discount
Visakhdc 66d162a
[IMP]:Discount product in account move line
Visakhdc d7ad6a7
Merge pull request #49 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 5ad1574
[IMP]:Discount report
Visakhdc 247c90b
Merge pull request #50 from ohcnetwork/visakh_account_discount
Visakhdc eb8dfd0
[FIX]:Cash denomination payment fix
Visakhdc 9d29b2e
Merge pull request #51 from ohcnetwork/visakh_cash_denomination
Visakhdc e910b22
[ADD]:account_move_line_commission
Visakhdc ddbf049
Merge pull request #52 from ohcnetwork/visakh_account_move_line_commi…
Visakhdc 90d8855
[FIX]:Remove extra transfer record,display transfer amount in views
Visakhdc aa0f919
Merge pull request #53 from ohcnetwork/visakh_cash_denomination
Visakhdc 9f22a34
[FIX]:Discount list only apply in invoices
Visakhdc eec6761
Merge pull request #54 from ohcnetwork/visakh_account_discount
Visakhdc a5454a4
[FIX]:Discount application is only applicable to invoices.
Visakhdc 480ce8e
Merge pull request #55 from ohcnetwork/visakh_account_discount
Visakhdc 0b931f7
[FIX]:Product category remove archive option
Visakhdc e391ed6
Merge pull request #56 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 30e23b1
[FIX]:Error return correction in responds
Visakhdc 99a68d7
Merge pull request #57 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 3a28deb
[ADD]:ssmm_bank_reconciliation
Visakhdc 17a3f8e
Merge pull request #58 from ohcnetwork/visakh_ssmm_bank_reconciliation
Visakhdc 15a58ab
[FIX]:reconcile_date field required false
Visakhdc 15815a3
Merge pull request #59 from ohcnetwork/visakh_ssmm_bank_reconciliation
Visakhdc b38f46a
[IMP]: Add balance total fields
Visakhdc 0924c2c
Merge pull request #60 from ohcnetwork/visakh_ssmm_bank_reconciliation
Visakhdc 31ad140
[IMP]: Reconciliation report
Visakhdc 3ce36c7
Merge pull request #61 from ohcnetwork/visakh_ssmm_bank_reconciliation
Visakhdc fea4ae0
[IMP]: Custom invoice number
Visakhdc af89152
Merge pull request #62 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 7660be2
[IMP]: optional invoice number
Visakhdc 933672a
Merge pull request #63 from ohcnetwork/visakh_care_connector_improvement
Visakhdc aea4905
[FIX]: No product/parent creation in invoice
Visakhdc c755502
Merge pull request #64 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 4a50ffa
[FIX]: Checking product with care id
Visakhdc b8ad762
Merge pull request #65 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 7e7f52d
[ADD]: web_responsive oca
Visakhdc 91db451
Merge pull request #66 from ohcnetwork/visakh_web_responsive
Visakhdc 80eee03
[IMP]:Denomination journal entry
Visakhdc e2759bf
Merge pull request #67 from ohcnetwork/visakh_cash_denomination
Visakhdc 3b9fe00
[FIX]:Remove journal entry from transfer submit
Visakhdc b7e3667
Merge pull request #68 from ohcnetwork/visakh_cash_denomination
Visakhdc e09d2b6
[FIX]:block counter submission for mismatch
Visakhdc 1c03860
Merge pull request #69 from ohcnetwork/visakh_cash_denomination
Visakhdc c000d33
[IMP]:create draft journal for rejection
Visakhdc 1370192
Merge pull request #70 from ohcnetwork/visakh_cash_denomination
Visakhdc 839932d
[IMP]:Trial balance and partner aging reports
Visakhdc d934a00
Merge pull request #71 from ohcnetwork/visakh_Invoice_reports
Visakhdc 6c6bacf
[IMP]:Multiple discounts
Visakhdc c9157c1
Merge pull request #72 from ohcnetwork/visakh_account_discount
Visakhdc ba684e7
[IMP]:Out Invoice multiple discounts
Visakhdc 79d88be
Merge pull request #73 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 09cf744
[FIX]:Remove print and comments
Visakhdc 200b06c
Merge pull request #74 from ohcnetwork/visakh_account_discount
Visakhdc 9f808f5
[IMP]:Bank reconciliation for ssmm
Visakhdc 2c27ae7
Merge pull request #75 from ohcnetwork/visakh_ssmm_bank_reconciliation
Visakhdc d1176a4
[ADD]:accounting_customisation
Visakhdc 141b794
Merge pull request #76 from ohcnetwork/visakh_accounting_customisation
Visakhdc 5ea30ca
[ADD]:insurance_management
Visakhdc d8a0115
Merge pull request #77 from ohcnetwork/visakh_insurance_management
Visakhdc e77441f
[ADD]:product_category_customisation
Visakhdc 73f9f91
Merge pull request #78 from ohcnetwork/visakh_product_category_custom…
Visakhdc 5f9c7fb
[IMP]:commission status based on the payment status
Visakhdc 5d53dbf
Merge pull request #79 from ohcnetwork/visakh_account_move_line_commi…
Visakhdc bf172b1
Fix user update
amjithtitus09 75a213b
[IMP]:Updating partner details in user endpoint
Visakhdc 07c5fe4
Merge branch 'main' into visakh_care_connector_improvement
Visakhdc edba11d
Merge pull request #80 from ohcnetwork/visakh_care_connector_improvement
Visakhdc da8db1f
x_care_id in user model
amjithtitus09 52ccc05
Merge branch 'main' of https://github.com/Visakhdc/OHC
amjithtitus09 4a911a5
Discount amount fix
amjithtitus09 8de22cc
[IMP]:Api for chart of accounts
Visakhdc a79a93f
Merge remote-tracking branch 'origin/visakh_care_connector_improvemen…
Visakhdc a5e683b
Merge pull request #81 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 8366b7f
[ADD]:Api oca_adjust_label
Visakhdc 83f1ecd
Merge pull request #82 from ohcnetwork/visakh_oca_adjust_label
Visakhdc 804c9a6
[ADD]:payment_voucher
Visakhdc a5babba
Merge pull request #83 from ohcnetwork/visakh_payment_voucherl
Visakhdc f89f477
[IMP]:Drug license Number field
Visakhdc a59cd8c
Merge pull request #84 from ohcnetwork/visakh_grn_number_in_vendor_bill
Visakhdc 788680d
[ADD]:customer_balance
Visakhdc d5429ef
Merge pull request #85 from ohcnetwork/visakh_customer_balance
Visakhdc 1c0d610
[IMP]:Added new fields for report
Visakhdc 63b093c
Merge pull request #86 from ohcnetwork/visakh_insurance_management
Visakhdc f8cb795
[ADD]:account_insurance_voucher report
Visakhdc 4e5f48a
Merge pull request #87 from ohcnetwork/visakh_account_insurance_voucher
Visakhdc a128034
[FIX]: subcategory boolean field name
Visakhdc cd62b7d
Merge pull request #88 from ohcnetwork/visakh_product_category_custom…
Visakhdc 99357d3
[IMP]: Cancel invoice endpoint
Visakhdc 6132c0d
Merge pull request #89 from ohcnetwork/visakh_care_connector_improvement
Visakhdc a581e55
[IMP]: Drug license number in partner
Visakhdc e929e2d
Merge pull request #90 from ohcnetwork/visakh_grn_number_in_vendor_bill
Visakhdc e40c5f8
[FIX]: Add license number in vendor bill
Visakhdc 56eab7c
Merge pull request #91 from ohcnetwork/visakh_grn_number_in_vendor_bill
Visakhdc e4c6828
[IMP]: Drug license number in res partner
Visakhdc d391a4d
Merge pull request #92 from ohcnetwork/visakh_grn_number_in_vendor_bill
Visakhdc 5e24211
[IMP]:Invoice cancel and unreconcile
Visakhdc ae318c9
Merge branch 'main' into visakh_care_connector_improvement
Visakhdc fdbb964
Merge pull request #93 from ohcnetwork/visakh_care_connector_improvement
Visakhdc 6ac9897
[FIX]:Change dollar symbol to ruppee
Visakhdc 678594e
Merge pull request #94 from ohcnetwork/visakh_ssmm_bank_reconciliation
Visakhdc 5de33bd
[IMP]:Added validation for invoice lines
Visakhdc 0fe39c9
Merge pull request #95 from ohcnetwork/visakh_insurance_management
Visakhdc 9a78789
[FIX]:admission typo fix
Visakhdc 91f1a7b
Merge pull request #96 from ohcnetwork/visakh_account_insurance_voucher
Visakhdc 52f944e
[FIX]:commission line status fix
Visakhdc 458754f
Merge pull request #97 from ohcnetwork/visakh_account_move_line_commi…
Visakhdc 5d62967
[FIX]:cash denomination payment flow fix
Visakhdc 7c5860c
Merge pull request #98 from ohcnetwork/visakh_cash_denomination
Visakhdc ee6f785
[FIX]:removed cancelled payments
Visakhdc dd2f4ed
Merge pull request #99 from ohcnetwork/visakh_cash_denomination
Visakhdc 0a4a769
[IMP]:Changed COA to payment methods
Visakhdc 5f78e5f
Merge remote-tracking branch 'origin/visakh_care_connector_improvemen…
Visakhdc 4e5b12f
Merge pull request #100 from ohcnetwork/visakh_care_connector_improve…
Visakhdc a5c1494
[IMP]:validation for insurance lines
Visakhdc db580a4
Merge pull request #101 from ohcnetwork/visakh_account_insurance_voucher
Visakhdc 2e9b775
[FIX]:add dependency insurance_management
Visakhdc 0fa99d2
Merge pull request #102 from ohcnetwork/visakh_care_connector_improve…
Visakhdc ebd957b
[FIX]:add dependency insurance_management in account insurance voucher
Visakhdc 8e461b5
Merge pull request #103 from ohcnetwork/visakh_account_insurance_voucher
Visakhdc 27e5fa0
[FIX]:add dependency insurance_management in account discount
Visakhdc 72b5ac7
Merge pull request #104 from ohcnetwork/visakh_account_discount
Visakhdc 4e45ccb
[FIX]:remove discounts and subtotal calculation
Visakhdc 1f110d8
Merge pull request #105 from ohcnetwork/visakh_insurance_management
Visakhdc 3bbd9de
[FIX]: Missing payments, removed transfer selection duplication
Visakhdc 93c115f
Merge pull request #106 from ohcnetwork/visakh_cash_denomination
Visakhdc b3ff52f
[FIX]:Removed insurance_management dependency
Visakhdc ca4dcec
Merge pull request #107 from ohcnetwork/visakh_care_connector_improve…
Visakhdc a44acf4
[IMP]:Fetching payment methods by id or name, added payment method an…
Visakhdc ce62382
Merge pull request #108 from ohcnetwork/visakh_care_connector_improve…
Visakhdc 46a33d9
[IMP]:insurance tag type changed to list
Visakhdc 4843729
Merge pull request #109 from ohcnetwork/visakh_care_connector_improve…
Visakhdc 0ab5aba
[IMP]:Added ssmm_id, created_by fields in invoice
Visakhdc e95b699
Merge pull request #110 from ohcnetwork/visakh_care_connector_improve…
Visakhdc 50a3412
[FIX]:payment method issue fix
Visakhdc 815c061
Merge pull request #111 from ohcnetwork/visakh_care_connector_improve…
Visakhdc ab7bef7
[FIX]:payment denomination boolean field
Visakhdc c48fc1d
Merge pull request #112 from ohcnetwork/visakh_cash_denomination
Visakhdc 9ccc27e
[IMP]:pending amount in list view
Visakhdc 15d6672
Merge pull request #113 from ohcnetwork/visakh_cash_denomination
Visakhdc 90f4813
[IMP]:Changed cash transfer accept
Visakhdc d295ef6
Merge pull request #115 from ohcnetwork/visakh_cash_denomination
Visakhdc a487af4
[IMP]:User archive
Visakhdc da029c6
Merge pull request #116 from ohcnetwork/visakh_care_connector_improve…
Visakhdc 3edc04a
Initial plan
Copilot 0fbc3f4
Rename 'SSMM ID' to 'Identifier' in Invoice model
Copilot 809047d
Rename field from ssmm_id to x_identifier for generic usage
Copilot d416c11
Merge pull request #119 from ohcnetwork/copilot/rename-ssmm-id-to-ide…
bodhish d3947af
Clean up odoo imports
bodhish 9c86972
Add support for free qty
bodhish 8f5a624
Rename 'free_qty' to 'free_quantity' in AccountMoveLines and AccountU…
bodhish eabfcf7
Use free_qty infavour of other odoo plugs
bodhish 96f0d7e
Use free_qty infavour of other odoo plugs again
bodhish c7f167d
Add support for payment reference and created_by
bodhish 4342df1
Add journal for card
bodhish 49e1b91
Add support to log bank reference
bodhish 9f0f6fe
Try a new format for trail balance
bodhish 3a5853c
Add code to trial balance report
bodhish ff9a096
Add logic for tax based ledgers
bodhish 42e07d2
Add gst level hsn reports
bodhish 3e50ebf
Split balance in journal to cr dr
bodhish 979cb5f
Revert "Add gst level hsn reports"
bodhish b108702
Merge branch 'main' of github.com:ohcnetwork/odoo_connector
bodhish 4c5fda1
Clean up journal ledger
bodhish 4eeb009
Backlinking for Invoices
gigincg 21e360b
Insurance tag auto load and read only
amjithtitus09 e7d8b77
[IMP]:Added a new button for submit the denomination
Visakhdc 0d49801
Merge pull request #122 from ohcnetwork/visakh_cash_denomination
Visakhdc a968827
[IMP]:Counter name update
Visakhdc 8b3dcda
Merge pull request #123 from ohcnetwork/care_connector_counter_name_u…
Visakhdc ab46bc7
Add hsn report
bodhish ba732e2
Improve trial balance report
bodhish 93cafcb
Fix issues in tds vendor report
bodhish 080ca3d
Generate GRN only on invoices from care
bodhish d30bf45
Update sequence
bodhish 3e23a92
[IMP]:cash_denomination:added cashier for counter transfer
Visakhdc 9908c81
Merge pull request #125 from ohcnetwork/visakh_cash_denomination_impr…
Visakhdc 6f8b981
Fix payment voucher
bodhish 3c5c217
Merge pull request #124 from ohcnetwork/bodhi/grn
bodhish 51ca1a4
Fix payment voucher print
bodhish c9804fb
[IMP]:cash_denomination:pending amount handling
Visakhdc f8e1df8
Merge pull request #126 from ohcnetwork/visakh_cash_denomination_impr…
Visakhdc acf5d1c
[IMP]:cash_denomination:option for delete the counter activities
Visakhdc 8e8eefc
Merge pull request #128 from ohcnetwork/visakh_cash_denomination_impr…
Visakhdc 082afe5
[IMP]:care_connector:Add end point for employee creation
Visakhdc 455811a
Merge pull request #131 from ohcnetwork/visakh_care_connector_updates
Visakhdc 76e238b
[FIX]:care_connector:Removed employee details model from security
Visakhdc 9f06c15
Merge pull request #132 from ohcnetwork/visakh_care_connector_updates
Visakhdc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Python cache files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # Distribution / packaging | ||
| *.egg-info/ | ||
| dist/ | ||
| build/ | ||
|
|
||
| # Virtual environments | ||
| venv/ | ||
| env/ | ||
| ENV/ | ||
|
|
||
| # IDE files | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS files | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Odoo specific | ||
| *.pyc | ||
| *.pyo | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models,wizard |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "Account Discounts", | ||
| "summary": "This module defines and manages predefined discounts used in bills", | ||
| "version": "0.0.1", | ||
| "category": "Accounting", | ||
| "installable": True, | ||
| "depends": ["base","account","web","insurance_management"], | ||
| "data": [ | ||
| "security/ir.model.access.csv", | ||
| "views/account_move_views.xml", | ||
| "views/discount_groups_views.xml", | ||
| "views/product_template_views.xml", | ||
| "wizard/discount_category_report_wizard.xml", | ||
| ], | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import account_move,discount_groups, product_template |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| 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 | ||
| ) | ||
|
|
||
| @api.depends("invoice_line_ids.account_discount") | ||
| 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", | ||
| }, | ||
| ) | ||
| ) | ||
| 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)] | ||
| ) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from odoo import models, fields, api | ||
|
|
||
| class AccountDiscountGroups(models.Model): | ||
| _name = 'account.discount.groups' | ||
| _description = 'Discount Groups' | ||
|
|
||
| name = fields.Char(string="Group Name", required=True) | ||
| x_care_id = fields.Char(string="Care ID", readonly=True) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from odoo import models, fields | ||
|
|
||
| class ProductTemplate(models.Model): | ||
| _inherit = "product.template" | ||
|
|
||
| is_disc_item = fields.Boolean(string="Discount Item") | ||
| discount_group = fields.Many2one('account.discount.groups', string="Discount Group", ondelete='cascade') | ||
| disc_amount = fields.Float(string="Discount Amount") | ||
| disc_percent = fields.Float(string="Discount Percentage") |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +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 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <odoo> | ||
| <record id="view_move_discount_form" model="ir.ui.view"> | ||
| <field name="name">account.move.form.care.discount</field> | ||
| <field name="model">account.move</field> | ||
| <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> | ||
| <field name="tax_totals" position="after"> | ||
| <field name="discount_list" options="{'line_breaks': True}" widget="text" nolabel="1" readonly="1"/> | ||
| </field> | ||
| </field> | ||
| </record> | ||
| </odoo> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| <odoo> | ||
| <record id="view_account_discount_groups_list" model="ir.ui.view"> | ||
| <field name="name">account.discount.groups.list</field> | ||
| <field name="model">account.discount.groups</field> | ||
| <field name="arch" type="xml"> | ||
| <list string="Discount Groups"> | ||
| <field name="name"/> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="view_account_discount_groups_form" model="ir.ui.view"> | ||
| <field name="name">account.discount.groups.form</field> | ||
| <field name="model">account.discount.groups</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="Discount Groups"> | ||
| <sheet> | ||
| <group> | ||
| <group> | ||
| <field name="name"/> | ||
| <field name="x_care_id"/> | ||
| </group> | ||
| </group> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="action_account_discount_groups" model="ir.actions.act_window"> | ||
| <field name="name">Discount Groups</field> | ||
| <field name="res_model">account.discount.groups</field> | ||
| <field name="view_mode">list,form</field> | ||
| </record> | ||
|
|
||
| <menuitem id="menu_account_discount_heading" | ||
| name="Discount Groups" | ||
| parent="account.menu_finance_configuration" | ||
| sequence="30"/> | ||
|
|
||
| <menuitem id="menu_account_discount_groups" | ||
| name="Discount Categories" | ||
| parent="menu_account_discount_heading" | ||
| sequence="20" | ||
| action="action_account_discount_groups"/> | ||
| </odoo> | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <?xml version="1.0"?> | ||
| <odoo> | ||
| <record id="care_product_template_only_form_view_inherit" model="ir.ui.view"> | ||
| <field name="name">product.template.form.view.inherit.care</field> | ||
| <field name="model">product.template</field> | ||
| <field name="inherit_id" ref="product.product_template_only_form_view"></field> | ||
| <field name="arch" type="xml"> | ||
| <label for="sale_ok" position="after"> | ||
| <div> | ||
| <field name="is_disc_item" /> | ||
| <label for="is_disc_item" /> | ||
| </div> | ||
| </label> | ||
| <xpath expr="//field[@name='default_code']" position="after"> | ||
| <field name="discount_group" invisible="is_disc_item != True"/> | ||
| <field name="disc_amount" invisible="is_disc_item != True"/> | ||
| <field name="disc_percent" invisible="is_disc_item != True"/> | ||
| </xpath> | ||
| </field> | ||
| </record> | ||
| </odoo> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import discount_category_report_wizard |
87 changes: 87 additions & 0 deletions
87
account_discounts/wizard/discount_category_report_wizard.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
|
|
||
| from odoo import models, fields | ||
| from odoo.exceptions import UserError | ||
| from datetime import date | ||
| import io | ||
| import base64 | ||
| import xlsxwriter | ||
|
|
||
| class DiscountCategWizard(models.TransientModel): | ||
| _name = 'discount.categ.wizard' | ||
| _description = 'Discount Category Wizard' | ||
|
|
||
| date_from = fields.Date(string="Date From", required=True, default=lambda self: date.today().replace(day=1)) | ||
| date_to = fields.Date(string="Date To", required=True, default=lambda self: date.today()) | ||
|
|
||
| def action_disc_export_excel(self): | ||
| if self.date_from > self.date_to: | ||
| raise UserError("Start date cannot be after end date!") | ||
|
|
||
| output = io.BytesIO() | ||
| workbook = xlsxwriter.Workbook(output, {'in_memory': True}) | ||
| sheet = workbook.add_worksheet("Discount Report") | ||
|
|
||
| title_format = workbook.add_format({'bold': True, 'font_size': 14, 'align': 'center', 'bg_color': '#B6D7A8'}) | ||
| header_format = workbook.add_format({'bold': True, 'bg_color': '#D9EAD3', 'border': 1, 'align': 'center'}) | ||
| text_format = workbook.add_format({'border': 1, 'align': 'left'}) | ||
| number_format = workbook.add_format({'border': 1, 'align': 'right', 'num_format': '$ #,##0.00'}) | ||
|
|
||
| sheet.merge_range('A1:H1', 'Discount Category Wise Report', title_format) | ||
| sheet.write('A2', f"From: {self.date_from}", workbook.add_format({'bold': True})) | ||
| sheet.write('B2', f"To: {self.date_to}", workbook.add_format({'bold': True})) | ||
|
|
||
| move_line_domain = [ | ||
| ('date', '>=', self.date_from), | ||
| ('date', '<=', self.date_to), | ||
| ('product_id.is_disc_item', '=', True) | ||
| ] | ||
| move_line_domain_rec = self.env['account.move.line'] | ||
|
|
||
| move_lines = move_line_domain_rec.search(move_line_domain, order="date asc, id asc") | ||
|
|
||
| if not move_lines: | ||
| raise UserError("No transactions found for the selected period.") | ||
|
|
||
| disc_summary = {} | ||
| for line in move_lines: | ||
| product_disc = line.product_id.discount_group | ||
| if product_disc.id not in disc_summary: | ||
| disc_summary[product_disc.id] = { | ||
| 'discount_name': product_disc.name, | ||
| 'total_discount': 0, | ||
| } | ||
|
|
||
| disc_summary[product_disc.id]['total_discount'] += line.price_unit | ||
|
|
||
| row = 4 | ||
| sheet.write_row(row, 0, ["Discount", "Total Discount"], header_format) | ||
| row += 1 | ||
|
|
||
| # Write Data | ||
| for product_id, data in disc_summary.items(): | ||
| sheet.write(row, 0, data['discount_name'], text_format) | ||
| sheet.write(row, 1, data['total_discount'], number_format) | ||
| row += 1 | ||
| # | ||
|
|
||
| workbook.close() | ||
|
|
||
| file_data = base64.b64encode(output.getvalue()) | ||
| output.close() | ||
|
|
||
| file_name = f"Discount_Report_{self.date_from}_to_{self.date_to}.xlsx" | ||
|
|
||
| export_id = self.env['ir.attachment'].create({ | ||
| 'name': file_name, | ||
| 'type': 'binary', | ||
| 'datas': file_data, | ||
| 'res_model': 'discount.categ.wizard', | ||
| 'res_id': self.id, | ||
| 'mimetype': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', | ||
| }) | ||
|
|
||
| return { | ||
| 'type': 'ir.actions.act_url', | ||
| 'url': f"/web/content/{export_id.id}?download=true", | ||
| 'target': 'new', | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
based on ohcnetwork/care#3380
using round might produce different results
cc: @gigincg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If needed please change other instances of such usages