Skip to content

Commit

Permalink
Request | Refactor. Sale Order and Invoice Scrren Readonly… (#137)
Browse files Browse the repository at this point in the history
* [Karthi] | Request | Refactor. Sale Order and Invoice Scrren Readonly added after Confirm the order

* [Karthi] | Request | Refactor. Sale Order and Invoice Scrren Readonly added after Confirm the order

* [Karthi] | Request | Refactor. Sale Order and Invoice Scrren Readonly added after Confirm the order, Report Changes has been updated.
  • Loading branch information
karthikeyansp91 authored Apr 2, 2024
1 parent eac99c8 commit b6b14d3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bahmni_account/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,5 @@ class AccountPayment(models.Model):

def invoice_search(self):
""" Using ref find the invoice obj """
return self.env['account.move'].search([('name', '=', self.move_id.ref),('move_type', '=', 'out_invoice')], limit=1)
return self.env['account.move'].search([('id', '=', self.reconciled_invoice_ids.id),('move_type', '=', 'out_invoice')], limit=1)

12 changes: 6 additions & 6 deletions bahmni_account/views/account_invoice_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
options="{'currency_field': 'currency_id'}"/>
<field name="amount_tax" widget='monetary'
options="{'currency_field': 'currency_id'}"/>
<field name="discount_type" required="1" attrs="{'invisible': [('amount_untaxed', '=', 0.00)]}"/>
<field name="discount_type" required="1" attrs="{'invisible': [('amount_untaxed', '=', 0.00)], 'readonly': [('state', '!=', 'draft')]}"/>

<field name="discount_percentage" widget='monetary'
options="{'currency_field': 'currency_id'}"
attrs="{'readonly': [('discount_type', '=', 'fixed')],'invisible': [('discount_type', 'in', ('fixed','none'))]}"/>
attrs="{'readonly': ['|',('state', '!=', 'draft'),('discount_type', '=', 'fixed')],'invisible': [('discount_type', 'in', ('fixed','none'))]}"/>

<field name="discount" widget='monetary'
options="{'currency_field': 'currency_id'}"
attrs="{'readonly': [('discount_type', '=', 'percentage')],'invisible': [('discount_type', 'in', ('none'))]}"/>
attrs="{'readonly': ['|',('state', '!=', 'draft'),('discount_type', '=', 'percentage')],'invisible': [('discount_type', 'in', ('none'))]}"/>

<field name="disc_acc_id"
attrs="{'required': [('discount', '!=', 0.0)],'invisible': ['|', ('discount_type', '=', 'none'),('discount', '=', 0.0)]}"/>
attrs="{'readonly': [('state', '!=', 'draft')],'required': [('discount', '!=', 0.0)],'invisible': ['|', ('discount_type', '=', 'none'),('discount', '=', 0.0)]}"/>

<field name="round_off_amount" widget='monetary'
<field name="round_off_amount" widget='monetary' attrs="{'readonly': [('state', '!=', 'draft')]}"
options="{'currency_field': 'currency_id'}"/>


Expand Down Expand Up @@ -62,7 +62,7 @@
<field name="partner_id"/>
</xpath>
<xpath expr="//field[@name='payment_state']" position="before">
<field name="amount_residual"/>
<field name="amount_residual" sum="Total"/>
</xpath>
</field>
</record>
Expand Down
18 changes: 9 additions & 9 deletions bahmni_sale/views/sale_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_shipping_id']" position="after">
<field name="partner_village"/>
<field name="care_setting" />
<field name="provider_name"/>
<field name="partner_village" attrs="{'readonly': [('state', 'not in', ['draft', 'sent'])]}"/>
<field name="care_setting" attrs="{'readonly': [('state', 'not in', ['draft', 'sent'])]}"/>
<field name="provider_name" attrs="{'readonly': [('state', 'not in', ['draft', 'sent'])]}"/>
</xpath>
<xpath expr="//field[@name='partner_id']" position="after">
<field name="partner_id" domain="[('customer_rank', '>', 0)]" invisible="1"/>
<field name="partner_uuid" invisible="1"/>
</xpath>
<xpath expr="//field[@name='payment_term_id']" position="after">
<field name="shop_id"/>
<field name="shop_id" attrs="{'readonly': [('state', 'not in', ['draft', 'sent'])]}"/>
</xpath>


Expand All @@ -31,19 +31,19 @@
options="{'currency_field': 'currency_id'}"/>
<field name="amount_tax" widget='monetary'
options="{'currency_field': 'currency_id'}"/>
<field name="discount_type" required="1" attrs="{'invisible': [('amount_untaxed', '=', 0.00)]}"/>
<field name="discount_type" required="1" attrs="{'invisible': [('amount_untaxed', '=', 0.00)], 'readonly': [('state', 'not in', ['draft', 'sent'])]}"/>

<field name="discount_percentage" widget='monetary' force_save = "1"
attrs="{'readonly': [('discount_type', '=', 'fixed')],'invisible': [('discount_type', 'in', ('fixed','none'))]}"/>
attrs="{'readonly': ['|',('state', 'not in', ['draft', 'sent']),('discount_type', '=', 'fixed')],'invisible': [('discount_type', 'in', ('fixed','none'))]}"/>

<field name="discount" widget='monetary' force_save = "1"
options="{'currency_field': 'currency_id'}"
attrs="{'readonly': [('discount_type', '=', 'percentage')],'invisible': [('discount_type', 'in', ('none'))]}"/>
attrs="{'readonly': ['|',('state', 'not in', ['draft', 'sent']),('discount_type', '=', 'percentage')],'invisible': [('discount_type', 'in', ('none'))]}"/>

<field name="disc_acc_id" force_save = "1"
attrs="{'required': [('discount', '!=', 0.0)],'invisible': ['|', ('discount_type', '=', 'none'),('discount', '=', 0.0)]}"/>
attrs="{'required': [('discount', '!=', 0.0)],'invisible': [('discount_type', '=', 'none')],'readonly': [('state', 'not in', ['draft', 'sent'])]}"/>

<field name="round_off_amount" widget='monetary'
<field name="round_off_amount" widget='monetary' attrs="{'readonly': [('state', 'not in', ['draft', 'sent'])]}"
options="{'currency_field': 'currency_id'}"/>


Expand Down

0 comments on commit b6b14d3

Please sign in to comment.