Browse Source

[UPDT] Update in view

pull/206/head
AjmalCybro 3 years ago
parent
commit
b36ee5d186
  1. 2
      sale_discount_total/__manifest__.py
  2. 33
      sale_discount_total/views/sale_view.xml

2
sale_discount_total/__manifest__.py

@ -22,7 +22,7 @@
{ {
'name': 'Sale Discount on Total Amount', 'name': 'Sale Discount on Total Amount',
'version': '15.0.1.0.0', 'version': '15.0.1.1.0',
'category': 'Sales Management', 'category': 'Sales Management',
'live_test_url': 'https://www.youtube.com/watch?v=CigmHe9iC4s&feature=youtu.be', 'live_test_url': 'https://www.youtube.com/watch?v=CigmHe9iC4s&feature=youtu.be',
'summary': "Discount on Total in Sale and Invoice With Discount Limit and Approval", 'summary': "Discount on Total in Sale and Invoice With Discount Limit and Approval",

33
sale_discount_total/views/sale_view.xml

@ -8,10 +8,12 @@
<field name="inherit_id" ref="sale.view_order_form"/> <field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="before"> <xpath expr="//field[@name='state']" position="before">
<button string="Approve" type="object" name="action_approve" states="waiting" class="oe_highlight" <button string="Approve" type="object" name="action_approve"
states="waiting" class="oe_highlight"
groups="sales_team.group_sale_manager"/> groups="sales_team.group_sale_manager"/>
</xpath> </xpath>
<xpath expr="//button[@name='action_cancel']" position="attributes"> <xpath expr="//button[@name='action_cancel']"
position="attributes">
<attribute name="states">draft,sent,sale,waiting</attribute> <attribute name="states">draft,sent,sale,waiting</attribute>
</xpath> </xpath>
<xpath expr="//group[@name='note_group']" position="replace"> <xpath expr="//group[@name='note_group']" position="replace">
@ -21,29 +23,40 @@
<field name="discount_rate"/> <field name="discount_rate"/>
</group> </group>
<group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total"> <group class="oe_subtotal_footer oe_right" colspan="2"
<field name="amount_untaxed" widget='monetary' options="{'currency_field': 'currency_id'}"/> name="sale_total">
<field name="amount_untaxed" widget='monetary'
options="{'currency_field': 'currency_id'}"/>
<field name="amount_discount" widget='monetary' <field name="amount_discount" widget='monetary'
options="{'currency_field': 'currency_id'}"/> options="{'currency_field': 'currency_id'}"/>
<field name="amount_tax" widget='monetary' options="{'currency_field': 'currency_id'}"/> <field name="amount_tax" widget='monetary'
options="{'currency_field': 'currency_id'}"/>
<div class="oe_subtotal_footer_separator oe_inline o_td_label"> <div class="oe_subtotal_footer_separator oe_inline o_td_label">
<label for="amount_total"/> <label for="amount_total"/>
<button name="button_dummy" <button name="button_dummy"
states="draft,sent" string="(update)" type="object" states="draft,sent" string="(update)"
type="object"
class="oe_edit_only oe_link"/> class="oe_edit_only oe_link"/>
</div> </div>
<field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" <field name="amount_total" nolabel="1"
widget='monetary' options="{'currency_field': 'currency_id'}"/> class="oe_subtotal_footer_separator"
widget='monetary'
options="{'currency_field': 'currency_id'}"/>
<field name="tax_totals_json"
widget="account-tax-totals-field" nolabel="1"
colspan="2" invisible="1"/>
</group> </group>
<group colspan="4"> <group colspan="4">
<field name="note" nolabel="1" placeholder="Terms and conditions..."/> <field name="note" nolabel="1"
placeholder="Terms and conditions..."/>
</group> </group>
<div class="oe_clear"/> <div class="oe_clear"/>
</group> </group>
</xpath> </xpath>
<!-- Roundoff the discount field --> <!-- Roundoff the discount field -->
<xpath expr="//field[@name='order_line']/tree/field[@name='discount']" position="attributes"> <xpath expr="//field[@name='order_line']/tree/field[@name='discount']"
position="attributes">
<attribute name="digits">[16, 2]</attribute> <attribute name="digits">[16, 2]</attribute>
</xpath> </xpath>
</field> </field>

Loading…
Cancel
Save