Skip to content

Commit 42aac51

Browse files
chinzourbuisson
authored andcommitted
C2C-130: Add 'rounding' domain (#52)
1 parent 7df2bfe commit 42aac51

File tree

5 files changed

+27
-0
lines changed

5 files changed

+27
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ See below the list of supported models:
3838
- [Tax (CSV)](./readme/tax.md)
3939
- [Warehouse (CSV)](./readme/warehouse.md)
4040
- [Bill of material (CSV)](./readme/bom.md)
41+
- [Cash Rounding(CSV)](./readme/cash_rounding.md)
4142
- [Language (XML)](./readme/language.md)
4243
- [NEW: Additional models can now be added via configuration file!](###-support-additional-models-through-configuration-file)
4344

odoo_initializer/activator.py

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from .models.tax_loader import TaxLoader
3030
from .models.warehouse_loader import WarehouseLoader
3131
from .models.bom_loader import BomLoader
32+
from .models.cash_rounding import CashRoundingLoader
3233

3334
_logger = logging.getLogger(__name__)
3435

@@ -63,6 +64,7 @@ def start_init(cr):
6364
TaxLoader,
6465
WarehouseLoader,
6566
BomLoader,
67+
CashRoundingLoader,
6668
LanguageLoader,
6769
]
6870

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import logging
2+
3+
from .base_loader import BaseLoader
4+
5+
_logger = logging.getLogger(__name__)
6+
7+
8+
class CashRoundingLoader(BaseLoader):
9+
model_name = "account.cash.rounding"
10+
folder = "rounding"
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"id","name","rounding","rounding_method","profit_account_id/id","strategy"
2+
"init.account_cash_rounding_1","CSH","5.0","UP","init.account_account_37","Add a rounding line"

readme/cash_rounding.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Model `cash_rounding`
2+
3+
The `rounding` subfolder allows to import cash rounding rules provided as CSV files. See the example below:
4+
5+
| id | name | rounding | strategy |
6+
| - | - | - | - |
7+
| init.cash_rounding_1 | CSH | 5 | Add a rounding line | Add a rounding line
8+
9+
10+
See the test resources for further examples:
11+
- [odoo_csv/rounding/account.cash.rounding.csv](../odoo_initializer/tests/resources/odoo_csv/rounding/account.cash.rounding.csv)

0 commit comments

Comments
 (0)