Add deductible rate of taxes to supplier invoice
issue6911 review341801002
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
* Add deductible rate for supplier taxes
|
||||
|
||||
Version 5.8.0 - 2020-11-02
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
* Remove support for Python 3.5
|
||||
|
||||
+28
@@ -126,6 +126,17 @@ class Category(CompanyMultiValueMixin, metaclass=PoolMeta):
|
||||
},
|
||||
depends=['taxes_parent', 'accounting'],
|
||||
help="The taxes to apply when purchasing products of this category.")
|
||||
supplier_taxes_deductible_rate = fields.Numeric(
|
||||
"Supplier Taxes Deductible Rate", digits=(14, 10),
|
||||
domain=[
|
||||
('supplier_taxes_deductible_rate', '>=', 0),
|
||||
('supplier_taxes_deductible_rate', '<=', 1),
|
||||
],
|
||||
states={
|
||||
'invisible': (
|
||||
Eval('taxes_parent') | ~Eval('accounting', False)),
|
||||
},
|
||||
depends=['taxes_parent', 'accounting'])
|
||||
customer_taxes_used = fields.Function(fields.Many2Many(
|
||||
'account.tax', None, None, "Customer Taxes Used"), 'get_taxes')
|
||||
supplier_taxes_used = fields.Function(fields.Many2Many(
|
||||
@@ -172,6 +183,10 @@ class Category(CompanyMultiValueMixin, metaclass=PoolMeta):
|
||||
'default_category_account_revenue', **pattern)
|
||||
return account.id if account else None
|
||||
|
||||
@classmethod
|
||||
def default_supplier_taxes_deductible_rate(cls):
|
||||
return 1
|
||||
|
||||
def get_account(self, name, **pattern):
|
||||
if self.account_parent:
|
||||
return self.parent.get_account(name, **pattern)
|
||||
@@ -235,6 +250,13 @@ class Category(CompanyMultiValueMixin, metaclass=PoolMeta):
|
||||
def account_revenue_used(self):
|
||||
pass
|
||||
|
||||
@property
|
||||
def supplier_taxes_deductible_rate_used(self):
|
||||
if self.taxes_parent:
|
||||
return self.parent.supplier_taxes_deductible_rate_used
|
||||
else:
|
||||
return self.supplier_taxes_deductible_rate
|
||||
|
||||
|
||||
class CategoryAccount(ModelSQL, CompanyValueMixin):
|
||||
"Category Account"
|
||||
@@ -368,6 +390,10 @@ class Template(CompanyMultiValueMixin, metaclass=PoolMeta):
|
||||
name=self.rec_name))
|
||||
return taxes
|
||||
|
||||
@property
|
||||
def supplier_taxes_deductible_rate_used(self):
|
||||
return self.get_taxes('supplier_taxes_deductible_rate_used')
|
||||
|
||||
|
||||
class Product(metaclass=PoolMeta):
|
||||
__name__ = 'product.product'
|
||||
@@ -375,6 +401,8 @@ class Product(metaclass=PoolMeta):
|
||||
account_revenue_used = template_property('account_revenue_used')
|
||||
customer_taxes_used = template_property('customer_taxes_used')
|
||||
supplier_taxes_used = template_property('supplier_taxes_used')
|
||||
supplier_taxes_deductible_rate_used = template_property(
|
||||
'supplier_taxes_deductible_rate_used')
|
||||
|
||||
|
||||
class TemplateAccountCategory(ModelSQL):
|
||||
|
||||
@@ -21,7 +21,9 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<separator string="Taxes" id="taxes" colspan="4"/>
|
||||
<label name="taxes_parent"/>
|
||||
<field name="taxes_parent"/>
|
||||
<newline/>
|
||||
<label name="supplier_taxes_deductible_rate"/>
|
||||
<field name="supplier_taxes_deductible_rate"/>
|
||||
|
||||
<field name="customer_taxes" colspan="2"/>
|
||||
<field name="supplier_taxes" colspan="2"/>
|
||||
</page>
|
||||
|
||||
Reference in New Issue
Block a user