Browse Source

Mar 8 : [IMP] Anglo saxon accounting feature added 'base_accounting_kit'

pull/249/head
AjmalCybro 2 years ago
parent
commit
b4f63aa844
  1. 4
      base_accounting_kit/__manifest__.py
  2. 5
      base_accounting_kit/doc/RELEASE_NOTES.md
  3. 15
      base_accounting_kit/models/account_asset.py
  4. 18
      base_accounting_kit/models/account_payment.py
  5. 3
      base_accounting_kit/models/res_config_settings.py
  6. 59
      base_accounting_kit/static/description/index.html
  7. 1
      base_accounting_kit/views/account_asset_views.xml
  8. 4
      base_accounting_kit/views/account_payment_view.xml
  9. 14
      base_accounting_kit/views/res_config_view.xml

4
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',

5
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

15
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 = []

18
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"

3
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()

59
base_accounting_kit/static/description/index.html

@ -1,6 +1,7 @@
<div class="container">
<div class="row mb-5">
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between" style="border-bottom:1px solid #d5d5d5">
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between"
style="border-bottom:1px solid #d5d5d5">
<div class="my-3">
<img src="//apps.odoocdn.com/apps/assets/15.0/pos_credit_limit/assets/icons/logo.png?d119cb9"
style="width:auto !important; height:40px !important">
@ -17,9 +18,33 @@
<h1 style="font-weight: bold; color: #3D3D4E; font-size: 64px;">Full Accounting Kit V16</h1>
<p style="font-weight: bold; color: #777783; font-size: 24px;">A full-fledged accounting kit for every
organization.</p>
<img src="/hero.png" alt="Full Accounting Kit for Odoo 16" style="width: 100%; height: auto; margin-top: -80px;" />
<img src="/hero.png" alt="Full Accounting Kit for Odoo 16"
style="width: 100%; height: auto; margin-top: -80px;"/>
</div>
<!-- START OF LATEST UPDATES -->
<div class="row" style="margin-top: 2rem;">
<div class="col-lg-12">
<div class="d-flex align-itmes-center" style=" border-bottom: 2px solid #0a1e2c; padding-bottom: 5px;">
<img class="mr-1" src="./images/icons/update.png" style="height: 28px; width: auto;">
<h5 class="font-weight-bold "
style="font-size: 0.9375rem; font-family: Montserrat,'sans-serif'; color: #0a1e2c; margin-top: 0.3rem">
Latest Updates</h5>
</div>
</div>
<div class="col-lg-6">
<div class="mt-3">
<ul style="list-style: none !important; padding-left: 0;">
<li class="deep-1 font-weight-bold"
style="font-family: Montserrat, 'sans-serif'; font-size: 0.9125rem; background-color: #fff; padding: 0.5rem 1rem; border-radius: 5px; color: #102e42; list-style: none !important;">
<i class="fa fa-files-o mr-2"></i>Anglo Saxon Accounting Feature
</li>
</ul>
</div>
</div>
</div>
<!-- END OF UPDATES -->
<div class="row my-5">
<div class="col-sm-12 col-md-12-col-lg-2">
<h2 style="font-weight: bold; color: #3D3D4E;">Features</h2>
@ -386,21 +411,24 @@
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/whatsapp_redirect/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/1.png">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/1.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/hr_payroll_community/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/2.png">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/2.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/crm_dashboard/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/3.png">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/3.png">
</div>
</a>
</div>
@ -409,21 +437,24 @@
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/export_stockinfo_xls/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/4.png">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/4.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/sale_discount_total/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/5.png">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/5.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/fleet_rental/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/6.png">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/6.png">
</div>
</a>
</div>
@ -431,9 +462,11 @@
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev" style="width:35px; color:#000"> <span
class="carousel-control-prev-icon"><i class="fa fa-chevron-left" style="font-size:24px"></i></span>
class="carousel-control-prev-icon"><i class="fa fa-chevron-left"
style="font-size:24px"></i></span>
</a> <a class="carousel-control-next" href="#demo1" data-slide="next" style="width:35px; color:#000">
<span class="carousel-control-next-icon"><i class="fa fa-chevron-right" style="font-size:24px"></i></span>
<span class="carousel-control-next-icon"><i class="fa fa-chevron-right"
style="font-size:24px"></i></span>
</a>
</div>
</div>
@ -602,7 +635,8 @@
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/manufacturing-black.png" class="img-responsive mb-3" height="48px" width="48px">
<img src="./assets/icons/manufacturing-black.png" class="img-responsive mb-3" height="48px"
width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Manufacturing
</h5>
@ -716,7 +750,8 @@
</div>
<div class="row">
<div class="col-sm-12 my-5 d-flex justify-content-center align-items-center">
<img src="/assets/misc/logo.png" width="144" height="31" style="width:144px; height: 31px; margin-top: 40px;" />
<img src="/assets/misc/logo.png" width="144" height="31"
style="width:144px; height: 31px; margin-top: 40px;"/>
</div>
</div>
</div>

1
base_accounting_kit/views/account_asset_views.xml

@ -22,6 +22,7 @@
<group>
<field name="type" invisible="1"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field name="price"/>
</group>
<group string="Journal Entries">
<field name="journal_id"/>

4
base_accounting_kit/views/account_payment_view.xml

@ -5,6 +5,10 @@
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="after">
<widget name="web_ribbon" title="Sent"
attrs="{'invisible': [('is_move_sent', '!=', True)]}"/>
</xpath>
<xpath expr="//button[@name='action_post']" position="before">
<button name="print_checks" class="oe_highlight"
attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('state', '!=', 'posted')]}"

14
base_accounting_kit/views/res_config_view.xml

@ -23,6 +23,20 @@
<!-- Remove the enterprise budget option -->
<xpath expr="//div[@id='account_budget']" position="replace"/>
<xpath expr="//div[@id='bank_cash']" position="inside">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="use_anglo_saxon_accounting"/>
</div>
<div class="o_setting_right_pane">
<label for="use_anglo_saxon_accounting"/>
<div class="text-muted">
It will record the cost of good sold.
</div>
</div>
</div>
</xpath>
</field>
</record>
</data>

Loading…
Cancel
Save