Skip to content

Commit

Permalink
[UPD] ssi_general_audit
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Jul 20, 2024
1 parent 23349e6 commit 98383dd
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 29 deletions.
9 changes: 6 additions & 3 deletions ssi_general_audit/models/client_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ class ClientAccount(models.Model):
required=False,
ondelete="restrict",
)
group_id = fields.Many2one(
string="Account Group",
related="type_id.group_id",
store=True,
)
normal_balance = fields.Selection(
string="Normal Balance",
related="type_id.normal_balance",
stored=True,
required=False,
store=True,
)

@api.onchange(
Expand Down
4 changes: 2 additions & 2 deletions ssi_general_audit/models/client_trial_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def _check_debit_credit(self):
def _reload_account(self):
self.ensure_one()
ClientAccount = self.env["client_account"]
Detail = self.env["client_trial_balance_detail"]
Detail = self.env["client_trial_balance.detail"]
criteria = [
("partner_id", "=", self.partner_id.id),
]
Expand Down Expand Up @@ -469,7 +469,7 @@ def _get_account_type_dict(self):
"account_type": {},
"account_group": {},
}
StandardDetail = self.env["client_trial_balance_standard_detail"]
StandardDetail = self.env["client_trial_balance.standard_detail"]
criteria = [
("trial_balance_id", "=", self.id),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ClientTrialBalanceStandardDetail(models.Model):
"trial_balance_id.detail_ids.credit",
)
def _compute_balance(self):
obj_detail = self.env["client_trial_balance_detail"]
obj_detail = self.env["client_trial_balance.detail"]
for document in self:
balance = opening_balance = debit = credit = 0.0
criteria = [
Expand Down
24 changes: 18 additions & 6 deletions ssi_general_audit/views/client_account_mapping_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,24 @@

</xpath>
<xpath expr="//group[@name='header_right']" position="inside">
<field name="date_start" />
<field name="date_end" />
<field name="previous_date_start" />
<field name="previous_date_end" />
<field name="interim_date_start" />
<field name="interim_date_end" />
<label for="date_start" string="Audit Period" />
<div class="o_row">
<field name="date_start" class="oe_inline" />
<span class="oe_inline">To</span>
<field name="date_end" class="oe_inline" />
</div>
<label for="previous_date_start" string="Previous Audit Period" />
<div class="o_row">
<field name="previous_date_start" class="oe_inline" />
<span class="oe_inline">To</span>
<field name="previous_date_end" class="oe_inline" />
</div>
<label for="interim_date_start" string="Interim Audit Period" />
<div class="o_row">
<field name="interim_date_start" class="oe_inline" />
<span class="oe_inline">To</span>
<field name="interim_date_end" class="oe_inline" />
</div>
</xpath>
<xpath expr="//page[@name='note']" position="before">
<page name="mapping" string="Account Mappings">
Expand Down
33 changes: 32 additions & 1 deletion ssi_general_audit/views/client_account_type_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,34 @@
/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<data />
<data>
<xpath expr="//field[@name='code']" position="after">
<field name="group_id" />
<field name="normal_balance" />
<filter
name="dom_debit"
string="Debit"
domain="[('normal_balance','=','dr')]"
/>
<filter
name="dom_credit"
string="Credit"
domain="[('normal_balance','=','cr')]"
/>
<group name="group_main">
<filter
name="grp_group_id"
string="Account Group"
context="{'group_by':'group_id'}"
/>
<filter
name="grp_normal_balance"
string="Normal Balance"
context="{'group_by':'normal_balance'}"
/>
</group>
</xpath>
</data>
</field>
</record>

Expand All @@ -30,6 +57,10 @@
<xpath expr="//field[@name='code']" position="before">
<field name="sequence" widget="handle" />
</xpath>
<xpath expr="//field[@name='name']" position="after">
<field name="group_id" />
<field name="normal_balance" />
</xpath>
</data>
</field>
</record>
Expand Down
48 changes: 47 additions & 1 deletion ssi_general_audit/views/client_account_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,46 @@
/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<data />
<data>
<xpath expr="//field[@name='code']" position="after">
<field name="type_id" />
<field name="group_id" />
<field name="normal_balance" />
<field name="partner_id" />
<filter
name="dom_debit"
string="Debit"
domain="[('normal_balance','=','dr')]"
/>
<filter
name="dom_credit"
string="Credit"
domain="[('normal_balance','=','cr')]"
/>
<group name="group_main">
<filter
name="grp_partner_id"
string="Partner"
context="{'group_by':'partner_id'}"
/>
<filter
name="grp_group_id"
string="Account Group"
context="{'group_by':'group_id'}"
/>
<filter
name="grp_type_id"
string="Account Type"
context="{'group_by':'type_id'}"
/>
<filter
name="grp_normal_balance"
string="Normal Balance"
context="{'group_by':'normal_balance'}"
/>
</group>
</xpath>
</data>
</field>
</record>

Expand All @@ -30,6 +69,12 @@
<xpath expr="//field[@name='code']" position="before">
<field name="sequence" widget="handle" />
</xpath>
<xpath expr="//field[@name='code']" position="after">
<field name="type_id" />
<field name="group_id" />
<field name="normal_balance" />
<field name="partner_id" />
</xpath>
</data>
</field>
</record>
Expand All @@ -48,6 +93,7 @@
<field name="sequence" />
<field name="partner_id" />
<field name="type_id" />
<field name="group_id" />
<field name="normal_balance" />
</xpath>
</data>
Expand Down
24 changes: 18 additions & 6 deletions ssi_general_audit/views/client_trial_balance_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,24 @@

</xpath>
<xpath expr="//group[@name='header_right']" position="inside">
<field name="date_start" />
<field name="date_end" />
<field name="previous_date_start" />
<field name="previous_date_end" />
<field name="interim_date_start" />
<field name="interim_date_end" />
<label for="date_start" string="Audit Period" />
<div class="o_row">
<field name="date_start" class="oe_inline" />
<span class="oe_inline">To</span>
<field name="date_end" class="oe_inline" />
</div>
<label for="previous_date_start" string="Previous Audit Period" />
<div class="o_row">
<field name="previous_date_start" class="oe_inline" />
<span class="oe_inline">To</span>
<field name="previous_date_end" class="oe_inline" />
</div>
<label for="interim_date_start" string="Interim Audit Period" />
<div class="o_row">
<field name="interim_date_start" class="oe_inline" />
<span class="oe_inline">To</span>
<field name="interim_date_end" class="oe_inline" />
</div>
</xpath>
<xpath expr="//page[@name='note']" position="before">
<page
Expand Down
28 changes: 20 additions & 8 deletions ssi_general_audit/views/general_audit_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,30 @@
domain="[('parent_id','=',False),('is_company','=',True)]"
widget="many2one_avatar"
/>
<field name="accountant_id" />
<field name="account_type_set_id" />
<field name="financial_accounting_standard_id" />
<field name="currency_id" />
<field name="account_type_set_id" />
<field name="accountant_id" />
</xpath>
<xpath expr="//group[@name='header_right']" position="inside">
<field name="date_start" />
<field name="date_end" />
<field name="previous_date_start" />
<field name="previous_date_end" />
<field name="interim_date_start" />
<field name="interim_date_end" />
<label for="date_start" string="Audit Period" />
<div class="o_row">
<field name="date_start" class="oe_inline" />
<span class="oe_inline">To</span>
<field name="date_end" class="oe_inline" />
</div>
<label for="previous_date_start" string="Previous Audit Period" />
<div class="o_row">
<field name="previous_date_start" class="oe_inline" />
<span class="oe_inline">To</span>
<field name="previous_date_end" class="oe_inline" />
</div>
<label for="interim_date_start" string="Interim Audit Period" />
<div class="o_row">
<field name="interim_date_start" class="oe_inline" />
<span class="oe_inline">To</span>
<field name="interim_date_end" class="oe_inline" />
</div>
</xpath>
<xpath expr="//group[@name='header_center']" position="inside">
<field name="title" />
Expand Down
2 changes: 1 addition & 1 deletion ssi_general_audit/wizards/import_client_account.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<field name="arch" type="xml">
<form>
<group name="main" colspan="2" col="2">
<field name="mapping_id" invisible="0" />
<field name="mapping_id" invisible="1" />
<field name="data" />
</group>
<footer>
Expand Down

0 comments on commit 98383dd

Please sign in to comment.