I am working in Odoo13 I am calculating some taxes while creating my sale order and while doing this I am successfully calculating my respective taxes.
But after saving my sale order or by confirming it all my custom tax fields disappear.
Here is my Python File code:
class SaleOrder(models.Model): _inherit = ['sale.order'] federal_tax = fields.Float('Federal Tax', readonly=True) state_tax = fields.Float('State Tax', readonly=True) county_tax = fields.Float('County Tax', readonly=True) city_tax = fields.Float('City Tax', readonly=True) unincorporated_tax = fields.Float('Unincorporated Tax', store=True, readonly=True)
And here is my XML File:
<xpath expr="/form/sheet/notebook/page/group/group/field[@name='amount_untaxed']" position="after"> <field name="federal_tax" attrs="{'invisible':[('federal_tax','==', 0.00)]}"/> <field name="state_tax" attrs="{'invisible':[('state_tax','==', 0.00)]}"/> <field name="county_tax" attrs="{'invisible':[('county_tax','==', 0.00)]}"/> <field name="city_tax" attrs="{'invisible':[('city_tax','==', 0.00)]}"/> <field name="unincorporated_tax" attrs="{'invisible':[('unincorporated_tax','==', 0.00)]}"/> </xpath>
Note: After confirming my order or by saving it my custom fields value turn to 0 that is why they are disappearing but why they are turning to zero?