diff --git a/base_accounting_kit/__manifest__.py b/base_accounting_kit/__manifest__.py index 3c71ee406..9281c3b3b 100644 --- a/base_accounting_kit/__manifest__.py +++ b/base_accounting_kit/__manifest__.py @@ -22,7 +22,7 @@ { 'name': 'Odoo 16 Full Accounting Kit', - 'version': '16.0.1.0.0', + 'version': '16.0.2.0.0', 'category': 'Accounting', 'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs', 'summary': """ Asset and Budget Management, @@ -50,7 +50,7 @@ 'website': "https://www.cybrosys.com", 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', - 'depends': ['base', 'account', 'sale', 'account_check_printing', 'base_account_budget','analytic','website'], + 'depends': ['base', 'account', 'sale', 'account_check_printing', 'base_account_budget','analytic'], 'data': [ 'security/ir.model.access.csv', 'security/security.xml', diff --git a/base_accounting_kit/doc/RELEASE_NOTES.md b/base_accounting_kit/doc/RELEASE_NOTES.md index a4d535349..4cf413e04 100644 --- a/base_accounting_kit/doc/RELEASE_NOTES.md +++ b/base_accounting_kit/doc/RELEASE_NOTES.md @@ -4,3 +4,8 @@ #### Version 16.0.1.0.0 #### ADD - Initial commit for Odoo 16 accounting + +#### 08.03.2023 +#### Version 16.0.2.0.0 +#### IMP +- Added Anglo Saxon Accounting Feature diff --git a/base_accounting_kit/models/account_asset.py b/base_accounting_kit/models/account_asset.py index ff754c250..57ee8fba8 100644 --- a/base_accounting_kit/models/account_asset.py +++ b/base_accounting_kit/models/account_asset.py @@ -26,6 +26,7 @@ from datetime import date, datetime from dateutil.relativedelta import relativedelta from odoo import api, fields, models, _ +from odoo.addons.base.models.decimal_precision import dp from odoo.exceptions import UserError, ValidationError from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DF from odoo.tools import float_compare, float_is_zero @@ -39,6 +40,12 @@ class AccountAssetCategory(models.Model): name = fields.Char(required=True, index=True, string="Asset Type") company_id = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.company) + price=fields.Monetary(string='Price',required=True) + currency_id=fields.Many2one("res.currency", + default=lambda self: self.env + ['res.currency'].search([ + ('name', '=', 'USD')]).id, + readonly=True, hide=True) account_analytic_id = fields.Many2one('account.analytic.account', string='Analytic Account',domain="[('company_id', '=', company_id)]") account_asset_id = fields.Many2one('account.account', @@ -240,7 +247,9 @@ class AccountAssetAsset(models.Model): # @api.model # def _cron_generate_entries(self): # self.compute_generated_entries(datetime.today()) - + @api.onchange('category_id') + def gross_value(self): + self.value=self.category_id.price @api.model def compute_generated_entries(self, date, asset_type=None): # Entries generated : one by grouped category and one by asset from ungrouped category @@ -408,7 +417,7 @@ class AccountAssetAsset(models.Model): 'asset_id': self.id, 'sequence': sequence, 'name': (self.code or '') + '/' + str(sequence), - 'remaining_value': residual_amount, + 'remaining_value': residual_amount if residual_amount>=0 else 0.0, 'depreciated_value': self.value - ( self.salvage_value + residual_amount), 'depreciation_date': depreciation_date.strftime(DF), @@ -451,6 +460,8 @@ class AccountAssetAsset(models.Model): fields)) asset.message_post(subject=_('Asset created'), tracking_value_ids=tracking_value_ids) + self.set_to_close() + def _get_disposal_moves(self): move_ids = [] diff --git a/base_accounting_kit/models/account_payment.py b/base_accounting_kit/models/account_payment.py index 311a69cca..668ab24e5 100644 --- a/base_accounting_kit/models/account_payment.py +++ b/base_accounting_kit/models/account_payment.py @@ -53,6 +53,7 @@ class AccountRegisterPayments(models.TransientModel): return res + class AccountPayment(models.Model): _inherit = "account.payment" @@ -90,26 +91,26 @@ class AccountPayment(models.Model): sent and call print_checks() """ # Since this method can be called via a client_action_multi, we # need to make sure the received records are what we expect - self = self.filtered(lambda r: + selfs = self.filtered(lambda r: r.payment_method_id.code in ['check_printing', 'pdc'] and r.state != 'reconciled') - if len(self) == 0: + if len(selfs) == 0: raise UserError(_( "Payments to print as a checks must have 'Check' " "or 'PDC' selected as payment method and " "not have already been reconciled")) - if any(payment.journal_id != self[0].journal_id for payment in self): + if any(payment.journal_id != selfs[0].journal_id for payment in selfs): raise UserError(_( "In order to print multiple checks at once, they " "must belong to the same bank journal.")) - if not self[0].journal_id.check_manual_sequencing: + if not selfs[0].journal_id.check_manual_sequencing: # The wizard asks for the number printed on the first # pre-printed check so payments are attributed the # number of the check the'll be printed on. - last_printed_check = self.search([ - ('journal_id', '=', self[0].journal_id.id), + last_printed_check = selfs.search([ + ('journal_id', '=', selfs[0].journal_id.id), ('check_number', '!=', "0")], order="check_number desc", limit=1) next_check_number = last_printed_check and int( @@ -145,6 +146,11 @@ class AccountPayment(models.Model): line[2]['date_maturity'] = self.effective_date return res + def mark_as_sent(self): + self.write({'is_move_sent': True}) + + def unmark_as_sent(self): + self.write({'is_move_sent': False}) class AccountPaymentMethod(models.Model): _inherit = "account.payment.method" @@ -153,4 +159,4 @@ class AccountPaymentMethod(models.Model): def _get_payment_method_information(self): res = super()._get_payment_method_information() res['pdc'] = {'mode': 'multi', 'domain': [('type', '=', 'bank')]} - return res \ No newline at end of file + return res diff --git a/base_accounting_kit/models/res_config_settings.py b/base_accounting_kit/models/res_config_settings.py index 3afc74767..1d37065e2 100644 --- a/base_accounting_kit/models/res_config_settings.py +++ b/base_accounting_kit/models/res_config_settings.py @@ -28,6 +28,9 @@ class ResConfigSettings(models.TransientModel): customer_credit_limit = fields.Boolean(string="Customer Credit Limit") + use_anglo_saxon_accounting = fields.Boolean(string="Use Anglo-Saxon accounting", readonly=False, + related='company_id.anglo_saxon_accounting') + @api.model def get_values(self): res = super(ResConfigSettings, self).get_values() diff --git a/base_accounting_kit/static/description/index.html b/base_accounting_kit/static/description/index.html index 8d4379b09..216f29e72 100644 --- a/base_accounting_kit/static/description/index.html +++ b/base_accounting_kit/static/description/index.html @@ -1,724 +1,759 @@
A full-fledged accounting kit for every - organization.
-Packed with all the features. Tailored for Odoo 16.
-A full-fledged accounting kit for every + organization.
+Packed with all the features. Tailored for Odoo 16.
+Multiple report types are supported.
+Multiple report types are supported.
-View all the screenshots for the module.
+View all the screenshots for the module.
-Explore our related modules
+Explore our related modules
-