init
parent
eaaa326fdc
commit
72c6add212
|
|
@ -113,7 +113,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/input/Customer.csv</filename>
|
||||
<filename>${tz-austria_run1}/input/Customer.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -2831,7 +2831,7 @@
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/account.payment.term</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/account.payment.term</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -3010,7 +3010,7 @@
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.pricelist</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.pricelist</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -3110,7 +3110,7 @@
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.pricelist.item</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.pricelist.item</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -3210,7 +3210,7 @@
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.pricelist.version</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.pricelist.version</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -3298,7 +3298,7 @@
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/res.partner</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/res.partner</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -3900,7 +3900,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/vat_lookup.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/vat_lookup.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -3956,7 +3956,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/input/vendor.csv</filename>
|
||||
<filename>${tz-austria_run1}/input/vendor.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -4639,7 +4639,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/input/zahlungsziele.csv</filename>
|
||||
<filename>${tz-austria_run1}/input/zahlungsziele.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/input/ItemCategory.csv</filename>
|
||||
<filename>${tz-austria_run1}/input/ItemCategory.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1975,7 +1975,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/input/Item.csv</filename>
|
||||
<filename>${tz-austria_run1}/input/Item.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -3431,7 +3431,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/mrp.bom</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/mrp.bom</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -3555,7 +3555,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/mrp.bom.line</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/mrp.bom.line</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -3679,7 +3679,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.category</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.category</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -3755,7 +3755,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.packaging</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.packaging</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -3927,7 +3927,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.product</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.product</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -4231,7 +4231,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.supplierinfo</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.supplierinfo</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -4415,7 +4415,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.ul</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.ul</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -4551,7 +4551,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/stock.inventory</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/stock.inventory</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -4639,7 +4639,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/stock.inventory.line</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/stock.inventory.line</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -4763,7 +4763,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/stock.warehouse.orderpoint</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/stock.warehouse.orderpoint</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -4906,7 +4906,7 @@ public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws K
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/errors/supplierinfo_errors</name>
|
||||
<name>${tz-austria_run1}/errors/supplierinfo_errors</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/errors/ERROR_product.category</name>
|
||||
<name>${tz-austria_run1}/errors/ERROR_product.category</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -889,7 +889,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/product.category.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/product.category.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -959,7 +959,7 @@
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.pricelist</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.pricelist</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -1045,7 +1045,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/tmp/product.pricelist.csv</filename>
|
||||
<filename>${tz-austria_run1}/tmp/product.pricelist.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1137,7 +1137,7 @@
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.pricelist.item</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.pricelist.item</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -1271,7 +1271,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/tmp/product.pricelist.item.csv</filename>
|
||||
<filename>${tz-austria_run1}/tmp/product.pricelist.item.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1407,7 +1407,7 @@
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/product.pricelist.version</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/product.pricelist.version</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
@ -1481,7 +1481,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/tmp/product.pricelist.version.csv</filename>
|
||||
<filename>${tz-austria_run1}/tmp/product.pricelist.version.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1548,7 +1548,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/input/rRabattte.csv</filename>
|
||||
<filename>${tz-austria_run1}/input/rRabattte.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/input/Customer.csv</filename>
|
||||
<filename>${tz-austria_run1}/input/Customer.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1314,7 +1314,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/input/vendor.csv</filename>
|
||||
<filename>${tz-austria_run1}/input/vendor.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -2011,7 +2011,7 @@
|
|||
<fileNameField/>
|
||||
<create_parent_folder>Y</create_parent_folder>
|
||||
<file>
|
||||
<name>${dmi_dir}/cam_dmi/vat_lookup</name>
|
||||
<name>${tz-austria_run1}/cam_dmi/vat_lookup</name>
|
||||
<is_command>N</is_command>
|
||||
<servlet_output>N</servlet_output>
|
||||
<do_not_open_new_file_init>N</do_not_open_new_file_init>
|
||||
|
|
|
|||
|
|
@ -1071,7 +1071,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/account.payment.term.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/account.payment.term.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1204,7 +1204,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/mrp.bom.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/mrp.bom.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1304,7 +1304,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/mrp.bom.line.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/mrp.bom.line.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1404,7 +1404,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/product.category.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/product.category.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1460,7 +1460,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/product.packaging.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/product.packaging.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1604,7 +1604,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/product.pricelist.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/product.pricelist.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1682,7 +1682,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/product.pricelist.item.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/product.pricelist.item.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1760,7 +1760,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/product.pricelist.version.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/product.pricelist.version.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -1827,7 +1827,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/product.product.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/product.product.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -2092,7 +2092,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/product.supplierinfo.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/product.supplierinfo.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -2247,7 +2247,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/product.ul.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/product.ul.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -2358,7 +2358,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/res.partner.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/res.partner.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
@ -2777,7 +2777,7 @@
|
|||
<method>none</method>
|
||||
<schema_name/>
|
||||
</partitioning>
|
||||
<filename>${dmi_dir}/cam_dmi/stock.warehouse.orderpoint.csv</filename>
|
||||
<filename>${tz-austria_run1}/cam_dmi/stock.warehouse.orderpoint.csv</filename>
|
||||
<filename_field/>
|
||||
<rownum_field/>
|
||||
<include_filename>N</include_filename>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,949 @@
|
|||
[main]
|
||||
host = https://www.transifex.com
|
||||
type = PO
|
||||
|
||||
[odoo-11.base]
|
||||
file_filter = odoo/addons/base/i18n/<lang>.po
|
||||
source_file = odoo/addons/base/i18n/base.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account]
|
||||
file_filter = addons/account/i18n/<lang>.po
|
||||
source_file = addons/account/i18n/account.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_analytic_default]
|
||||
file_filter = addons/account_analytic_default/i18n/<lang>.po
|
||||
source_file = addons/account_analytic_default/i18n/account_analytic_default.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_asset]
|
||||
file_filter = addons/account_asset/i18n/<lang>.po
|
||||
source_file = addons/account_asset/i18n/account_asset.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_bank_statement_import]
|
||||
file_filter = addons/account_bank_statement_import/i18n/<lang>.po
|
||||
source_file = addons/account_bank_statement_import/i18n/account_bank_statement_import.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_budget]
|
||||
file_filter = addons/account_budget/i18n/<lang>.po
|
||||
source_file = addons/account_budget/i18n/account_budget.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_cancel]
|
||||
file_filter = addons/account_cancel/i18n/<lang>.po
|
||||
source_file = addons/account_cancel/i18n/account_cancel.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_check_printing]
|
||||
file_filter = addons/account_check_printing/i18n/<lang>.po
|
||||
source_file = addons/account_check_printing/i18n/account_check_printing.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_invoicing]
|
||||
file_filter = addons/account_invoicing/i18n/<lang>.po
|
||||
source_file = addons/account_invoicing/i18n/account_invoicing.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_payment]
|
||||
file_filter = addons/account_payment/i18n/<lang>.po
|
||||
source_file = addons/account_payment/i18n/account_payment.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_tax_python]
|
||||
file_filter = addons/account_tax_python/i18n/<lang>.po
|
||||
source_file = addons/account_tax_python/i18n/account_tax_python.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_test]
|
||||
file_filter = addons/account_test/i18n/<lang>.po
|
||||
source_file = addons/account_test/i18n/account_test.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.account_voucher]
|
||||
file_filter = addons/account_voucher/i18n/<lang>.po
|
||||
source_file = addons/account_voucher/i18n/account_voucher.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.analytic]
|
||||
file_filter = addons/analytic/i18n/<lang>.po
|
||||
source_file = addons/analytic/i18n/analytic.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.anonymization]
|
||||
file_filter = addons/anonymization/i18n/<lang>.po
|
||||
source_file = addons/anonymization/i18n/anonymization.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.association]
|
||||
file_filter = addons/association/i18n/<lang>.po
|
||||
source_file = addons/association/i18n/association.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.auth_crypt]
|
||||
file_filter = addons/auth_crypt/i18n/<lang>.po
|
||||
source_file = addons/auth_crypt/i18n/auth_crypt.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.auth_ldap]
|
||||
file_filter = addons/auth_ldap/i18n/<lang>.po
|
||||
source_file = addons/auth_ldap/i18n/auth_ldap.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.auth_oauth]
|
||||
file_filter = addons/auth_oauth/i18n/<lang>.po
|
||||
source_file = addons/auth_oauth/i18n/auth_oauth.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.auth_signup]
|
||||
file_filter = addons/auth_signup/i18n/<lang>.po
|
||||
source_file = addons/auth_signup/i18n/auth_signup.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.barcodes]
|
||||
file_filter = addons/barcodes/i18n/<lang>.po
|
||||
source_file = addons/barcodes/i18n/barcodes.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_address_city]
|
||||
file_filter = addons/base_address_city/i18n/<lang>.po
|
||||
source_file = addons/base_address_city/i18n/base_address_city.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_address_extended]
|
||||
file_filter = addons/base_address_extended/i18n/<lang>.po
|
||||
source_file = addons/base_address_extended/i18n/base_address_extended.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_automation]
|
||||
file_filter = addons/base_automation/i18n/<lang>.po
|
||||
source_file = addons/base_automation/i18n/base_automation.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_gengo]
|
||||
file_filter = addons/base_gengo/i18n/<lang>.po
|
||||
source_file = addons/base_gengo/i18n/base_gengo.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_geolocalize]
|
||||
file_filter = addons/base_geolocalize/i18n/<lang>.po
|
||||
source_file = addons/base_geolocalize/i18n/base_geolocalize.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_iban]
|
||||
file_filter = addons/base_iban/i18n/<lang>.po
|
||||
source_file = addons/base_iban/i18n/base_iban.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_import]
|
||||
file_filter = addons/base_import/i18n/<lang>.po
|
||||
source_file = addons/base_import/i18n/base_import.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_import_module]
|
||||
file_filter = addons/base_import_module/i18n/<lang>.po
|
||||
source_file = addons/base_import_module/i18n/base_import_module.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_setup]
|
||||
file_filter = addons/base_setup/i18n/<lang>.po
|
||||
source_file = addons/base_setup/i18n/base_setup.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_sparse_field]
|
||||
file_filter = addons/base_sparse_field/i18n/<lang>.po
|
||||
source_file = addons/base_sparse_field/i18n/base_sparse_field.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_vat]
|
||||
file_filter = addons/base_vat/i18n/<lang>.po
|
||||
source_file = addons/base_vat/i18n/base_vat.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.base_vat_autocomplete]
|
||||
file_filter = addons/base_vat_autocomplete/i18n/<lang>.po
|
||||
source_file = addons/base_vat_autocomplete/i18n/base_vat_autocomplete.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.board]
|
||||
file_filter = addons/board/i18n/<lang>.po
|
||||
source_file = addons/board/i18n/board.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.bus]
|
||||
file_filter = addons/bus/i18n/<lang>.po
|
||||
source_file = addons/bus/i18n/bus.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.calendar]
|
||||
file_filter = addons/calendar/i18n/<lang>.po
|
||||
source_file = addons/calendar/i18n/calendar.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.calendar_sms]
|
||||
file_filter = addons/calendar_sms/i18n/<lang>.po
|
||||
source_file = addons/calendar_sms/i18n/calendar_sms.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.contacts]
|
||||
file_filter = addons/contacts/i18n/<lang>.po
|
||||
source_file = addons/contacts/i18n/contacts.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.crm]
|
||||
file_filter = addons/crm/i18n/<lang>.po
|
||||
source_file = addons/crm/i18n/crm.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.crm_livechat]
|
||||
file_filter = addons/crm_livechat/i18n/<lang>.po
|
||||
source_file = addons/crm_livechat/i18n/crm_livechat.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.crm_phone_validation]
|
||||
file_filter = addons/crm_phone_validation/i18n/<lang>.po
|
||||
source_file = addons/crm_phone_validation/i18n/crm_phone_validation.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.crm_project]
|
||||
file_filter = addons/crm_project/i18n/<lang>.po
|
||||
source_file = addons/crm_project/i18n/crm_project.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.decimal_precision]
|
||||
file_filter = addons/decimal_precision/i18n/<lang>.po
|
||||
source_file = addons/decimal_precision/i18n/decimal_precision.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.delivery]
|
||||
file_filter = addons/delivery/i18n/<lang>.po
|
||||
source_file = addons/delivery/i18n/delivery.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.document]
|
||||
file_filter = addons/document/i18n/<lang>.po
|
||||
source_file = addons/document/i18n/document.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.event]
|
||||
file_filter = addons/event/i18n/<lang>.po
|
||||
source_file = addons/event/i18n/event.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.event_sale]
|
||||
file_filter = addons/event_sale/i18n/<lang>.po
|
||||
source_file = addons/event_sale/i18n/event_sale.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.fetchmail]
|
||||
file_filter = addons/fetchmail/i18n/<lang>.po
|
||||
source_file = addons/fetchmail/i18n/fetchmail.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.fleet]
|
||||
file_filter = addons/fleet/i18n/<lang>.po
|
||||
source_file = addons/fleet/i18n/fleet.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.gamification]
|
||||
file_filter = addons/gamification/i18n/<lang>.po
|
||||
source_file = addons/gamification/i18n/gamification.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.gamification_sale_crm]
|
||||
file_filter = addons/gamification_sale_crm/i18n/<lang>.po
|
||||
source_file = addons/gamification_sale_crm/i18n/gamification_sale_crm.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.google_account]
|
||||
file_filter = addons/google_account/i18n/<lang>.po
|
||||
source_file = addons/google_account/i18n/google_account.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.google_calendar]
|
||||
file_filter = addons/google_calendar/i18n/<lang>.po
|
||||
source_file = addons/google_calendar/i18n/google_calendar.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.google_drive]
|
||||
file_filter = addons/google_drive/i18n/<lang>.po
|
||||
source_file = addons/google_drive/i18n/google_drive.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.google_spreadsheet]
|
||||
file_filter = addons/google_spreadsheet/i18n/<lang>.po
|
||||
source_file = addons/google_spreadsheet/i18n/google_spreadsheet.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr]
|
||||
file_filter = addons/hr/i18n/<lang>.po
|
||||
source_file = addons/hr/i18n/hr.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_attendance]
|
||||
file_filter = addons/hr_attendance/i18n/<lang>.po
|
||||
source_file = addons/hr_attendance/i18n/hr_attendance.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_contract]
|
||||
file_filter = addons/hr_contract/i18n/<lang>.po
|
||||
source_file = addons/hr_contract/i18n/hr_contract.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_expense]
|
||||
file_filter = addons/hr_expense/i18n/<lang>.po
|
||||
source_file = addons/hr_expense/i18n/hr_expense.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_expense_check]
|
||||
file_filter = addons/hr_expense_check/i18n/<lang>.po
|
||||
source_file = addons/hr_expense_check/i18n/hr_expense_check.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_gamification]
|
||||
file_filter = addons/hr_gamification/i18n/<lang>.po
|
||||
source_file = addons/hr_gamification/i18n/hr_gamification.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_holidays]
|
||||
file_filter = addons/hr_holidays/i18n/<lang>.po
|
||||
source_file = addons/hr_holidays/i18n/hr_holidays.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_maintenance]
|
||||
file_filter = addons/hr_maintenance/i18n/<lang>.po
|
||||
source_file = addons/hr_maintenance/i18n/hr_maintenance.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_org_chart]
|
||||
file_filter = addons/hr_org_chart/i18n/<lang>.po
|
||||
source_file = addons/hr_org_chart/i18n/hr_org_chart.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_payroll]
|
||||
file_filter = addons/hr_payroll/i18n/<lang>.po
|
||||
source_file = addons/hr_payroll/i18n/hr_payroll.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_payroll_account]
|
||||
file_filter = addons/hr_payroll_account/i18n/<lang>.po
|
||||
source_file = addons/hr_payroll_account/i18n/hr_payroll_account.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_recruitment]
|
||||
file_filter = addons/hr_recruitment/i18n/<lang>.po
|
||||
source_file = addons/hr_recruitment/i18n/hr_recruitment.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_recruitment_survey]
|
||||
file_filter = addons/hr_recruitment_survey/i18n/<lang>.po
|
||||
source_file = addons/hr_recruitment_survey/i18n/hr_recruitment_survey.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_timesheet]
|
||||
file_filter = addons/hr_timesheet/i18n/<lang>.po
|
||||
source_file = addons/hr_timesheet/i18n/hr_timesheet.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.hr_timesheet_attendance]
|
||||
file_filter = addons/hr_timesheet_attendance/i18n/<lang>.po
|
||||
source_file = addons/hr_timesheet_attendance/i18n/hr_timesheet_attendance.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.iap]
|
||||
file_filter = addons/iap/i18n/<lang>.po
|
||||
source_file = addons/iap/i18n/iap.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.im_livechat]
|
||||
file_filter = addons/im_livechat/i18n/<lang>.po
|
||||
source_file = addons/im_livechat/i18n/im_livechat.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.link_tracker]
|
||||
file_filter = addons/link_tracker/i18n/<lang>.po
|
||||
source_file = addons/link_tracker/i18n/link_tracker.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.lunch]
|
||||
file_filter = addons/lunch/i18n/<lang>.po
|
||||
source_file = addons/lunch/i18n/lunch.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.mail]
|
||||
file_filter = addons/mail/i18n/<lang>.po
|
||||
source_file = addons/mail/i18n/mail.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.maintenance]
|
||||
file_filter = addons/maintenance/i18n/<lang>.po
|
||||
source_file = addons/maintenance/i18n/maintenance.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.mass_mailing]
|
||||
file_filter = addons/mass_mailing/i18n/<lang>.po
|
||||
source_file = addons/mass_mailing/i18n/mass_mailing.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.mass_mailing_event]
|
||||
file_filter = addons/mass_mailing_event/i18n/<lang>.po
|
||||
source_file = addons/mass_mailing_event/i18n/mass_mailing_event.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.mass_mailing_event_track]
|
||||
file_filter = addons/mass_mailing_event_track/i18n/<lang>.po
|
||||
source_file = addons/mass_mailing_event_track/i18n/mass_mailing_event_track.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.membership]
|
||||
file_filter = addons/membership/i18n/<lang>.po
|
||||
source_file = addons/membership/i18n/membership.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.mrp]
|
||||
file_filter = addons/mrp/i18n/<lang>.po
|
||||
source_file = addons/mrp/i18n/mrp.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.mrp_byproduct]
|
||||
file_filter = addons/mrp_byproduct/i18n/<lang>.po
|
||||
source_file = addons/mrp_byproduct/i18n/mrp_byproduct.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.mrp_repair]
|
||||
file_filter = addons/mrp_repair/i18n/<lang>.po
|
||||
source_file = addons/mrp_repair/i18n/mrp_repair.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.note]
|
||||
file_filter = addons/note/i18n/<lang>.po
|
||||
source_file = addons/note/i18n/note.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.note_pad]
|
||||
file_filter = addons/note_pad/i18n/<lang>.po
|
||||
source_file = addons/note_pad/i18n/note_pad.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.pad]
|
||||
file_filter = addons/pad/i18n/<lang>.po
|
||||
source_file = addons/pad/i18n/pad.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.pad_project]
|
||||
file_filter = addons/pad_project/i18n/<lang>.po
|
||||
source_file = addons/pad_project/i18n/pad_project.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.payment]
|
||||
file_filter = addons/payment/i18n/<lang>.po
|
||||
source_file = addons/payment/i18n/payment.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.payment_adyen]
|
||||
file_filter = addons/payment_adyen/i18n/<lang>.po
|
||||
source_file = addons/payment_adyen/i18n/payment_adyen.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.payment_authorize]
|
||||
file_filter = addons/payment_authorize/i18n/<lang>.po
|
||||
source_file = addons/payment_authorize/i18n/payment_authorize.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.payment_buckaroo]
|
||||
file_filter = addons/payment_buckaroo/i18n/<lang>.po
|
||||
source_file = addons/payment_buckaroo/i18n/payment_buckaroo.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.payment_ogone]
|
||||
file_filter = addons/payment_ogone/i18n/<lang>.po
|
||||
source_file = addons/payment_ogone/i18n/payment_ogone.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.payment_paypal]
|
||||
file_filter = addons/payment_paypal/i18n/<lang>.po
|
||||
source_file = addons/payment_paypal/i18n/payment_paypal.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.payment_payumoney]
|
||||
file_filter = addons/payment_payumoney/i18n/<lang>.po
|
||||
source_file = addons/payment_payumoney/i18n/payment_payumoney.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.payment_sips]
|
||||
file_filter = addons/payment_sips/i18n/<lang>.po
|
||||
source_file = addons/payment_sips/i18n/payment_sips.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.payment_stripe]
|
||||
file_filter = addons/payment_stripe/i18n/<lang>.po
|
||||
source_file = addons/payment_stripe/i18n/payment_stripe.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.payment_transfer]
|
||||
file_filter = addons/payment_transfer/i18n/<lang>.po
|
||||
source_file = addons/payment_transfer/i18n/payment_transfer.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.phone_validation]
|
||||
file_filter = addons/phone_validation/i18n/<lang>.po
|
||||
source_file = addons/phone_validation/i18n/phone_validation.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.point_of_sale]
|
||||
file_filter = addons/point_of_sale/i18n/<lang>.po
|
||||
source_file = addons/point_of_sale/i18n/point_of_sale.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.portal]
|
||||
file_filter = addons/portal/i18n/<lang>.po
|
||||
source_file = addons/portal/i18n/portal.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.pos_cache]
|
||||
file_filter = addons/pos_cache/i18n/<lang>.po
|
||||
source_file = addons/pos_cache/i18n/pos_cache.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.pos_data_drinks]
|
||||
file_filter = addons/pos_data_drinks/i18n/<lang>.po
|
||||
source_file = addons/pos_data_drinks/i18n/pos_data_drinks.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.pos_discount]
|
||||
file_filter = addons/pos_discount/i18n/<lang>.po
|
||||
source_file = addons/pos_discount/i18n/pos_discount.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.pos_mercury]
|
||||
file_filter = addons/pos_mercury/i18n/<lang>.po
|
||||
source_file = addons/pos_mercury/i18n/pos_mercury.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.pos_reprint]
|
||||
file_filter = addons/pos_reprint/i18n/<lang>.po
|
||||
source_file = addons/pos_reprint/i18n/pos_reprint.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.pos_restaurant]
|
||||
file_filter = addons/pos_restaurant/i18n/<lang>.po
|
||||
source_file = addons/pos_restaurant/i18n/pos_restaurant.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.pos_sale]
|
||||
file_filter = addons/pos_sale/i18n/<lang>.po
|
||||
source_file = addons/pos_sale/i18n/pos_sale.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.procurement_jit]
|
||||
file_filter = addons/procurement_jit/i18n/<lang>.po
|
||||
source_file = addons/procurement_jit/i18n/procurement_jit.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.product]
|
||||
file_filter = addons/product/i18n/<lang>.po
|
||||
source_file = addons/product/i18n/product.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.product_email_template]
|
||||
file_filter = addons/product_email_template/i18n/<lang>.po
|
||||
source_file = addons/product_email_template/i18n/product_email_template.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.product_expiry]
|
||||
file_filter = addons/product_expiry/i18n/<lang>.po
|
||||
source_file = addons/product_expiry/i18n/product_expiry.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.product_extended]
|
||||
file_filter = addons/product_extended/i18n/<lang>.po
|
||||
source_file = addons/product_extended/i18n/product_extended.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.product_margin]
|
||||
file_filter = addons/product_margin/i18n/<lang>.po
|
||||
source_file = addons/product_margin/i18n/product_margin.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.project]
|
||||
file_filter = addons/project/i18n/<lang>.po
|
||||
source_file = addons/project/i18n/project.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.project_timesheet_holidays]
|
||||
file_filter = addons/project_timesheet_holidays/i18n/<lang>.po
|
||||
source_file = addons/project_timesheet_holidays/i18n/project_timesheet_holidays.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.purchase]
|
||||
file_filter = addons/purchase/i18n/<lang>.po
|
||||
source_file = addons/purchase/i18n/purchase.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.purchase_mrp]
|
||||
file_filter = addons/purchase_mrp/i18n/<lang>.po
|
||||
source_file = addons/purchase_mrp/i18n/purchase_mrp.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.purchase_requisition]
|
||||
file_filter = addons/purchase_requisition/i18n/<lang>.po
|
||||
source_file = addons/purchase_requisition/i18n/purchase_requisition.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.rating]
|
||||
file_filter = addons/rating/i18n/<lang>.po
|
||||
source_file = addons/rating/i18n/rating.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.rating_project]
|
||||
file_filter = addons/rating_project/i18n/<lang>.po
|
||||
source_file = addons/rating_project/i18n/rating_project.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.report_intrastat]
|
||||
file_filter = addons/report_intrastat/i18n/<lang>.po
|
||||
source_file = addons/report_intrastat/i18n/report_intrastat.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.resource]
|
||||
file_filter = addons/resource/i18n/<lang>.po
|
||||
source_file = addons/resource/i18n/resource.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale]
|
||||
file_filter = addons/sale/i18n/<lang>.po
|
||||
source_file = addons/sale/i18n/sale.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale_crm]
|
||||
file_filter = addons/sale_crm/i18n/<lang>.po
|
||||
source_file = addons/sale_crm/i18n/sale_crm.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale_expense]
|
||||
file_filter = addons/sale_expense/i18n/<lang>.po
|
||||
source_file = addons/sale_expense/i18n/sale_expense.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale_management]
|
||||
file_filter = addons/sale_management/i18n/<lang>.po
|
||||
source_file = addons/sale_management/i18n/sale_management.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale_margin]
|
||||
file_filter = addons/sale_margin/i18n/<lang>.po
|
||||
source_file = addons/sale_margin/i18n/sale_margin.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale_mrp]
|
||||
file_filter = addons/sale_mrp/i18n/<lang>.po
|
||||
source_file = addons/sale_mrp/i18n/sale_mrp.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale_order_dates]
|
||||
file_filter = addons/sale_order_dates/i18n/<lang>.po
|
||||
source_file = addons/sale_order_dates/i18n/sale_order_dates.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale_payment]
|
||||
file_filter = addons/sale_payment/i18n/<lang>.po
|
||||
source_file = addons/sale_payment/i18n/sale_payment.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale_service_rating]
|
||||
file_filter = addons/sale_service_rating/i18n/<lang>.po
|
||||
source_file = addons/sale_service_rating/i18n/sale_service_rating.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale_stock]
|
||||
file_filter = addons/sale_stock/i18n/<lang>.po
|
||||
source_file = addons/sale_stock/i18n/sale_stock.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sale_timesheet]
|
||||
file_filter = addons/sale_timesheet/i18n/<lang>.po
|
||||
source_file = addons/sale_timesheet/i18n/sale_timesheet.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sales_team]
|
||||
file_filter = addons/sales_team/i18n/<lang>.po
|
||||
source_file = addons/sales_team/i18n/sales_team.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.sms]
|
||||
file_filter = addons/sms/i18n/<lang>.po
|
||||
source_file = addons/sms/i18n/sms.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.stock]
|
||||
file_filter = addons/stock/i18n/<lang>.po
|
||||
source_file = addons/stock/i18n/stock.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.stock_account]
|
||||
file_filter = addons/stock_account/i18n/<lang>.po
|
||||
source_file = addons/stock_account/i18n/stock_account.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.stock_dropshipping]
|
||||
file_filter = addons/stock_dropshipping/i18n/<lang>.po
|
||||
source_file = addons/stock_dropshipping/i18n/stock_dropshipping.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.stock_landed_costs]
|
||||
file_filter = addons/stock_landed_costs/i18n/<lang>.po
|
||||
source_file = addons/stock_landed_costs/i18n/stock_landed_costs.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.stock_picking_batch]
|
||||
file_filter = addons/stock_picking_batch/i18n/<lang>.po
|
||||
source_file = addons/stock_picking_batch/i18n/stock_picking_batch.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.survey]
|
||||
file_filter = addons/survey/i18n/<lang>.po
|
||||
source_file = addons/survey/i18n/survey.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.survey_crm]
|
||||
file_filter = addons/survey_crm/i18n/<lang>.po
|
||||
source_file = addons/survey_crm/i18n/survey_crm.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.theme_bootswatch]
|
||||
file_filter = addons/theme_bootswatch/i18n/<lang>.po
|
||||
source_file = addons/theme_bootswatch/i18n/theme_bootswatch.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.transifex]
|
||||
file_filter = addons/transifex/i18n/<lang>.po
|
||||
source_file = addons/transifex/i18n/transifex.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.theme_default]
|
||||
file_filter = addons/theme_default/i18n/<lang>.po
|
||||
source_file = addons/theme_default/i18n/theme_default.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.utm]
|
||||
file_filter = addons/utm/i18n/<lang>.po
|
||||
source_file = addons/utm/i18n/utm.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.web]
|
||||
file_filter = addons/web/i18n/<lang>.po
|
||||
source_file = addons/web/i18n/web.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.web_diagram]
|
||||
file_filter = addons/web_diagram/i18n/<lang>.po
|
||||
source_file = addons/web_diagram/i18n/web_diagram.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.web_editor]
|
||||
file_filter = addons/web_editor/i18n/<lang>.po
|
||||
source_file = addons/web_editor/i18n/web_editor.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.web_kanban_gauge]
|
||||
file_filter = addons/web_kanban_gauge/i18n/<lang>.po
|
||||
source_file = addons/web_kanban_gauge/i18n/web_kanban_gauge.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.web_planner]
|
||||
file_filter = addons/web_planner/i18n/<lang>.po
|
||||
source_file = addons/web_planner/i18n/web_planner.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.web_settings_dashboard]
|
||||
file_filter = addons/web_settings_dashboard/i18n/<lang>.po
|
||||
source_file = addons/web_settings_dashboard/i18n/web_settings_dashboard.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.web_tour]
|
||||
file_filter = addons/web_tour/i18n/<lang>.po
|
||||
source_file = addons/web_tour/i18n/web_tour.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website]
|
||||
file_filter = addons/website/i18n/<lang>.po
|
||||
source_file = addons/website/i18n/website.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_blog]
|
||||
file_filter = addons/website_blog/i18n/<lang>.po
|
||||
source_file = addons/website_blog/i18n/website_blog.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_crm]
|
||||
file_filter = addons/website_crm/i18n/<lang>.po
|
||||
source_file = addons/website_crm/i18n/website_crm.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_crm_partner_assign]
|
||||
file_filter = addons/website_crm_partner_assign/i18n/<lang>.po
|
||||
source_file = addons/website_crm_partner_assign/i18n/website_crm_partner_assign.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_customer]
|
||||
file_filter = addons/website_customer/i18n/<lang>.po
|
||||
source_file = addons/website_customer/i18n/website_customer.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_event]
|
||||
file_filter = addons/website_event/i18n/<lang>.po
|
||||
source_file = addons/website_event/i18n/website_event.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_event_questions]
|
||||
file_filter = addons/website_event_questions/i18n/<lang>.po
|
||||
source_file = addons/website_event_questions/i18n/website_event_questions.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_event_sale]
|
||||
file_filter = addons/website_event_sale/i18n/<lang>.po
|
||||
source_file = addons/website_event_sale/i18n/website_event_sale.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_event_track]
|
||||
file_filter = addons/website_event_track/i18n/<lang>.po
|
||||
source_file = addons/website_event_track/i18n/website_event_track.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_form]
|
||||
file_filter = addons/website_form/i18n/<lang>.po
|
||||
source_file = addons/website_form/i18n/website_form.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_forum]
|
||||
file_filter = addons/website_forum/i18n/<lang>.po
|
||||
source_file = addons/website_forum/i18n/website_forum.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_forum_doc]
|
||||
file_filter = addons/website_forum_doc/i18n/<lang>.po
|
||||
source_file = addons/website_forum_doc/i18n/website_forum_doc.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_gengo]
|
||||
file_filter = addons/website_gengo/i18n/<lang>.po
|
||||
source_file = addons/website_gengo/i18n/website_gengo.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_hr]
|
||||
file_filter = addons/website_hr/i18n/<lang>.po
|
||||
source_file = addons/website_hr/i18n/website_hr.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_hr_recruitment]
|
||||
file_filter = addons/website_hr_recruitment/i18n/<lang>.po
|
||||
source_file = addons/website_hr_recruitment/i18n/website_hr_recruitment.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_links]
|
||||
file_filter = addons/website_links/i18n/<lang>.po
|
||||
source_file = addons/website_links/i18n/website_links.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_livechat]
|
||||
file_filter = addons/website_livechat/i18n/<lang>.po
|
||||
source_file = addons/website_livechat/i18n/website_livechat.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_mail]
|
||||
file_filter = addons/website_mail/i18n/<lang>.po
|
||||
source_file = addons/website_mail/i18n/website_mail.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_mail_channel]
|
||||
file_filter = addons/website_mail_channel/i18n/<lang>.po
|
||||
source_file = addons/website_mail_channel/i18n/website_mail_channel.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_mass_mailing]
|
||||
file_filter = addons/website_mass_mailing/i18n/<lang>.po
|
||||
source_file = addons/website_mass_mailing/i18n/website_mass_mailing.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_membership]
|
||||
file_filter = addons/website_membership/i18n/<lang>.po
|
||||
source_file = addons/website_membership/i18n/website_membership.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_partner]
|
||||
file_filter = addons/website_partner/i18n/<lang>.po
|
||||
source_file = addons/website_partner/i18n/website_partner.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_payment]
|
||||
file_filter = addons/website_payment/i18n/<lang>.po
|
||||
source_file = addons/website_payment/i18n/website_payment.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_quote]
|
||||
file_filter = addons/website_quote/i18n/<lang>.po
|
||||
source_file = addons/website_quote/i18n/website_quote.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_rating]
|
||||
file_filter = addons/website_rating/i18n/<lang>.po
|
||||
source_file = addons/website_rating/i18n/website_rating.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_rating_project]
|
||||
file_filter = addons/website_rating_project/i18n/<lang>.po
|
||||
source_file = addons/website_rating_project/i18n/website_rating_project.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_sale]
|
||||
file_filter = addons/website_sale/i18n/<lang>.po
|
||||
source_file = addons/website_sale/i18n/website_sale.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_sale_comparison]
|
||||
file_filter = addons/website_sale_comparison/i18n/<lang>.po
|
||||
source_file = addons/website_sale_comparison/i18n/website_sale_comparison.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_sale_delivery]
|
||||
file_filter = addons/website_sale_delivery/i18n/<lang>.po
|
||||
source_file = addons/website_sale_delivery/i18n/website_sale_delivery.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_sale_digital]
|
||||
file_filter = addons/website_sale_digital/i18n/<lang>.po
|
||||
source_file = addons/website_sale_digital/i18n/website_sale_digital.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_sale_options]
|
||||
file_filter = addons/website_sale_options/i18n/<lang>.po
|
||||
source_file = addons/website_sale_options/i18n/website_sale_options.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_sale_stock]
|
||||
file_filter = addons/website_sale_stock/i18n/<lang>.po
|
||||
source_file = addons/website_sale_stock/i18n/website_sale_stock.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_sale_wishlist]
|
||||
file_filter = addons/website_sale_wishlist/i18n/<lang>.po
|
||||
source_file = addons/website_sale_wishlist/i18n/website_sale_wishlist.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_slides]
|
||||
file_filter = addons/website_slides/i18n/<lang>.po
|
||||
source_file = addons/website_slides/i18n/website_slides.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_theme_install]
|
||||
file_filter = addons/website_theme_install/i18n/<lang>.po
|
||||
source_file = addons/website_theme_install/i18n/website_theme_install.pot
|
||||
source_lang = en
|
||||
|
||||
[odoo-11.website_twitter]
|
||||
file_filter = addons/website_twitter/i18n/<lang>.po
|
||||
source_file = addons/website_twitter/i18n/website_twitter.pot
|
||||
source_lang = en
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
Contributing to Odoo
|
||||
====================
|
||||
|
||||
[Full contribution guidelines](https://github.com/odoo/odoo/wiki/Contributing)
|
||||
|
||||
TL;DR
|
||||
|
||||
* If you [make a pull request](https://github.com/odoo/odoo/wiki/Contributing#making-pull-requests),
|
||||
do not create an issue! Use the PR description for that
|
||||
* Issues are handled with a much lower priority than pull requests
|
||||
* Use this [template](https://github.com/odoo/odoo/tree/10.0/.github/ISSUE_TEMPLATE.md)
|
||||
when reporting issues. Please search for duplicates first!
|
||||
* Pull requests must be made against the [correct version](https://github.com/odoo/odoo/wiki/Contributing#against-which-version-should-i-submit-a-patch)
|
||||
* There are restrictions on the kind of [changes allowed in stable series](https://github.com/odoo/odoo/wiki/Contributing#what-does-stable-mean)
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
Most of the files are
|
||||
|
||||
Copyright (c) 2004-2015 Odoo S.A.
|
||||
|
||||
Many files also contain contributions from third
|
||||
parties. In this case the original copyright of
|
||||
the contributions can be traced through the
|
||||
history of the source version control system.
|
||||
|
||||
When that is not the case, the files contain a prominent
|
||||
notice stating the original copyright and applicable
|
||||
license, or come with their own dedicated COPYRIGHT
|
||||
and/or LICENSE file.
|
||||
|
||||
|
|
@ -0,0 +1,859 @@
|
|||
|
||||
For copyright information, please see the COPYRIGHT file.
|
||||
|
||||
Odoo is published under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3
|
||||
(LGPLv3), as included below. Since the LGPL is a set of additional
|
||||
permissions on top of the GPL, the text of the GPL is included at the
|
||||
bottom as well.
|
||||
|
||||
Some external libraries and contributions bundled with Odoo may be published
|
||||
under other GPL-compatible licenses. For these, please refer to the relevant
|
||||
source files and/or license files, in the source code tree.
|
||||
|
||||
**************************************************************************
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
|
||||
**************************************************************************
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
|
||||
**************************************************************************
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
include requirements.txt
|
||||
include LICENSE
|
||||
include README.md
|
||||
recursive-include odoo *.css
|
||||
recursive-include odoo *.csv
|
||||
recursive-include odoo *.doc
|
||||
recursive-include odoo *.eml
|
||||
recursive-include odoo *.eot
|
||||
recursive-include odoo *.gif
|
||||
recursive-include odoo *.html
|
||||
recursive-include odoo *.ico
|
||||
recursive-include odoo *.jpeg
|
||||
recursive-include odoo *.jpg
|
||||
recursive-include odoo *.js
|
||||
recursive-include odoo *.less
|
||||
recursive-include odoo *.md
|
||||
recursive-include odoo *.mp3
|
||||
recursive-include odoo *.ogg
|
||||
recursive-include odoo *.otf
|
||||
recursive-include odoo *.pdf
|
||||
recursive-include odoo *.png
|
||||
recursive-include odoo *.po
|
||||
recursive-include odoo *.rml
|
||||
recursive-include odoo *.rng
|
||||
recursive-include odoo *.rst
|
||||
recursive-include odoo *.sass
|
||||
recursive-include odoo *.sql
|
||||
recursive-include odoo *.svg
|
||||
recursive-include odoo *.template
|
||||
recursive-include odoo *.txt
|
||||
recursive-include odoo *.ttf
|
||||
recursive-include odoo *.woff
|
||||
recursive-include odoo *.woff2
|
||||
recursive-include odoo *.wsdl
|
||||
recursive-include odoo *.xls
|
||||
recursive-include odoo *.xsd
|
||||
recursive-include odoo *.xsl
|
||||
recursive-include odoo *.xml
|
||||
recursive-include odoo *.yml
|
||||
recursive-exclude * *.py[co]
|
||||
recursive-exclude * *.hg*
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# NOTE: please keep your version of sass up to date: sudo gem update
|
||||
.PHONY: watch css
|
||||
SASS_FILES=$(wildcard addons/*/static/src/css/*.sass openerp/addons/*/static/src/css/*.sass)
|
||||
CSS_FILES=$(patsubst %.sass,%.css,${SASS_FILES})
|
||||
css: ${CSS_FILES}
|
||||
%.css: %.sass
|
||||
sass -t expanded --compass --unix-newlines --sourcemap=none $< $@
|
||||
watch:
|
||||
sass -t expanded --compass --unix-newlines --sourcemap=none --watch .:.
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
[](http://runbot.odoo.com/runbot)
|
||||
[](http://www.odoo.com/documentation/11.0)
|
||||
[](https://www.odoo.com/forum/help-1)
|
||||
[](http://nightly.odoo.com/)
|
||||
|
||||
Odoo
|
||||
----
|
||||
|
||||
Odoo is a suite of web based open source business apps.
|
||||
|
||||
The main Odoo Apps include an <a href="https://www.odoo.com/page/crm">Open Source CRM</a>,
|
||||
<a href="https://www.odoo.com/page/website-builder">Website Builder</a>,
|
||||
<a href="https://www.odoo.com/page/e-commerce">eCommerce</a>,
|
||||
<a href="https://www.odoo.com/page/warehouse">Warehouse Management</a>,
|
||||
<a href="https://www.odoo.com/page/project-management">Project Management</a>,
|
||||
<a href="https://www.odoo.com/page/accounting">Billing & Accounting</a>,
|
||||
<a href="https://www.odoo.com/page/point-of-sale">Point of Sale</a>,
|
||||
<a href="https://www.odoo.com/page/employees">Human Resources</a>,
|
||||
<a href="https://www.odoo.com/page/lead-automation">Marketing</a>,
|
||||
<a href="https://www.odoo.com/page/manufacturing">Manufacturing</a>,
|
||||
<a href="https://www.odoo.com/page/purchase">Purchase Management</a>,
|
||||
<a href="https://www.odoo.com/#apps">...</a>
|
||||
|
||||
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get
|
||||
a full-featured <a href="https://www.odoo.com">Open Source ERP</a> when you install several Apps.
|
||||
|
||||
|
||||
Getting started with Odoo
|
||||
-------------------------
|
||||
For a standard installation please follow the <a href="https://www.odoo.com/documentation/11.0/setup/install.html">Setup instructions</a>
|
||||
from the documentation.
|
||||
|
||||
Then follow <a href="https://www.odoo.com/documentation/11.0/tutorials.html">the developer tutorials</a>
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
Odoo Accounting
|
||||
---------------
|
||||
|
||||
The Odoo <a href="https://www.odoo.com/page/accounting">Open Source Accounting</a> app allows a better way to
|
||||
collaborate with your accountants, your customers and control your suppliers.
|
||||
|
||||
Activate features on demand, from integrated analytic accounting to budget,
|
||||
assets and multiple companies consolidation.
|
||||
|
||||
A Smart User Interface
|
||||
----------------------
|
||||
|
||||
Record transactions in a few clicks and easily manage all financial activities
|
||||
in one place. Odoo's user interface is designed with productivity in mind.
|
||||
|
||||
A Better Way To Work – Together
|
||||
-------------------------------
|
||||
|
||||
Share access to your latest business numbers with your team and your accountant
|
||||
– so everyone is up to speed. From work, home or on the go.
|
||||
|
||||
Connect Your Bank Accounts
|
||||
--------------------------
|
||||
|
||||
Import your bank statements and reconcile them in just a few clicks. Prepare
|
||||
payment orders based on your supplier invoices and payment terms.
|
||||
|
||||
Electronic invoicing and automated follow-ups
|
||||
---------------------------------------------
|
||||
|
||||
Create and send professional invoices & get paid online. Get rid of the stress
|
||||
of having to constantly remind your debtors. Simply set-up and automate
|
||||
follow-ups to get paid quickly.
|
||||
|
||||
Sales Integration
|
||||
-----------------
|
||||
|
||||
Automatically create invoices from sales orders, delivery orders or base them
|
||||
on time and material. Re-invoice expenses on projects to your customer in just
|
||||
a few clicks.
|
||||
|
||||
|
||||
Purchase Integration
|
||||
--------------------
|
||||
|
||||
Control supplier invocies based on purchase orders. Get real-time inventory
|
||||
valuation reports automatically posted in your accounts.
|
||||
|
||||
Multi-Level Analytic Accounting
|
||||
-------------------------------
|
||||
|
||||
Integrate your analytic accounting operations with timesheets, projects,
|
||||
invoices, expenses, etc. No need to record transactions, all analytic entries
|
||||
are posted automatically following your business rules.
|
||||
|
||||
Everything you need to grow
|
||||
---------------------------
|
||||
|
||||
Manage your assets, track expenses, control budgets, multi-level analytic
|
||||
accounting; Odoo has all the features you need to sustain all your business
|
||||
activities.
|
||||
|
||||
Scale With Your Organization
|
||||
----------------------------
|
||||
|
||||
Odoo supports multiple currencies, multiple users with different access rights,
|
||||
multiple companies with real time consolidation and unlimited analytic plans.
|
||||
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import controllers
|
||||
from . import models
|
||||
from . import wizard
|
||||
from . import report
|
||||
|
||||
from odoo import api, SUPERUSER_ID
|
||||
|
||||
SYSCOHADA_LIST = ['BJ', 'BF', 'CM', 'CF', 'KM', 'CG', 'CI', 'GA', 'GN', 'GW', 'GQ', 'ML', 'NE', 'CD', 'SN', 'TD', 'TG']
|
||||
|
||||
def _auto_install_l10n(cr, registry):
|
||||
#check the country of the main company (only) and eventually load some module needed in that country
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
country_code = env.user.company_id.country_id.code
|
||||
if country_code:
|
||||
#auto install localization module(s) if available
|
||||
module_list = []
|
||||
if country_code in SYSCOHADA_LIST:
|
||||
#countries using OHADA Chart of Accounts
|
||||
module_list.append('l10n_syscohada')
|
||||
elif country_code == 'GB':
|
||||
module_list.append('l10n_uk')
|
||||
elif country_code == 'DE':
|
||||
module_list.append('l10n_de_skr03')
|
||||
module_list.append('l10n_de_skr04')
|
||||
else:
|
||||
if env['ir.module.module'].search([('name', '=', 'l10n_' + country_code.lower())]):
|
||||
module_list.append('l10n_' + country_code.lower())
|
||||
else:
|
||||
module_list.append('l10n_generic_coa')
|
||||
if country_code == 'US':
|
||||
module_list.append('account_plaid')
|
||||
module_list.append('account_check_printing')
|
||||
if country_code in ['US', 'AU', 'NZ', 'CA', 'CO', 'EC', 'ES', 'FR', 'IN', 'MX', 'UK']:
|
||||
module_list.append('account_yodlee')
|
||||
if country_code in SYSCOHADA_LIST + [
|
||||
'AT', 'BE', 'CA', 'CO', 'DE', 'EC', 'ES', 'ET', 'FR', 'GR', 'IT', 'LU', 'MX', 'NL', 'NO',
|
||||
'PL', 'PT', 'RO', 'SI', 'TR', 'UK', 'VE', 'VN'
|
||||
]:
|
||||
module_list.append('base_vat')
|
||||
|
||||
#european countries will be using SEPA
|
||||
europe = env.ref('base.europe', raise_if_not_found=False)
|
||||
if europe:
|
||||
europe_country_codes = [x.code for x in europe.country_ids]
|
||||
if country_code in europe_country_codes:
|
||||
module_list.append('account_sepa')
|
||||
module_ids = env['ir.module.module'].search([('name', 'in', module_list), ('state', '=', 'uninstalled')])
|
||||
module_ids.sudo().button_install()
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
{
|
||||
'name' : 'Invoicing',
|
||||
'version' : '1.1',
|
||||
'summary': 'Send Invoices and Track Payments',
|
||||
'sequence': 30,
|
||||
'description': """
|
||||
Core mechanisms for the accounting modules. To display the menuitems, install the module account_invoicing.
|
||||
""",
|
||||
'category': 'Accounting',
|
||||
'website': 'https://www.odoo.com/page/billing',
|
||||
'images' : ['images/accounts.jpeg','images/bank_statement.jpeg','images/cash_register.jpeg','images/chart_of_accounts.jpeg','images/customer_invoice.jpeg','images/journal_entries.jpeg'],
|
||||
'depends' : ['base_setup', 'product', 'analytic', 'web_planner', 'portal'],
|
||||
'data': [
|
||||
'security/account_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'data/data_account_type.xml',
|
||||
'data/account_data.xml',
|
||||
'views/account_menuitem.xml',
|
||||
'views/account_payment_view.xml',
|
||||
'wizard/account_reconcile_view.xml',
|
||||
'wizard/account_unreconcile_view.xml',
|
||||
'wizard/account_move_reversal_view.xml',
|
||||
'views/account_view.xml',
|
||||
'views/account_report.xml',
|
||||
'data/mail_template_data.xml',
|
||||
'wizard/account_invoice_refund_view.xml',
|
||||
'wizard/account_validate_move_view.xml',
|
||||
'wizard/account_invoice_state_view.xml',
|
||||
'wizard/pos_box.xml',
|
||||
'views/account_end_fy.xml',
|
||||
'views/account_invoice_view.xml',
|
||||
'views/partner_view.xml',
|
||||
'views/product_view.xml',
|
||||
'views/account_analytic_view.xml',
|
||||
'views/account_tip_data.xml',
|
||||
'views/account.xml',
|
||||
'views/report_invoice.xml',
|
||||
'report/account_invoice_report_view.xml',
|
||||
'views/report_overdue.xml',
|
||||
'views/account_cash_rounding_view.xml',
|
||||
'wizard/account_report_common_view.xml',
|
||||
'wizard/account_report_print_journal_view.xml',
|
||||
'views/report_journal.xml',
|
||||
'wizard/account_report_partner_ledger_view.xml',
|
||||
'views/report_partnerledger.xml',
|
||||
'wizard/account_report_general_ledger_view.xml',
|
||||
'views/report_generalledger.xml',
|
||||
'wizard/account_report_trial_balance_view.xml',
|
||||
'views/report_trialbalance.xml',
|
||||
'views/account_financial_report_data.xml',
|
||||
'wizard/account_financial_report_view.xml',
|
||||
'views/report_financial.xml',
|
||||
'wizard/account_report_aged_partner_balance_view.xml',
|
||||
'views/report_agedpartnerbalance.xml',
|
||||
'views/tax_adjustments.xml',
|
||||
'wizard/wizard_tax_adjustments_view.xml',
|
||||
'views/res_config_settings_views.xml',
|
||||
'views/web_planner_data.xml',
|
||||
'views/account_journal_dashboard_view.xml',
|
||||
'views/account_portal_templates.xml',
|
||||
'report/account_report_payment_receipt_templates.xml',
|
||||
'data/payment_receipt_data.xml',
|
||||
'wizard/setup_wizards_view.xml',
|
||||
'views/account_dashboard_setup_bar.xml',
|
||||
'wizard/account_report_tax_view.xml',
|
||||
'views/report_tax.xml',
|
||||
],
|
||||
'demo': [
|
||||
'demo/account_demo.xml',
|
||||
],
|
||||
'qweb': [
|
||||
"static/src/xml/account_reconciliation.xml",
|
||||
"static/src/xml/account_payment.xml",
|
||||
"static/src/xml/account_report_backend.xml",
|
||||
"static/src/xml/account_dashboard_setup_bar.xml",
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
'post_init_hook': '_auto_install_l10n',
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import mail
|
||||
from . import portal
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import werkzeug
|
||||
|
||||
from odoo.addons.mail.controllers.main import MailController
|
||||
from odoo.exceptions import AccessError
|
||||
from odoo.http import request
|
||||
from odoo.tools.misc import consteq
|
||||
|
||||
|
||||
class MailController(MailController):
|
||||
|
||||
def _redirect_to_record(cls, model, res_id, access_token=None):
|
||||
# If the current user doesn't have access to the invoice, but provided
|
||||
# a valid access token, redirect him to the front-end view.
|
||||
if model == 'account.invoice' and res_id and access_token:
|
||||
uid = request.session.uid or request.env.ref('base.public_user').id
|
||||
record_sudo = request.env[model].sudo().browse(res_id).exists()
|
||||
try:
|
||||
record_sudo.sudo(uid).check_access_rights('read')
|
||||
record_sudo.sudo(uid).check_access_rule('read')
|
||||
except AccessError:
|
||||
if record_sudo.access_token and consteq(record_sudo.access_token, access_token):
|
||||
record_action = record_sudo.with_context(
|
||||
force_website=True).get_access_action(uid)
|
||||
if record_action['type'] == 'ir.actions.act_url':
|
||||
return werkzeug.utils.redirect(record_action['url'])
|
||||
return super(MailController, cls)._redirect_to_record(model, res_id, access_token=access_token)
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import http, _
|
||||
from odoo.addons.portal.controllers.portal import CustomerPortal, pager as portal_pager
|
||||
from odoo.exceptions import AccessError
|
||||
from odoo.http import request
|
||||
from odoo.tools import consteq
|
||||
|
||||
|
||||
class PortalAccount(CustomerPortal):
|
||||
|
||||
def _prepare_portal_layout_values(self):
|
||||
values = super(PortalAccount, self)._prepare_portal_layout_values()
|
||||
partner = request.env.user.partner_id
|
||||
|
||||
invoice_count = request.env['account.invoice'].search_count([
|
||||
('type', 'in', ['out_invoice', 'out_refund']),
|
||||
('message_partner_ids', 'child_of', [partner.commercial_partner_id.id]),
|
||||
('state', 'in', ['open', 'paid', 'cancel'])
|
||||
])
|
||||
|
||||
values['invoice_count'] = invoice_count
|
||||
return values
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# My Invoices
|
||||
# ------------------------------------------------------------
|
||||
|
||||
def _invoice_check_access(self, invoice_id, access_token=None):
|
||||
invoice = request.env['account.invoice'].browse([invoice_id])
|
||||
invoice_sudo = invoice.sudo()
|
||||
try:
|
||||
invoice.check_access_rights('read')
|
||||
invoice.check_access_rule('read')
|
||||
except AccessError:
|
||||
if not access_token or not consteq(invoice_sudo.access_token, access_token):
|
||||
raise
|
||||
return invoice_sudo
|
||||
|
||||
def _invoice_get_page_view_values(self, invoice, access_token, **kwargs):
|
||||
values = {
|
||||
'page_name': 'invoice',
|
||||
'invoice': invoice,
|
||||
}
|
||||
if access_token:
|
||||
values['no_breadcrumbs'] = True
|
||||
values['access_token'] = access_token
|
||||
|
||||
if kwargs.get('error'):
|
||||
values['error'] = kwargs['error']
|
||||
if kwargs.get('warning'):
|
||||
values['warning'] = kwargs['warning']
|
||||
if kwargs.get('success'):
|
||||
values['success'] = kwargs['success']
|
||||
|
||||
return values
|
||||
|
||||
@http.route(['/my/invoices', '/my/invoices/page/<int:page>'], type='http', auth="user", website=True)
|
||||
def portal_my_invoices(self, page=1, date_begin=None, date_end=None, sortby=None, **kw):
|
||||
values = self._prepare_portal_layout_values()
|
||||
partner = request.env.user.partner_id
|
||||
AccountInvoice = request.env['account.invoice']
|
||||
|
||||
domain = [
|
||||
('type', 'in', ['out_invoice', 'out_refund']),
|
||||
('message_partner_ids', 'child_of', [partner.commercial_partner_id.id]),
|
||||
('state', 'in', ['open', 'paid', 'cancelled'])
|
||||
]
|
||||
|
||||
searchbar_sortings = {
|
||||
'date': {'label': _('Invoice Date'), 'order': 'date_invoice desc'},
|
||||
'duedate': {'label': _('Due Date'), 'order': 'date_due desc'},
|
||||
'name': {'label': _('Reference'), 'order': 'name desc'},
|
||||
'state': {'label': _('Status'), 'order': 'state'},
|
||||
}
|
||||
# default sort by order
|
||||
if not sortby:
|
||||
sortby = 'date'
|
||||
order = searchbar_sortings[sortby]['order']
|
||||
|
||||
archive_groups = self._get_archive_groups('account.invoice', domain)
|
||||
if date_begin and date_end:
|
||||
domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
|
||||
|
||||
# count for pager
|
||||
invoice_count = AccountInvoice.search_count(domain)
|
||||
# pager
|
||||
pager = portal_pager(
|
||||
url="/my/invoices",
|
||||
url_args={'date_begin': date_begin, 'date_end': date_end, 'sortby': sortby},
|
||||
total=invoice_count,
|
||||
page=page,
|
||||
step=self._items_per_page
|
||||
)
|
||||
# content according to pager and archive selected
|
||||
invoices = AccountInvoice.search(domain, order=order, limit=self._items_per_page, offset=pager['offset'])
|
||||
values.update({
|
||||
'date': date_begin,
|
||||
'invoices': invoices,
|
||||
'page_name': 'invoice',
|
||||
'pager': pager,
|
||||
'archive_groups': archive_groups,
|
||||
'default_url': '/my/invoices',
|
||||
'searchbar_sortings': searchbar_sortings,
|
||||
'sortby': sortby,
|
||||
})
|
||||
return request.render("account.portal_my_invoices", values)
|
||||
|
||||
@http.route(['/my/invoices/<int:invoice_id>'], type='http', auth="public", website=True)
|
||||
def portal_my_invoice_detail(self, invoice_id, access_token=None, **kw):
|
||||
try:
|
||||
invoice_sudo = self._invoice_check_access(invoice_id, access_token)
|
||||
except AccessError:
|
||||
return request.redirect('/my')
|
||||
|
||||
values = self._invoice_get_page_view_values(invoice_sudo, access_token, **kw)
|
||||
return request.render("account.portal_invoice_page", values)
|
||||
|
||||
@http.route(['/my/invoices/pdf/<int:invoice_id>'], type='http', auth="public", website=True)
|
||||
def portal_my_invoice_report(self, invoice_id, access_token=None, **kw):
|
||||
try:
|
||||
invoice_sudo = self._invoice_check_access(invoice_id, access_token)
|
||||
except AccessError:
|
||||
return request.redirect('/my')
|
||||
|
||||
# print report as sudo, since it require access to taxes, payment term, ... and portal
|
||||
# does not have those access rights.
|
||||
pdf = request.env.ref('account.account_invoices').sudo().render_qweb_pdf([invoice_sudo.id])[0]
|
||||
pdfhttpheaders = [
|
||||
('Content-Type', 'application/pdf'),
|
||||
('Content-Length', len(pdf)),
|
||||
]
|
||||
return request.make_response(pdf, headers=pdfhttpheaders)
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# My Home
|
||||
# ------------------------------------------------------------
|
||||
|
||||
def details_form_validate(self, data):
|
||||
error, error_message = super(PortalAccount, self).details_form_validate(data)
|
||||
# prevent VAT/name change if invoices exist
|
||||
partner = request.env['res.users'].browse(request.uid).partner_id
|
||||
invoices = request.env['account.invoice'].sudo().search_count([('partner_id', '=', partner.id), ('state', 'not in', ['draft', 'cancel'])])
|
||||
if invoices:
|
||||
if 'vat' in data and (data['vat'] or False) != (partner.vat or False):
|
||||
error['vat'] = 'error'
|
||||
error_message.append(_('Changing VAT number is not allowed once invoices have been issued for your account. Please contact us directly for this operation.'))
|
||||
if 'name' in data and (data['name'] or False) != (partner.name or False):
|
||||
error['name'] = 'error'
|
||||
error_message.append(_('Changing your name is not allowed once invoices have been issued for your account. Please contact us directly for this operation.'))
|
||||
return error, error_message
|
||||
|
|
@ -0,0 +1,164 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
|
||||
<!-- TAGS FOR CASH FLOW STATEMENT -->
|
||||
|
||||
<record id="account_tag_operating" model="account.account.tag">
|
||||
<field name="name">Operating Activities</field>
|
||||
<field name="applicability">accounts</field>
|
||||
</record>
|
||||
<record id="account_tag_financing" model="account.account.tag">
|
||||
<field name="name">Financing Activities</field>
|
||||
<field name="applicability">accounts</field>
|
||||
</record>
|
||||
<record id="account_tag_investing" model="account.account.tag">
|
||||
<field name="name">Investing & Extraordinary Activities</field>
|
||||
<field name="applicability">accounts</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Payment terms
|
||||
-->
|
||||
<record id="account_payment_term_immediate" model="account.payment.term">
|
||||
<field name="name">Immediate Payment</field>
|
||||
<field name="note">Payment terms: Immediate Payment</field>
|
||||
</record>
|
||||
|
||||
<record id="account_payment_term_15days" model="account.payment.term">
|
||||
<field name="name">15 Days</field>
|
||||
<field name="note">Payment terms: 15 Days</field>
|
||||
<field name="line_ids" eval="[(5, 0), (0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 500, 'days': 15, 'option': 'day_after_invoice_date'})]"/>
|
||||
</record>
|
||||
|
||||
<record forcecreate="True" id="decimal_payment" model="decimal.precision">
|
||||
<field name="name">Payment Terms</field>
|
||||
<field name="digits">6</field>
|
||||
</record>
|
||||
|
||||
<record id="account_payment_term_net" model="account.payment.term">
|
||||
<field name="name">30 Net Days</field>
|
||||
<field name="note">Payment terms: 30 Net Days</field>
|
||||
<field name="line_ids" eval="[(5, 0), (0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 500, 'days': 30, 'option': 'day_after_invoice_date'})]"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Account Statement Sequences
|
||||
-->
|
||||
<record id="sequence_reconcile_seq" model="ir.sequence">
|
||||
<field name="name">Account reconcile sequence</field>
|
||||
<field name="code">account.reconcile</field>
|
||||
<field name="prefix">A</field>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
<field eval="False" name="company_id"/>
|
||||
</record>
|
||||
<!--
|
||||
Invoice requests (deprecated)
|
||||
-->
|
||||
<record id="req_link_invoice" model="res.request.link">
|
||||
<field name="name">Invoice</field>
|
||||
<field name="object">account.invoice</field>
|
||||
</record>
|
||||
|
||||
<!-- Account-related subtypes for messaging / Chatter -->
|
||||
<record id="mt_invoice_validated" model="mail.message.subtype">
|
||||
<field name="name">Validated</field>
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field name="default" eval="False"/>
|
||||
<field name="description">Invoice validated</field>
|
||||
</record>
|
||||
<record id="mt_invoice_paid" model="mail.message.subtype">
|
||||
<field name="name">Paid</field>
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field name="default" eval="False"/>
|
||||
<field name="description">Invoice paid</field>
|
||||
</record>
|
||||
<record id="mt_invoice_created" model="mail.message.subtype">
|
||||
<field name="name">Invoice Created</field>
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field name="default" eval="False"/>
|
||||
<field name="hidden" eval="True"/>
|
||||
<field name="description">Invoice Created</field>
|
||||
</record>
|
||||
|
||||
<!-- Payment methods -->
|
||||
<record id="account_payment_method_manual_in" model="account.payment.method">
|
||||
<field name="name">Manual</field>
|
||||
<field name="code">manual</field>
|
||||
<field name="payment_type">inbound</field>
|
||||
</record>
|
||||
<record id="account_payment_method_manual_out" model="account.payment.method">
|
||||
<field name="name">Manual</field>
|
||||
<field name="code">manual</field>
|
||||
<field name="payment_type">outbound</field>
|
||||
</record>
|
||||
|
||||
<!-- Payment sequences -->
|
||||
<record id="sequence_payment_customer_invoice" model="ir.sequence">
|
||||
<field name="name">Payments customer invoices sequence</field>
|
||||
<field name="code">account.payment.customer.invoice</field>
|
||||
<field name="prefix">CUST.IN/%(range_year)s/</field>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
<field eval="True" name="use_date_range"/>
|
||||
<field eval="False" name="company_id"/>
|
||||
<field name="padding">4</field>
|
||||
</record>
|
||||
<record id="sequence_payment_customer_refund" model="ir.sequence">
|
||||
<field name="name">Payments customer credit notes sequence</field>
|
||||
<field name="code">account.payment.customer.refund</field>
|
||||
<field name="prefix">CUST.OUT/%(range_year)s/</field>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
<field eval="True" name="use_date_range"/>
|
||||
<field eval="False" name="company_id"/>
|
||||
<field name="padding">4</field>
|
||||
</record>
|
||||
<record id="sequence_payment_supplier_invoice" model="ir.sequence">
|
||||
<field name="name">Payments supplier invoices sequence</field>
|
||||
<field name="code">account.payment.supplier.invoice</field>
|
||||
<field name="prefix">SUPP.OUT/%(range_year)s/</field>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
<field eval="True" name="use_date_range"/>
|
||||
<field eval="False" name="company_id"/>
|
||||
<field name="padding">4</field>
|
||||
</record>
|
||||
<record id="sequence_payment_supplier_refund" model="ir.sequence">
|
||||
<field name="name">Payments supplier credit notes sequence</field>
|
||||
<field name="code">account.payment.supplier.refund</field>
|
||||
<field name="prefix">SUPP.IN/%(range_year)s/</field>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
<field eval="True" name="use_date_range"/>
|
||||
<field eval="False" name="company_id"/>
|
||||
<field name="padding">4</field>
|
||||
</record>
|
||||
<record id="sequence_payment_transfer" model="ir.sequence">
|
||||
<field name="name">Payments transfer sequence</field>
|
||||
<field name="code">account.payment.transfer</field>
|
||||
<field name="prefix">TRANS/%(range_year)s/</field>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
<field eval="True" name="use_date_range"/>
|
||||
<field eval="False" name="company_id"/>
|
||||
<field name="padding">4</field>
|
||||
</record>
|
||||
|
||||
<!-- Account Tax Group -->
|
||||
<record id="tax_group_taxes" model="account.tax.group">
|
||||
<field name="name">Taxes</field>
|
||||
<field name="sequence">0</field>
|
||||
</record>
|
||||
|
||||
<!-- Partner Trust Property -->
|
||||
<record forcecreate="True" id="default_followup_trust" model="ir.property">
|
||||
<field name="name">Followup Trust Property</field>
|
||||
<field name="fields_id" search="[('model', '=', 'res.partner'), ('name', '=', 'trust')]"/>
|
||||
<field name="value">normal</field>
|
||||
<field name="type">selection</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<!-- account.account.type -->
|
||||
<record model="account.account.type" id="data_account_type_receivable">
|
||||
<field name="name">Receivable</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_payable">
|
||||
<field name="name">Payable</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_liquidity">
|
||||
<field name="name">Bank and Cash</field>
|
||||
<field name="type">liquidity</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_credit_card">
|
||||
<field name="name">Credit Card</field>
|
||||
<field name="type">liquidity</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_current_assets">
|
||||
<field name="name">Current Assets</field>
|
||||
<field name="type">other</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_non_current_assets">
|
||||
<field name="name">Non-current Assets</field>
|
||||
<field name="type">other</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_prepayments">
|
||||
<field name="name">Prepayments</field>
|
||||
<field name="type">other</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_fixed_assets">
|
||||
<field name="name">Fixed Assets</field>
|
||||
<field name="type">other</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_current_liabilities">
|
||||
<field name="name">Current Liabilities</field>
|
||||
<field name="type">other</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_non_current_liabilities">
|
||||
<field name="name">Non-current Liabilities</field>
|
||||
<field name="type">other</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_equity">
|
||||
<field name="name">Equity</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_unaffected_earnings">
|
||||
<field name="name">Current Year Earnings</field>
|
||||
<field name="include_initial_balance" eval="True"/>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_other_income">
|
||||
<field name="name">Other Income</field>
|
||||
<field name="type">other</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_revenue">
|
||||
<field name="name">Income</field>
|
||||
<field name="type">other</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_depreciation">
|
||||
<field name="name">Depreciation</field>
|
||||
<field name="type">other</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_expenses">
|
||||
<field name="name">Expenses</field>
|
||||
<field name="type">other</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="data_account_type_direct_costs">
|
||||
<field name="name">Cost of Revenue</field>
|
||||
<field name="type">other</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
<?xml version="1.0" ?>
|
||||
<odoo>
|
||||
|
||||
<!-- Mail template are declared in a NOUPDATE block
|
||||
so users can freely customize/delete them -->
|
||||
<data noupdate="1">
|
||||
<!--Email template -->
|
||||
<record id="email_template_edi_invoice" model="mail.template">
|
||||
<field name="name">Invoicing: Invoice email</field>
|
||||
<field name="email_from">${(object.user_id.email and '%s <%s>' % (object.user_id.name, object.user_id.email) or '')|safe}</field>
|
||||
<field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a'})</field>
|
||||
<field name="partner_to">${object.partner_id.id}</field>
|
||||
<field name="model_id" ref="account.model_account_invoice"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="report_template" ref="account_invoices"/>
|
||||
<field name="report_name">Invoice_${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
|
||||
<field name="lang">${object.partner_id.lang}</field>
|
||||
<field name="body_html" type="html">
|
||||
<div>
|
||||
<p>Dear ${object.partner_id.name}
|
||||
% set access_action = object.with_context(force_website=True).get_access_action()
|
||||
% set is_online = access_action and access_action['type'] == 'ir.actions.act_url'
|
||||
% set access_url = object.get_mail_url()
|
||||
|
||||
% if object.partner_id.parent_id:
|
||||
(<i>${object.partner_id.parent_id.name}</i>)
|
||||
% endif
|
||||
,</p>
|
||||
<p>Here is, in attachment, your
|
||||
% if object.number:
|
||||
invoice <strong>${object.number}</strong>
|
||||
% else:
|
||||
invoice
|
||||
% endif
|
||||
% if object.origin:
|
||||
(with reference: ${object.origin})
|
||||
% endif
|
||||
amounting in <strong>${object.amount_total} ${object.currency_id.name}</strong>
|
||||
from ${object.company_id.name}.
|
||||
</p>
|
||||
|
||||
% if is_online:
|
||||
<br/><br/>
|
||||
<center>
|
||||
<a href="${access_url}" style="background-color: #1abc9c; padding: 20px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;" class="o_default_snippet_text">View Invoice</a>
|
||||
</center>
|
||||
% endif
|
||||
<br/><br/>
|
||||
|
||||
% if object.state=='paid':
|
||||
<p>This invoice is already paid.</p>
|
||||
% else:
|
||||
<p>Please remit payment at your earliest convenience.</p>
|
||||
% endif
|
||||
|
||||
<p>Thank you,</p>
|
||||
<p style="color:#888888">
|
||||
% if object.user_id and object.user_id.signature:
|
||||
${object.user_id.signature | safe}
|
||||
% endif
|
||||
</p>
|
||||
</div></field>
|
||||
</record>
|
||||
|
||||
<!--Default Notification Email template for invoices-->
|
||||
<record id="account.mail_template_data_notification_email_account_invoice" model="mail.template">
|
||||
<field name="name">Account: Invoice notification header</field>
|
||||
<field name="subject">${object.subject}</field>
|
||||
<field name="model_id" ref="mail.model_mail_message"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html" type="html">
|
||||
<div>
|
||||
% set record = ctx.get('record')
|
||||
% set company = record and record.company_id or user.company_id
|
||||
<table border="0" width="100%" cellpadding="0" bgcolor="#ededed" style="padding: 20px; background-color: #ededed; border-collapse:separate;" summary="o_mail_notification">
|
||||
<tbody>
|
||||
<!-- HEADER -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table width="590" border="0" cellpadding="0" bgcolor="#875A7B" style="min-width: 590px; background-color: rgb(135,90,123); padding: 20px; border-collapse:separate;">
|
||||
<tr>
|
||||
<td valign="middle">
|
||||
<span style="font-size:20px; color:white; font-weight: bold;">
|
||||
Invoice ${object.record_name}
|
||||
</span>
|
||||
</td>
|
||||
<td valign="middle" align="right">
|
||||
<img src="/logo.png?company=${company.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${company.name}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- CONTENT -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table width="590" border="0" cellpadding="0" bgcolor="#ffffff" style="min-width: 590px; background-color: rgb(255, 255, 255); padding: 20px; border-collapse:separate;">
|
||||
<tbody>
|
||||
<td valign="top" style="font-family:Arial,Helvetica,sans-serif; color: #555; font-size: 14px;">
|
||||
${object.body | safe}
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- FOOTER -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table width="590" border="0" cellpadding="0" bgcolor="#875A7B" style="min-width: 590px; background-color: rgb(135,90,123); padding: 20px; border-collapse:separate;">
|
||||
<tr>
|
||||
<td valign="middle" align="left" style="color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;">
|
||||
${company.name}<br/>
|
||||
${company.phone or ''}
|
||||
</td>
|
||||
<td valign="middle" align="right" style="color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;">
|
||||
% if company.email:
|
||||
<a href="mailto:${company.email}" style="text-decoration:none; color: white;">${company.email}</a><br/>
|
||||
% endif
|
||||
% if company.website:
|
||||
<a href="${company.website}" style="text-decoration:none; color: white;">
|
||||
${company.website}
|
||||
</a>
|
||||
% endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
Powered by <a target="_blank" href="https://www.odoo.com">Odoo</a>.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
|
||||
<!--Email template -->
|
||||
<record id="mail_template_data_payment_receipt" model="mail.template">
|
||||
<field name="name">Payment Receipt - Send by Email</field>
|
||||
<field name="subject">${object.company_id.name} Payment Receipt (Ref ${object.name or 'n/a' })</field>
|
||||
<field name="partner_to">${object.partner_id.id}</field>
|
||||
<field name="model_id" ref="account.model_account_payment"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="report_template" ref="account.action_report_payment_receipt"/>
|
||||
<field name="report_name">${(object.name or '').replace('/','-')}</field>
|
||||
<field name="lang">${object.partner_id.lang}</field>
|
||||
<field name="body_html" type="xml">
|
||||
<p>Dear ${object.partner_id.name},</p>
|
||||
<p>Thank you for your payment.<br />Here is your payment receipt <strong>${(object.name or '').replace('/','-')}</strong> amounting to <strong>${object.amount} ${object.currency_id.name}</strong> from ${object.company_id.name}.</p>
|
||||
<p>If you have any questions, please do not hesitate to contact us.</p>
|
||||
<p>Best regards,
|
||||
% if user and user.signature:
|
||||
${user.signature | safe}
|
||||
% endif
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Send Receipt By Email"
|
||||
res_model="mail.compose.message"
|
||||
src_model="account.payment"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_relate"
|
||||
id="account_send_payment_receipt_by_email_action"
|
||||
context="{
|
||||
'default_model': 'account.payment',
|
||||
'mail_post_autofollow': True,
|
||||
'default_composition_mode': 'comment',
|
||||
'default_use_template': True,
|
||||
'default_res_id': active_id,
|
||||
'default_template_id': ref('account.mail_template_data_payment_receipt'),
|
||||
'force_email': True,
|
||||
}"
|
||||
/>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
-
|
||||
Create demo bank statement
|
||||
-
|
||||
!python {model: ir.model.data, id: False} : |
|
||||
default_company = self.env['res.company']._company_default_get('account.journal')
|
||||
journal = self.env['account.journal'].search([('type', '=', 'bank'), ('company_id', '=', default_company.id)], limit=1)
|
||||
import time
|
||||
if journal:
|
||||
vals = {
|
||||
'name': 'demo_bank_statement_1',
|
||||
'journal_id': journal.id,
|
||||
'date': time.strftime('%Y')+'-01-01',
|
||||
'name': "BNK/2014/001",
|
||||
'balance_end_real': '8998.2',
|
||||
'balance_start': 5103.0
|
||||
}
|
||||
self._update('account.bank.statement', 'account', vals, 'demo_bank_statement_1')
|
||||
vals = {
|
||||
'ref': '',
|
||||
'statement_id': ref('account.demo_bank_statement_1'),
|
||||
'sequence': 1,
|
||||
'name': "SAJ/2014/002 and SAJ/2014/003",
|
||||
'journal_id': journal.id,
|
||||
'amount': 1175.0,
|
||||
'date': time.strftime('%Y')+'-01-01',
|
||||
'partner_id': ref('base.res_partner_2'),
|
||||
}
|
||||
self._update('account.bank.statement.line', 'account', vals, 'demo_bank_statement_line_1')
|
||||
vals = {
|
||||
'ref': '',
|
||||
'statement_id': ref('account.demo_bank_statement_1'),
|
||||
'sequence': 2,
|
||||
'name': "Bank fees",
|
||||
'journal_id': journal.id,
|
||||
'amount': -32.58,
|
||||
'date': time.strftime('%Y')+'-01-01',
|
||||
}
|
||||
self._update('account.bank.statement.line', 'account', vals, 'demo_bank_statement_line_2')
|
||||
vals = {
|
||||
'ref': '',
|
||||
'statement_id': ref('account.demo_bank_statement_1'),
|
||||
'sequence': 3,
|
||||
'name': "Prepayment",
|
||||
'journal_id': journal.id,
|
||||
'amount': 650.0,
|
||||
'date': time.strftime('%Y')+'-01-01',
|
||||
'partner_id': ref('base.res_partner_12'),
|
||||
}
|
||||
self._update('account.bank.statement.line', 'account', vals, 'demo_bank_statement_line_3')
|
||||
vals = {
|
||||
'ref': '',
|
||||
'statement_id': ref('account.demo_bank_statement_1'),
|
||||
'sequence': 4,
|
||||
'name': "First 2000 € of SAJ/2014/001",
|
||||
'journal_id': journal.id,
|
||||
'amount': 2000.0,
|
||||
'date': time.strftime('%Y')+'-01-01',
|
||||
'partner_id': ref('base.res_partner_12'),
|
||||
}
|
||||
self._update('account.bank.statement.line', 'account', vals, 'demo_bank_statement_line_4')
|
||||
vals = {
|
||||
'ref': '',
|
||||
'statement_id': ref('account.demo_bank_statement_1'),
|
||||
'sequence': 5,
|
||||
'name': "Last Year Interests",
|
||||
'journal_id': journal.id,
|
||||
'amount': 102.78,
|
||||
'date': time.strftime('%Y')+'-01-01',
|
||||
}
|
||||
self._update('account.bank.statement.line', 'account', vals, 'demo_bank_statement_line_5')
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- TAGS FOR RETRIEVING THE DEMO ACCOUNTS -->
|
||||
|
||||
<record id="demo_capital_account" model="account.account.tag">
|
||||
<field name="name">Demo Capital Account</field>
|
||||
</record>
|
||||
<record id="demo_stock_account" model="account.account.tag">
|
||||
<field name="name">Demo Stock Account</field>
|
||||
</record>
|
||||
<record id="demo_sale_of_land_account" model="account.account.tag">
|
||||
<field name="name">Demo Sale of Land Account</field>
|
||||
</record>
|
||||
<record id="demo_ceo_wages_account" model="account.account.tag">
|
||||
<field name="name">Demo CEO Wages Account</field>
|
||||
</record>
|
||||
<record id="demo_coffee_machine_account" model="account.account.tag">
|
||||
<field name="name">Demo Coffe Machine Account</field>
|
||||
</record>
|
||||
<!-- Payment Terms -->
|
||||
|
||||
<record id="account_payment_term" model="account.payment.term">
|
||||
<field name="name">End of Following Month</field>
|
||||
<field name="note">Payment terms: End of Following Month</field>
|
||||
<field name="line_ids" eval="[(5, 0), (0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 500, 'days': 0, 'option': 'last_day_following_month'})]"/>
|
||||
</record>
|
||||
|
||||
<record id="account_payment_term_advance" model="account.payment.term">
|
||||
<field name="name">30% Advance End of Following Month</field>
|
||||
<field name="note">Payment terms: 30% Advance End of Following Month</field>
|
||||
<field name="line_ids" eval="[(5, 0), (0, 0, {'value': 'percent', 'value_amount': 30.0, 'sequence': 400, 'days': 0, 'option': 'day_after_invoice_date'}),
|
||||
(0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 500, 'days': 0, 'option': 'last_day_following_month'})]"/>
|
||||
</record>
|
||||
|
||||
<record id="base.user_demo" model="res.users">
|
||||
<field name="groups_id" eval="[(4,ref('account.group_account_invoice'))]"/>
|
||||
</record>
|
||||
|
||||
<!-- Add Payment terms on some demo partners -->
|
||||
<record id="base.res_partner_2" model="res.partner">
|
||||
<field name="property_payment_term_id" ref="account.account_payment_term_net"/>
|
||||
</record>
|
||||
<record id="base.res_partner_12" model="res.partner">
|
||||
<field name="property_payment_term_id" ref="account_payment_term"/>
|
||||
<field name="property_supplier_payment_term_id" ref="account_payment_term"/>
|
||||
</record>
|
||||
<record id="base.res_partner_4" model="res.partner">
|
||||
<field name="property_supplier_payment_term_id" ref="account.account_payment_term_net"/>
|
||||
</record>
|
||||
<record id="base.res_partner_1" model="res.partner">
|
||||
<field name="property_supplier_payment_term_id" ref="account_payment_term"/>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
-
|
||||
Set the context for customer invoices because the 'type' field is readonly in invoice form views, so it value won't be considered by the yaml import
|
||||
-
|
||||
!record {model: account.invoice, id: demo_invoice_1}:
|
||||
partner_id: base.res_partner_12
|
||||
user_id: base.user_demo
|
||||
reference_type: none
|
||||
payment_term_id: account.account_payment_term
|
||||
type: 'out_invoice'
|
||||
date_invoice: !eval time.strftime('%Y-%m')+'-01'
|
||||
invoice_line_ids:
|
||||
- product_id: product.consu_delivery_02
|
||||
price_unit: 642.0
|
||||
quantity: 5
|
||||
- product_id: product.consu_delivery_03
|
||||
price_unit: 280.0
|
||||
quantity: 5.0
|
||||
-
|
||||
!python {model: account.invoice, id: demo_invoice_1}:
|
||||
self.action_invoice_open()
|
||||
-
|
||||
!record {model: account.invoice, id: demo_invoice_2}:
|
||||
partner_id: base.res_partner_2
|
||||
type: 'out_invoice'
|
||||
date_invoice: !eval time.strftime('%Y-%m')+'-08'
|
||||
invoice_line_ids:
|
||||
- product_id: product.consu_delivery_03
|
||||
price_unit: 50.0
|
||||
quantity: 3
|
||||
- product_id: product.consu_delivery_01
|
||||
price_unit: 25
|
||||
quantity: 20
|
||||
-
|
||||
!python {model: account.invoice, id: demo_invoice_2}:
|
||||
self.action_invoice_open()
|
||||
-
|
||||
!record {model: account.invoice, id: demo_invoice_3}:
|
||||
partner_id: base.res_partner_2
|
||||
type: 'out_invoice'
|
||||
date_invoice: !eval time.strftime('%Y-%m')+'-08'
|
||||
invoice_line_ids:
|
||||
- product_id: product.consu_delivery_01
|
||||
price_unit: 90.0
|
||||
quantity: 5
|
||||
- product_id: product.consu_delivery_03
|
||||
price_unit: 15.0
|
||||
quantity: 5.0
|
||||
-
|
||||
!python {model: account.invoice, id: demo_invoice_3}:
|
||||
self.action_invoice_open()
|
||||
-
|
||||
Create an invoice that will generate a followup
|
||||
-
|
||||
!record {model: account.invoice, id: demo_invoice_followup}:
|
||||
partner_id: base.res_partner_2
|
||||
user_id: base.user_demo
|
||||
reference_type: none
|
||||
payment_term_id: account.account_payment_term_immediate
|
||||
type: 'out_invoice'
|
||||
date_invoice: !eval (datetime.today() + timedelta(days=-15)).strftime('%Y-%m-%d')
|
||||
invoice_line_ids:
|
||||
- product_id: product.consu_delivery_02
|
||||
price_unit: 642.0
|
||||
quantity: 5
|
||||
- product_id: product.consu_delivery_03
|
||||
price_unit: 280.0
|
||||
quantity: 5.0
|
||||
-
|
||||
!python {model: account.invoice, id: demo_invoice_followup}:
|
||||
self.action_invoice_open()
|
||||
-
|
||||
Set the context for supplier bills because the 'type' field is readonly in invoice form views, so it value won't be considered by the yaml import
|
||||
-
|
||||
!context
|
||||
type: 'in_invoice'
|
||||
-
|
||||
!record {model: account.invoice, id: demo_invoice_0}:
|
||||
partner_id: base.res_partner_12
|
||||
user_id: base.user_demo
|
||||
reference_type: none
|
||||
payment_term_id: account.account_payment_term
|
||||
type: 'in_invoice'
|
||||
date_invoice: !eval time.strftime('%Y-%m')+'-01'
|
||||
invoice_line_ids:
|
||||
- price_unit: 10.0
|
||||
quantity: 1.0
|
||||
product_id: product.product_delivery_01
|
||||
uom_id: product.product_uom_unit
|
||||
- price_unit: 4.0
|
||||
quantity: 1.0
|
||||
product_id: product.product_order_01
|
||||
uom_id: product.product_uom_unit
|
||||
-
|
||||
!record {model: account.invoice, id: demo_invoice_january_wages}:
|
||||
partner_id: base.res_partner_12
|
||||
type: 'in_invoice'
|
||||
date_invoice: !eval time.strftime('%Y-%m')+'-01'
|
||||
-
|
||||
!python {model: ir.model.data, id: False} : |
|
||||
line_vals = {
|
||||
'invoice_id': ref('demo_invoice_january_wages'),
|
||||
'name': "CEO wages",
|
||||
'price_unit': 10000,
|
||||
}
|
||||
default_company = self.env['res.company']._company_default_get('account.account')
|
||||
account = self.env['account.account'].search([('tag_ids', 'in', [ref('account.demo_ceo_wages_account')]), ('company_id', '=', default_company.id)], limit=1)
|
||||
if not account:
|
||||
account = self.env['account.account'].search([('user_type_id', '=', ref('account.data_account_type_expenses')), ('company_id', '=', default_company.id)], limit=1)
|
||||
if account:
|
||||
line_vals['account_id'] = account.id
|
||||
self._update('account.invoice.line', 'account', line_vals, 'ceo_wages_line')
|
||||
self.env['account.invoice'].browse(ref('demo_invoice_january_wages')).action_invoice_open()
|
||||
-
|
||||
!record {model: account.invoice, id: demo_invoice_equipment_purchase}:
|
||||
partner_id: base.res_partner_1
|
||||
type: 'in_invoice'
|
||||
date_invoice: !eval time.strftime('%Y-%m')+'-15'
|
||||
-
|
||||
!python {model: ir.model.data, id: False} : |
|
||||
line_vals = {
|
||||
'invoice_id': ref('demo_invoice_equipment_purchase'),
|
||||
'name': "Coffee Machine with huge 'employee\'s performances boosting perk'",
|
||||
'price_unit': 4999.99,
|
||||
}
|
||||
account_default_company = self.env['res.company']._company_default_get('account.account')
|
||||
account_id = self.env['account.account'].search([('tag_ids', 'in', [ref('account.demo_coffee_machine_account')]), ('company_id', '=', account_default_company.id)], limit=1).id
|
||||
if not account_id:
|
||||
account_id = self.env['account.account'].search([('user_type_id', '=', ref('account.data_account_type_expenses')), ('company_id', '=', account_default_company.id)], limit=1).id
|
||||
if account_id:
|
||||
line_vals['account_id'] = account_id
|
||||
tax_default_company = self.env['res.company']._company_default_get('account.tax')
|
||||
tax_id = self.env['account.tax'].search([('type_tax_use', '=', 'purchase'), ('amount', '>', 0), ('company_id', '=', tax_default_company.id)], limit=1).id
|
||||
if tax_id:
|
||||
line_vals['invoice_line_tax_ids'] = [(6, 0, [tax_id])]
|
||||
self._update('account.invoice.line', 'account', line_vals, 'coffee_machine_line')
|
||||
self.env['account.invoice'].browse(ref('demo_invoice_equipment_purchase'))._onchange_invoice_line_ids()
|
||||
self.env['account.invoice'].browse(ref('demo_invoice_equipment_purchase')).action_invoice_open()
|
||||
|
||||
-
|
||||
!python {model: account.bank.statement.line, id: False} : |
|
||||
default_company = self.env['res.company']._company_default_get('account.account')
|
||||
account = self.env['account.account'].search([
|
||||
('user_type_id', '=', ref('account.data_account_type_revenue')),
|
||||
('tag_ids', 'in', [ref('account.account_tag_financing')]),
|
||||
('company_id', '=', default_company.id)], limit=1)
|
||||
line = self.env.ref('account.demo_bank_statement_line_5')
|
||||
if not line.journal_entry_ids and account:
|
||||
line.write({'account_id': account.id})
|
||||
line.fast_counterpart_creation()
|
||||
-
|
||||
!python {model: ir.model.data, id: False} : |
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
default_company = self.env['res.company']._company_default_get('account.journal')
|
||||
vals = {
|
||||
'journal_id': self.env['account.journal'].search([('type', '=', 'general'), ('company_id', '=', default_company.id)], limit=1).id,
|
||||
'date': datetime.now().replace(day=1,month=1) - relativedelta(days=1),
|
||||
'ref': 'Company Creation',
|
||||
}
|
||||
self._update('account.move', 'account', vals, 'demo_opening_move')
|
||||
-
|
||||
!python {model: ir.model.data, id: False} : |
|
||||
journal_default_company = self.env['res.company']._company_default_get('account.journal')
|
||||
bank_journal = self.env['account.journal'].search([('type', '=', 'bank'), ('company_id', '=', journal_default_company.id)], limit=1)
|
||||
if bank_journal:
|
||||
bank_account_id = bank_journal.default_debit_account_id.id
|
||||
account_default_company = self.env['res.company']._company_default_get('account.account')
|
||||
fixed_asset_account_id = self.env['account.account'].search([('user_type_id', 'in', (ref('account.data_account_type_fixed_assets'),ref('account.data_account_type_current_assets'))), ('company_id', '=', account_default_company.id)], limit=1).id
|
||||
equity_account_id = self.env['account.account'].search([('user_type_id', '=', ref('account.data_account_type_equity')), ('tag_ids', 'in', [ref('account.demo_capital_account')]), ('company_id', '=', account_default_company.id)], limit=1).id
|
||||
if bank_account_id and fixed_asset_account_id and equity_account_id:
|
||||
self.with_context({'check_move_validity': False})._update('account.move.line', 'account', {
|
||||
'move_id': ref('account.demo_opening_move'),
|
||||
'name': 'Opening Entry',
|
||||
'debit': 5103,
|
||||
'account_id': bank_account_id}, 'opening_line_1')
|
||||
self.with_context({'check_move_validity': False})._update('account.move.line', 'account', {
|
||||
'move_id': ref('account.demo_opening_move'),
|
||||
'name': 'Opening Entry',
|
||||
'debit': 13447,
|
||||
'account_id': fixed_asset_account_id}, 'opening_line_2')
|
||||
self.with_context({'check_move_validity': False})._update('account.move.line', 'account', {
|
||||
'move_id': ref('account.demo_opening_move'),
|
||||
'name': 'Opening Entry',
|
||||
'credit': 18550,
|
||||
'account_id': equity_account_id}, 'opening_line_3')
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
-
|
||||
!python {model: ir.model.data, id: False} : |
|
||||
account_id = self.env['account.account'].search([('user_type_id', '=', ref('account.data_account_type_expenses')), ('tag_ids', '=', ref('account_tag_operating'))], limit=1).id
|
||||
vals = {
|
||||
'name': "Discount For Early Payment",
|
||||
'label': 'Discount',
|
||||
'amount_type': 'percentage',
|
||||
'amount': -7,
|
||||
}
|
||||
if account_id:
|
||||
vals['account_id'] = account_id
|
||||
self._update(cr, uid, 'account.reconcile.model', 'account', vals, 'account_reconcile_model_1')
|
||||
-
|
||||
!python {model: ir.model.data, id: False} : |
|
||||
account_id = self.env['account.account'].search([('user_type_id', '=', ref('account.data_account_type_expenses')), ('tag_ids', '=', ref('account_tag_operating'))], limit=1).id
|
||||
vals = {
|
||||
'name': "Bank Fees",
|
||||
'label': 'Bank Fees',
|
||||
'amount_type': 'percentage',
|
||||
'amount': 100.0,
|
||||
}
|
||||
if account_id:
|
||||
vals['account_id'] = account_id
|
||||
self._update(cr, uid, 'account.reconcile.model', 'account', vals, 'account_reconcile_model_2')
|
||||
-
|
||||
!python {model: ir.model.data, id: False} : |
|
||||
account_id = self.env['account.account'].search([('user_type_id', '=', ref('account.data_account_type_revenue')), ('tag_ids', '=', ref('account_tag_operating'))], limit=1).id
|
||||
vals = {
|
||||
'name': "Profit / Loss",
|
||||
'label': 'Profit / Loss',
|
||||
'amount_type': 'percentage',
|
||||
'amount': 100.0,
|
||||
}
|
||||
if account_id:
|
||||
vals['account_id'] = account_id
|
||||
self._update(cr, uid, 'account.reconcile.model', 'account', vals, 'account_reconcile_model_3')
|
||||
-
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import partner
|
||||
from . import account
|
||||
from . import account_payment
|
||||
from . import account_invoice
|
||||
from . import account_bank_statement
|
||||
from . import account_move
|
||||
from . import chart_template
|
||||
from . import account_analytic_line
|
||||
from . import account_journal_dashboard
|
||||
from . import product
|
||||
from . import company
|
||||
from . import res_config_settings
|
||||
from . import web_planner
|
||||
from . import account_cash_rounding
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,59 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from math import copysign
|
||||
|
||||
|
||||
class AccountAnalyticLine(models.Model):
|
||||
_inherit = 'account.analytic.line'
|
||||
_description = 'Analytic Line'
|
||||
_order = 'date desc'
|
||||
|
||||
amount = fields.Monetary(currency_field='company_currency_id')
|
||||
product_uom_id = fields.Many2one('product.uom', string='Unit of Measure')
|
||||
product_id = fields.Many2one('product.product', string='Product')
|
||||
general_account_id = fields.Many2one('account.account', string='Financial Account', ondelete='restrict', readonly=True,
|
||||
related='move_id.account_id', store=True, domain=[('deprecated', '=', False)])
|
||||
move_id = fields.Many2one('account.move.line', string='Move Line', ondelete='cascade', index=True)
|
||||
code = fields.Char(size=8)
|
||||
ref = fields.Char(string='Ref.')
|
||||
company_currency_id = fields.Many2one('res.currency', related='company_id.currency_id', readonly=True,
|
||||
help='Utility field to express amount currency')
|
||||
currency_id = fields.Many2one('res.currency', related='move_id.currency_id', string='Account Currency', store=True, help="The related account currency if not equal to the company one.", readonly=True)
|
||||
amount_currency = fields.Monetary(related='move_id.amount_currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True)
|
||||
analytic_amount_currency = fields.Monetary(string='Amount Currency', compute="_get_analytic_amount_currency", help="The amount expressed in the related account currency if not equal to the company one.", readonly=True)
|
||||
partner_id = fields.Many2one('res.partner', related='account_id.partner_id', string='Partner', store=True, readonly=True)
|
||||
|
||||
def _get_analytic_amount_currency(self):
|
||||
for line in self:
|
||||
line.analytic_amount_currency = abs(line.amount_currency) * copysign(1, line.amount)
|
||||
|
||||
@api.v8
|
||||
@api.onchange('product_id', 'product_uom_id', 'unit_amount', 'currency_id')
|
||||
def on_change_unit_amount(self):
|
||||
if not self.product_id:
|
||||
return {}
|
||||
|
||||
result = 0.0
|
||||
prod_accounts = self.product_id.product_tmpl_id._get_product_accounts()
|
||||
unit = self.product_uom_id
|
||||
account = prod_accounts['expense']
|
||||
if not unit or self.product_id.uom_po_id.category_id.id != unit.category_id.id:
|
||||
unit = self.product_id.uom_po_id
|
||||
|
||||
# Compute based on pricetype
|
||||
amount_unit = self.product_id.price_compute('standard_price', uom=unit)[self.product_id.id]
|
||||
amount = amount_unit * self.unit_amount or 0.0
|
||||
result = self.currency_id.round(amount) * -1
|
||||
self.amount = result
|
||||
self.general_account_id = account
|
||||
self.product_uom_id = unit
|
||||
|
||||
@api.model
|
||||
def view_header_get(self, view_id, view_type):
|
||||
context = (self._context or {})
|
||||
header = False
|
||||
if context.get('account_id', False):
|
||||
analytic_account = self.env['account.analytic.account'].search([('id', '=', context['account_id'])], limit=1)
|
||||
header = _('Entries: ') + (analytic_account.name or '')
|
||||
return header
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,47 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.tools import float_round
|
||||
|
||||
|
||||
class AccountCashRounding(models.Model):
|
||||
"""
|
||||
In some countries, we need to be able to make appear on an invoice a rounding line, appearing there only because the
|
||||
smallest coinage has been removed from the circulation. For example, in Switerzland invoices have to be rounded to
|
||||
0.05 CHF because coins of 0.01 CHF and 0.02 CHF aren't used anymore.
|
||||
see https://en.wikipedia.org/wiki/Cash_rounding for more details.
|
||||
"""
|
||||
_name = 'account.cash.rounding'
|
||||
_description = 'Account Rounding'
|
||||
|
||||
name = fields.Char(string='Name', translate=True, required=True)
|
||||
rounding = fields.Float(string='Rounding Precision', required=True,
|
||||
help='Represent the non-zero value smallest coinage (for example, 0.05).')
|
||||
strategy = fields.Selection([('biggest_tax', 'Modify tax amount'), ('add_invoice_line', 'Add a rounding line')],
|
||||
string='Rounding Strategy', default='add_invoice_line', required=True,
|
||||
help='Specify which way will be used to round the invoice amount to the rounding precision')
|
||||
account_id = fields.Many2one('account.account', string='Account')
|
||||
rounding_method = fields.Selection(string='Rounding Method', required=True,
|
||||
selection=[('UP', 'UP'), ('DOWN', 'DOWN'), ('HALF-UP', 'HALF-UP')],
|
||||
default='HALF-UP', help='The tie-breaking rule used for float rounding operations')
|
||||
|
||||
@api.multi
|
||||
def round(self, amount):
|
||||
"""Compute the rounding on the amount passed as parameter.
|
||||
|
||||
:param amount: the amount to round
|
||||
:return: the rounded amount depending the rounding value and the rounding method
|
||||
"""
|
||||
return float_round(amount, precision_rounding=self.rounding, rounding_method=self.rounding_method)
|
||||
|
||||
@api.multi
|
||||
def compute_difference(self, currency, amount):
|
||||
"""Compute the difference between the base_amount and the amount after rounding.
|
||||
For example, base_amount=23.91, after rounding=24.00, the result will be 0.09.
|
||||
|
||||
:param currency: The currency.
|
||||
:param amount: The amount
|
||||
:return: round(difference)
|
||||
"""
|
||||
difference = self.round(amount) - amount
|
||||
return currency.round(difference)
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,442 @@
|
|||
import json
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from babel.dates import format_datetime, format_date
|
||||
|
||||
from odoo import models, api, _, fields
|
||||
from odoo.release import version
|
||||
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DF
|
||||
from odoo.tools.misc import formatLang
|
||||
|
||||
class account_journal(models.Model):
|
||||
_inherit = "account.journal"
|
||||
|
||||
@api.one
|
||||
def _kanban_dashboard(self):
|
||||
self.kanban_dashboard = json.dumps(self.get_journal_dashboard_datas())
|
||||
|
||||
@api.one
|
||||
def _kanban_dashboard_graph(self):
|
||||
if (self.type in ['sale', 'purchase']):
|
||||
self.kanban_dashboard_graph = json.dumps(self.get_bar_graph_datas())
|
||||
elif (self.type in ['cash', 'bank']):
|
||||
self.kanban_dashboard_graph = json.dumps(self.get_line_graph_datas())
|
||||
|
||||
kanban_dashboard = fields.Text(compute='_kanban_dashboard')
|
||||
kanban_dashboard_graph = fields.Text(compute='_kanban_dashboard_graph')
|
||||
show_on_dashboard = fields.Boolean(string='Show journal on dashboard', help="Whether this journal should be displayed on the dashboard or not", default=True)
|
||||
color = fields.Integer("Color Index", default=0)
|
||||
account_setup_bank_data_done = fields.Boolean(string='Bank setup marked as done', related='company_id.account_setup_bank_data_done', help="Technical field used in the special view for the setup bar step.")
|
||||
|
||||
def _graph_title_and_key(self):
|
||||
if self.type == 'sale':
|
||||
return ['', _('Sales: Untaxed Total')]
|
||||
elif self.type == 'purchase':
|
||||
return ['', _('Purchase: Untaxed Total')]
|
||||
elif self.type == 'cash':
|
||||
return ['', _('Cash: Balance')]
|
||||
elif self.type == 'bank':
|
||||
return ['', _('Bank: Balance')]
|
||||
|
||||
@api.multi
|
||||
def get_line_graph_datas(self):
|
||||
data = []
|
||||
today = datetime.today()
|
||||
last_month = today + timedelta(days=-30)
|
||||
bank_stmt = []
|
||||
# Query to optimize loading of data for bank statement graphs
|
||||
# Return a list containing the latest bank statement balance per day for the
|
||||
# last 30 days for current journal
|
||||
query = """SELECT a.date, a.balance_end
|
||||
FROM account_bank_statement AS a,
|
||||
(SELECT c.date, max(c.id) AS stmt_id
|
||||
FROM account_bank_statement AS c
|
||||
WHERE c.journal_id = %s
|
||||
AND c.date > %s
|
||||
AND c.date <= %s
|
||||
GROUP BY date, id
|
||||
ORDER BY date, id) AS b
|
||||
WHERE a.id = b.stmt_id;"""
|
||||
|
||||
self.env.cr.execute(query, (self.id, last_month, today))
|
||||
bank_stmt = self.env.cr.dictfetchall()
|
||||
|
||||
last_bank_stmt = self.env['account.bank.statement'].search([('journal_id', 'in', self.ids),('date', '<=', last_month.strftime(DF))], order="date desc, id desc", limit=1)
|
||||
start_balance = last_bank_stmt and last_bank_stmt[0].balance_end or 0
|
||||
|
||||
locale = self._context.get('lang') or 'en_US'
|
||||
show_date = last_month
|
||||
#get date in locale format
|
||||
name = format_date(show_date, 'd LLLL Y', locale=locale)
|
||||
short_name = format_date(show_date, 'd MMM', locale=locale)
|
||||
data.append({'x':short_name,'y':start_balance, 'name':name})
|
||||
|
||||
for stmt in bank_stmt:
|
||||
#fill the gap between last data and the new one
|
||||
number_day_to_add = (datetime.strptime(stmt.get('date'), DF) - show_date).days
|
||||
last_balance = data[len(data) - 1]['y']
|
||||
for day in range(0,number_day_to_add + 1):
|
||||
show_date = show_date + timedelta(days=1)
|
||||
#get date in locale format
|
||||
name = format_date(show_date, 'd LLLL Y', locale=locale)
|
||||
short_name = format_date(show_date, 'd MMM', locale=locale)
|
||||
data.append({'x': short_name, 'y':last_balance, 'name': name})
|
||||
#add new stmt value
|
||||
data[len(data) - 1]['y'] = stmt.get('balance_end')
|
||||
|
||||
#continue the graph if the last statement isn't today
|
||||
if show_date != today:
|
||||
number_day_to_add = (today - show_date).days
|
||||
last_balance = data[len(data) - 1]['y']
|
||||
for day in range(0,number_day_to_add):
|
||||
show_date = show_date + timedelta(days=1)
|
||||
#get date in locale format
|
||||
name = format_date(show_date, 'd LLLL Y', locale=locale)
|
||||
short_name = format_date(show_date, 'd MMM', locale=locale)
|
||||
data.append({'x': short_name, 'y':last_balance, 'name': name})
|
||||
|
||||
[graph_title, graph_key] = self._graph_title_and_key()
|
||||
color = '#875A7B' if '+e' in version else '#7c7bad'
|
||||
return [{'values': data, 'title': graph_title, 'key': graph_key, 'area': True, 'color': color}]
|
||||
|
||||
@api.multi
|
||||
def get_bar_graph_datas(self):
|
||||
data = []
|
||||
today = datetime.strptime(fields.Date.context_today(self), DF)
|
||||
data.append({'label': _('Past'), 'value':0.0, 'type': 'past'})
|
||||
day_of_week = int(format_datetime(today, 'e', locale=self._context.get('lang') or 'en_US'))
|
||||
first_day_of_week = today + timedelta(days=-day_of_week+1)
|
||||
for i in range(-1,4):
|
||||
if i==0:
|
||||
label = _('This Week')
|
||||
elif i==3:
|
||||
label = _('Future')
|
||||
else:
|
||||
start_week = first_day_of_week + timedelta(days=i*7)
|
||||
end_week = start_week + timedelta(days=6)
|
||||
if start_week.month == end_week.month:
|
||||
label = str(start_week.day) + '-' +str(end_week.day)+ ' ' + format_date(end_week, 'MMM', locale=self._context.get('lang') or 'en_US')
|
||||
else:
|
||||
label = format_date(start_week, 'd MMM', locale=self._context.get('lang') or 'en_US')+'-'+format_date(end_week, 'd MMM', locale=self._context.get('lang') or 'en_US')
|
||||
data.append({'label':label,'value':0.0, 'type': 'past' if i<0 else 'future'})
|
||||
|
||||
# Build SQL query to find amount aggregated by week
|
||||
(select_sql_clause, query_args) = self._get_bar_graph_select_query()
|
||||
query = ''
|
||||
start_date = (first_day_of_week + timedelta(days=-7))
|
||||
for i in range(0,6):
|
||||
if i == 0:
|
||||
query += "("+select_sql_clause+" and date < '"+start_date.strftime(DF)+"')"
|
||||
elif i == 5:
|
||||
query += " UNION ALL ("+select_sql_clause+" and date >= '"+start_date.strftime(DF)+"')"
|
||||
else:
|
||||
next_date = start_date + timedelta(days=7)
|
||||
query += " UNION ALL ("+select_sql_clause+" and date >= '"+start_date.strftime(DF)+"' and date < '"+next_date.strftime(DF)+"')"
|
||||
start_date = next_date
|
||||
|
||||
self.env.cr.execute(query, query_args)
|
||||
query_results = self.env.cr.dictfetchall()
|
||||
for index in range(0, len(query_results)):
|
||||
if query_results[index].get('aggr_date') != None:
|
||||
data[index]['value'] = query_results[index].get('total')
|
||||
|
||||
[graph_title, graph_key] = self._graph_title_and_key()
|
||||
return [{'values': data, 'title': graph_title, 'key': graph_key}]
|
||||
|
||||
def _get_bar_graph_select_query(self):
|
||||
"""
|
||||
Returns a tuple containing the base SELECT SQL query used to gather
|
||||
the bar graph's data as its first element, and the arguments dictionary
|
||||
for it as its second.
|
||||
"""
|
||||
return ("""SELECT sum(residual_company_signed) as total, min(date) as aggr_date
|
||||
FROM account_invoice
|
||||
WHERE journal_id = %(journal_id)s and state = 'open'""", {'journal_id':self.id})
|
||||
|
||||
@api.multi
|
||||
def get_journal_dashboard_datas(self):
|
||||
currency = self.currency_id or self.company_id.currency_id
|
||||
number_to_reconcile = last_balance = account_sum = 0
|
||||
title = ''
|
||||
number_draft = number_waiting = number_late = 0
|
||||
sum_draft = sum_waiting = sum_late = 0.0
|
||||
if self.type in ['bank', 'cash']:
|
||||
last_bank_stmt = self.env['account.bank.statement'].search([('journal_id', 'in', self.ids)], order="date desc, id desc", limit=1)
|
||||
last_balance = last_bank_stmt and last_bank_stmt[0].balance_end or 0
|
||||
#Get the number of items to reconcile for that bank journal
|
||||
self.env.cr.execute("""SELECT COUNT(DISTINCT(line.id))
|
||||
FROM account_bank_statement_line AS line
|
||||
LEFT JOIN account_bank_statement AS st
|
||||
ON line.statement_id = st.id
|
||||
WHERE st.journal_id IN %s AND st.state = 'open' AND line.amount != 0.0
|
||||
AND not exists (select 1 from account_move_line aml where aml.statement_line_id = line.id)
|
||||
""", (tuple(self.ids),))
|
||||
number_to_reconcile = self.env.cr.fetchone()[0]
|
||||
# optimization to read sum of balance from account_move_line
|
||||
account_ids = tuple(ac for ac in [self.default_debit_account_id.id, self.default_credit_account_id.id] if ac)
|
||||
if account_ids:
|
||||
amount_field = 'balance' if (not self.currency_id or self.currency_id == self.company_id.currency_id) else 'amount_currency'
|
||||
query = """SELECT sum(%s) FROM account_move_line WHERE account_id in %%s AND date <= %%s;""" % (amount_field,)
|
||||
self.env.cr.execute(query, (account_ids, fields.Date.today(),))
|
||||
query_results = self.env.cr.dictfetchall()
|
||||
if query_results and query_results[0].get('sum') != None:
|
||||
account_sum = query_results[0].get('sum')
|
||||
#TODO need to check if all invoices are in the same currency than the journal!!!!
|
||||
elif self.type in ['sale', 'purchase']:
|
||||
title = _('Bills to pay') if self.type == 'purchase' else _('Invoices owed to you')
|
||||
|
||||
(query, query_args) = self._get_open_bills_to_pay_query()
|
||||
self.env.cr.execute(query, query_args)
|
||||
query_results_to_pay = self.env.cr.dictfetchall()
|
||||
|
||||
(query, query_args) = self._get_draft_bills_query()
|
||||
self.env.cr.execute(query, query_args)
|
||||
query_results_drafts = self.env.cr.dictfetchall()
|
||||
|
||||
today = datetime.today()
|
||||
query = """SELECT amount_total, currency_id AS currency, type FROM account_invoice WHERE journal_id = %s AND date < %s AND state = 'open';"""
|
||||
self.env.cr.execute(query, (self.id, today))
|
||||
late_query_results = self.env.cr.dictfetchall()
|
||||
(number_waiting, sum_waiting) = self._count_results_and_sum_amounts(query_results_to_pay, currency)
|
||||
(number_draft, sum_draft) = self._count_results_and_sum_amounts(query_results_drafts, currency)
|
||||
(number_late, sum_late) = self._count_results_and_sum_amounts(late_query_results, currency)
|
||||
|
||||
return {
|
||||
'number_to_reconcile': number_to_reconcile,
|
||||
'account_balance': formatLang(self.env, account_sum, currency_obj=self.currency_id or self.company_id.currency_id),
|
||||
'last_balance': formatLang(self.env, last_balance, currency_obj=self.currency_id or self.company_id.currency_id),
|
||||
'difference': (last_balance-account_sum) and formatLang(self.env, last_balance-account_sum, currency_obj=self.currency_id or self.company_id.currency_id) or False,
|
||||
'number_draft': number_draft,
|
||||
'number_waiting': number_waiting,
|
||||
'number_late': number_late,
|
||||
'sum_draft': formatLang(self.env, sum_draft or 0.0, currency_obj=self.currency_id or self.company_id.currency_id),
|
||||
'sum_waiting': formatLang(self.env, sum_waiting or 0.0, currency_obj=self.currency_id or self.company_id.currency_id),
|
||||
'sum_late': formatLang(self.env, sum_late or 0.0, currency_obj=self.currency_id or self.company_id.currency_id),
|
||||
'currency_id': self.currency_id and self.currency_id.id or self.company_id.currency_id.id,
|
||||
'bank_statements_source': self.bank_statements_source,
|
||||
'title': title,
|
||||
}
|
||||
|
||||
def _get_open_bills_to_pay_query(self):
|
||||
"""
|
||||
Returns a tuple contaning the SQL query used to gather the open bills
|
||||
data as its first element, and the arguments dictionary to use to run
|
||||
it as its second.
|
||||
"""
|
||||
return ("""SELECT state, amount_total, currency_id AS currency
|
||||
FROM account_invoice
|
||||
WHERE journal_id = %(journal_id)s AND state = 'open';""", {'journal_id':self.id})
|
||||
|
||||
def _get_draft_bills_query(self):
|
||||
"""
|
||||
Returns a tuple containing as its first element the SQL query used to
|
||||
gather the bills in draft state data, and the arguments
|
||||
dictionary to use to run it as its second.
|
||||
"""
|
||||
return ("""SELECT state, amount_total, currency_id AS currency
|
||||
FROM account_invoice
|
||||
WHERE journal_id = %(journal_id)s AND state = 'draft';""", {'journal_id':self.id})
|
||||
|
||||
def _count_results_and_sum_amounts(self, results_dict, target_currency):
|
||||
""" Loops on a query result to count the total number of invoices and sum
|
||||
their amount_total field (expressed in the given target currency).
|
||||
"""
|
||||
rslt_count = 0
|
||||
rslt_sum = 0.0
|
||||
for result in results_dict:
|
||||
cur = self.env['res.currency'].browse(result.get('currency'))
|
||||
rslt_count += 1
|
||||
rslt_sum += cur.compute(result.get('amount_total'), target_currency)
|
||||
return (rslt_count, rslt_sum)
|
||||
|
||||
@api.multi
|
||||
def action_create_new(self):
|
||||
ctx = self._context.copy()
|
||||
model = 'account.invoice'
|
||||
if self.type == 'sale':
|
||||
ctx.update({'journal_type': self.type, 'default_type': 'out_invoice', 'type': 'out_invoice', 'default_journal_id': self.id})
|
||||
if ctx.get('refund'):
|
||||
ctx.update({'default_type':'out_refund', 'type':'out_refund'})
|
||||
view_id = self.env.ref('account.invoice_form').id
|
||||
elif self.type == 'purchase':
|
||||
ctx.update({'journal_type': self.type, 'default_type': 'in_invoice', 'type': 'in_invoice', 'default_journal_id': self.id})
|
||||
if ctx.get('refund'):
|
||||
ctx.update({'default_type': 'in_refund', 'type': 'in_refund'})
|
||||
view_id = self.env.ref('account.invoice_supplier_form').id
|
||||
else:
|
||||
ctx.update({'default_journal_id': self.id, 'view_no_maturity': True})
|
||||
view_id = self.env.ref('account.view_move_form').id
|
||||
model = 'account.move'
|
||||
return {
|
||||
'name': _('Create invoice/bill'),
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': model,
|
||||
'view_id': view_id,
|
||||
'context': ctx,
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def create_cash_statement(self):
|
||||
ctx = self._context.copy()
|
||||
ctx.update({'journal_id': self.id, 'default_journal_id': self.id, 'default_journal_type': 'cash'})
|
||||
return {
|
||||
'name': _('Create cash statement'),
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'account.bank.statement',
|
||||
'context': ctx,
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def action_open_reconcile(self):
|
||||
if self.type in ['bank', 'cash']:
|
||||
# Open reconciliation view for bank statements belonging to this journal
|
||||
bank_stmt = self.env['account.bank.statement'].search([('journal_id', 'in', self.ids)])
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'bank_statement_reconciliation_view',
|
||||
'context': {'statement_ids': bank_stmt.ids, 'company_ids': self.mapped('company_id').ids},
|
||||
}
|
||||
else:
|
||||
# Open reconciliation view for customers/suppliers
|
||||
action_context = {'show_mode_selector': False, 'company_ids': self.mapped('company_id').ids}
|
||||
if self.type == 'sale':
|
||||
action_context.update({'mode': 'customers'})
|
||||
elif self.type == 'purchase':
|
||||
action_context.update({'mode': 'suppliers'})
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'manual_reconciliation_view',
|
||||
'context': action_context,
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def open_action(self):
|
||||
"""return action based on type for related journals"""
|
||||
action_name = self._context.get('action_name', False)
|
||||
if not action_name:
|
||||
if self.type == 'bank':
|
||||
action_name = 'action_bank_statement_tree'
|
||||
elif self.type == 'cash':
|
||||
action_name = 'action_view_bank_statement_tree'
|
||||
elif self.type == 'sale':
|
||||
action_name = 'action_invoice_tree1'
|
||||
elif self.type == 'purchase':
|
||||
action_name = 'action_invoice_tree2'
|
||||
else:
|
||||
action_name = 'action_move_journal_line'
|
||||
|
||||
_journal_invoice_type_map = {
|
||||
('sale', None): 'out_invoice',
|
||||
('purchase', None): 'in_invoice',
|
||||
('sale', 'refund'): 'out_refund',
|
||||
('purchase', 'refund'): 'in_refund',
|
||||
('bank', None): 'bank',
|
||||
('cash', None): 'cash',
|
||||
('general', None): 'general',
|
||||
}
|
||||
invoice_type = _journal_invoice_type_map[(self.type, self._context.get('invoice_type'))]
|
||||
|
||||
ctx = self._context.copy()
|
||||
ctx.pop('group_by', None)
|
||||
ctx.update({
|
||||
'journal_type': self.type,
|
||||
'default_journal_id': self.id,
|
||||
'search_default_journal_id': self.id,
|
||||
'default_type': invoice_type,
|
||||
'type': invoice_type
|
||||
})
|
||||
|
||||
[action] = self.env.ref('account.%s' % action_name).read()
|
||||
action['context'] = ctx
|
||||
action['domain'] = self._context.get('use_domain', [])
|
||||
account_invoice_filter = self.env.ref('account.view_account_invoice_filter', False)
|
||||
if action_name in ['action_invoice_tree1', 'action_invoice_tree2']:
|
||||
action['search_view_id'] = account_invoice_filter and account_invoice_filter.id or False
|
||||
if action_name in ['action_bank_statement_tree', 'action_view_bank_statement_tree']:
|
||||
action['views'] = False
|
||||
action['view_id'] = False
|
||||
return action
|
||||
|
||||
@api.multi
|
||||
def open_spend_money(self):
|
||||
return self.open_payments_action('outbound')
|
||||
|
||||
@api.multi
|
||||
def open_collect_money(self):
|
||||
return self.open_payments_action('inbound')
|
||||
|
||||
@api.multi
|
||||
def open_transfer_money(self):
|
||||
return self.open_payments_action('transfer')
|
||||
|
||||
@api.multi
|
||||
def open_payments_action(self, payment_type):
|
||||
ctx = self._context.copy()
|
||||
ctx.update({
|
||||
'default_payment_type': payment_type,
|
||||
'default_journal_id': self.id
|
||||
})
|
||||
ctx.pop('group_by', None)
|
||||
action_rec = self.env['ir.model.data'].xmlid_to_object('account.action_account_payments')
|
||||
if action_rec:
|
||||
action = action_rec.read([])[0]
|
||||
action['context'] = ctx
|
||||
action['domain'] = [('journal_id','=',self.id),('payment_type','=',payment_type)]
|
||||
return action
|
||||
|
||||
@api.multi
|
||||
def open_action_with_context(self):
|
||||
action_name = self.env.context.get('action_name', False)
|
||||
if not action_name:
|
||||
return False
|
||||
ctx = dict(self.env.context, default_journal_id=self.id)
|
||||
if ctx.get('search_default_journal', False):
|
||||
ctx.update(search_default_journal_id=self.id)
|
||||
ctx.pop('group_by', None)
|
||||
ir_model_obj = self.env['ir.model.data']
|
||||
model, action_id = ir_model_obj.get_object_reference('account', action_name)
|
||||
[action] = self.env[model].browse(action_id).read()
|
||||
action['context'] = ctx
|
||||
if ctx.get('use_domain', False):
|
||||
action['domain'] = ['|', ('journal_id', '=', self.id), ('journal_id', '=', False)]
|
||||
action['name'] += ' for journal ' + self.name
|
||||
return action
|
||||
|
||||
@api.multi
|
||||
def create_bank_statement(self):
|
||||
"""return action to create a bank statements. This button should be called only on journals with type =='bank'"""
|
||||
self.bank_statements_source = 'manual'
|
||||
action = self.env.ref('account.action_bank_statement_tree').read()[0]
|
||||
action.update({
|
||||
'views': [[False, 'form']],
|
||||
'context': "{'default_journal_id': " + str(self.id) + "}",
|
||||
})
|
||||
return action
|
||||
|
||||
#####################
|
||||
# Setup Steps Stuff #
|
||||
#####################
|
||||
@api.model
|
||||
def retrieve_account_dashboard_setup_bar(self):
|
||||
""" Returns the data used by the setup bar on the Accounting app dashboard."""
|
||||
company = self.env.user.company_id
|
||||
return {
|
||||
'show_setup_bar': not company.account_setup_bar_closed,
|
||||
'company': company.account_setup_company_data_done,
|
||||
'bank': company.account_setup_bank_data_done,
|
||||
'fiscal_year': company.account_setup_fy_data_done,
|
||||
'chart_of_accounts': company.account_setup_coa_done,
|
||||
'initial_balance': company.opening_move_posted(),
|
||||
}
|
||||
|
||||
def mark_bank_setup_as_done_action(self):
|
||||
""" Marks the 'bank setup' step as done in the setup bar and in the company."""
|
||||
self.company_id.account_setup_bank_data_done = True
|
||||
|
||||
def unmark_bank_setup_as_done_action(self):
|
||||
""" Marks the 'bank setup' step as not done in the setup bar and in the company."""
|
||||
self.company_id.account_setup_bank_data_done = False
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,695 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
MAP_INVOICE_TYPE_PARTNER_TYPE = {
|
||||
'out_invoice': 'customer',
|
||||
'out_refund': 'customer',
|
||||
'in_invoice': 'supplier',
|
||||
'in_refund': 'supplier',
|
||||
}
|
||||
# Since invoice amounts are unsigned, this is how we know if money comes in or goes out
|
||||
MAP_INVOICE_TYPE_PAYMENT_SIGN = {
|
||||
'out_invoice': 1,
|
||||
'in_refund': -1,
|
||||
'in_invoice': -1,
|
||||
'out_refund': 1,
|
||||
}
|
||||
|
||||
class account_payment_method(models.Model):
|
||||
_name = "account.payment.method"
|
||||
_description = "Payment Methods"
|
||||
|
||||
name = fields.Char(required=True, translate=True)
|
||||
code = fields.Char(required=True) # For internal identification
|
||||
payment_type = fields.Selection([('inbound', 'Inbound'), ('outbound', 'Outbound')], required=True)
|
||||
|
||||
|
||||
class account_abstract_payment(models.AbstractModel):
|
||||
_name = "account.abstract.payment"
|
||||
_description = "Contains the logic shared between models which allows to register payments"
|
||||
|
||||
payment_type = fields.Selection([('outbound', 'Send Money'), ('inbound', 'Receive Money')], string='Payment Type', required=True)
|
||||
payment_method_id = fields.Many2one('account.payment.method', string='Payment Method Type', required=True, oldname="payment_method",
|
||||
help="Manual: Get paid by cash, check or any other method outside of Odoo.\n"\
|
||||
"Electronic: Get paid automatically through a payment acquirer by requesting a transaction on a card saved by the customer when buying or subscribing online (payment token).\n"\
|
||||
"Check: Pay bill by check and print it from Odoo.\n"\
|
||||
"Batch Deposit: Encase several customer checks at once by generating a batch deposit to submit to your bank. When encoding the bank statement in Odoo, you are suggested to reconcile the transaction with the batch deposit.To enable batch deposit,module account_batch_deposit must be installed.\n"\
|
||||
"SEPA Credit Transfer: Pay bill from a SEPA Credit Transfer file you submit to your bank. To enable sepa credit transfer, module account_sepa must be installed ")
|
||||
payment_method_code = fields.Char(related='payment_method_id.code',
|
||||
help="Technical field used to adapt the interface to the payment type selected.", readonly=True)
|
||||
|
||||
partner_type = fields.Selection([('customer', 'Customer'), ('supplier', 'Vendor')])
|
||||
partner_id = fields.Many2one('res.partner', string='Partner')
|
||||
|
||||
amount = fields.Monetary(string='Payment Amount', required=True)
|
||||
currency_id = fields.Many2one('res.currency', string='Currency', required=True, default=lambda self: self.env.user.company_id.currency_id)
|
||||
payment_date = fields.Date(string='Payment Date', default=fields.Date.context_today, required=True, copy=False)
|
||||
communication = fields.Char(string='Memo')
|
||||
journal_id = fields.Many2one('account.journal', string='Payment Journal', required=True, domain=[('type', 'in', ('bank', 'cash'))])
|
||||
company_id = fields.Many2one('res.company', related='journal_id.company_id', string='Company', readonly=True)
|
||||
|
||||
hide_payment_method = fields.Boolean(compute='_compute_hide_payment_method',
|
||||
help="Technical field used to hide the payment method if the selected journal has only one available which is 'manual'")
|
||||
|
||||
@api.one
|
||||
@api.constrains('amount')
|
||||
def _check_amount(self):
|
||||
if self.amount < 0:
|
||||
raise ValidationError(_('The payment amount cannot be negative.'))
|
||||
|
||||
@api.multi
|
||||
@api.depends('payment_type', 'journal_id')
|
||||
def _compute_hide_payment_method(self):
|
||||
for payment in self:
|
||||
if not payment.journal_id:
|
||||
payment.hide_payment_method = True
|
||||
continue
|
||||
journal_payment_methods = payment.payment_type == 'inbound'\
|
||||
and payment.journal_id.inbound_payment_method_ids\
|
||||
or payment.journal_id.outbound_payment_method_ids
|
||||
payment.hide_payment_method = len(journal_payment_methods) == 1 and journal_payment_methods[0].code == 'manual'
|
||||
|
||||
@api.onchange('journal_id')
|
||||
def _onchange_journal(self):
|
||||
if self.journal_id:
|
||||
self.currency_id = self.journal_id.currency_id or self.company_id.currency_id
|
||||
# Set default payment method (we consider the first to be the default one)
|
||||
payment_methods = self.payment_type == 'inbound' and self.journal_id.inbound_payment_method_ids or self.journal_id.outbound_payment_method_ids
|
||||
self.payment_method_id = payment_methods and payment_methods[0] or False
|
||||
# Set payment method domain (restrict to methods enabled for the journal and to selected payment type)
|
||||
payment_type = self.payment_type in ('outbound', 'transfer') and 'outbound' or 'inbound'
|
||||
return {'domain': {'payment_method_id': [('payment_type', '=', payment_type), ('id', 'in', payment_methods.ids)]}}
|
||||
return {}
|
||||
|
||||
@api.model
|
||||
def _compute_total_invoices_amount(self):
|
||||
""" Compute the sum of the residual of invoices, expressed in the payment currency """
|
||||
payment_currency = self.currency_id or self.journal_id.currency_id or self.journal_id.company_id.currency_id or self.env.user.company_id.currency_id
|
||||
|
||||
total = 0
|
||||
for inv in self.invoice_ids:
|
||||
if inv.currency_id == payment_currency:
|
||||
total += inv.residual_signed
|
||||
else:
|
||||
total += inv.company_currency_id.with_context(date=self.payment_date).compute(
|
||||
inv.residual_company_signed, payment_currency)
|
||||
return abs(total)
|
||||
|
||||
|
||||
class account_register_payments(models.TransientModel):
|
||||
_name = "account.register.payments"
|
||||
_inherit = 'account.abstract.payment'
|
||||
_description = "Register payments on multiple invoices"
|
||||
|
||||
invoice_ids = fields.Many2many('account.invoice', string='Invoices', copy=False)
|
||||
multi = fields.Boolean(string='Multi', help='Technical field indicating if the user selected invoices from multiple partners or from different types.')
|
||||
|
||||
@api.onchange('payment_type')
|
||||
def _onchange_payment_type(self):
|
||||
if self.payment_type:
|
||||
return {'domain': {'payment_method_id': [('payment_type', '=', self.payment_type)]}}
|
||||
|
||||
@api.model
|
||||
def _compute_payment_amount(self, invoice_ids):
|
||||
payment_currency = self.currency_id or self.journal_id.currency_id or self.journal_id.company_id.currency_id
|
||||
|
||||
total = 0
|
||||
for inv in invoice_ids:
|
||||
if inv.currency_id == payment_currency:
|
||||
total += MAP_INVOICE_TYPE_PAYMENT_SIGN[inv.type] * inv.residual_company_signed
|
||||
else:
|
||||
amount_residual = inv.company_currency_id.with_context(date=self.payment_date).compute(
|
||||
inv.residual_company_signed, payment_currency)
|
||||
total += MAP_INVOICE_TYPE_PAYMENT_SIGN[inv.type] * amount_residual
|
||||
return total
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields):
|
||||
rec = super(account_register_payments, self).default_get(fields)
|
||||
active_ids = self._context.get('active_ids')
|
||||
|
||||
# Check for selected invoices ids
|
||||
if not active_ids:
|
||||
raise UserError(_("Programming error: wizard action executed without active_ids in context."))
|
||||
|
||||
invoices = self.env['account.invoice'].browse(active_ids)
|
||||
|
||||
# Check all invoices are open
|
||||
if any(invoice.state != 'open' for invoice in invoices):
|
||||
raise UserError(_("You can only register payments for open invoices"))
|
||||
# Check all invoices have the same currency
|
||||
if any(inv.currency_id != invoices[0].currency_id for inv in invoices):
|
||||
raise UserError(_("In order to pay multiple invoices at once, they must use the same currency."))
|
||||
|
||||
# Look if we are mixin multiple commercial_partner or customer invoices with vendor bills
|
||||
multi = any(inv.commercial_partner_id != invoices[0].commercial_partner_id
|
||||
or MAP_INVOICE_TYPE_PARTNER_TYPE[inv.type] != MAP_INVOICE_TYPE_PARTNER_TYPE[invoices[0].type]
|
||||
for inv in invoices)
|
||||
|
||||
total_amount = self._compute_payment_amount(invoices)
|
||||
|
||||
rec.update({
|
||||
'amount': abs(total_amount),
|
||||
'currency_id': invoices[0].currency_id.id,
|
||||
'payment_type': total_amount > 0 and 'inbound' or 'outbound',
|
||||
'partner_id': False if multi else invoices[0].commercial_partner_id.id,
|
||||
'partner_type': False if multi else MAP_INVOICE_TYPE_PARTNER_TYPE[invoices[0].type],
|
||||
'communication': ' '.join([ref for ref in invoices.mapped('reference') if ref]),
|
||||
'invoice_ids': [(6, 0, invoices.ids)],
|
||||
'multi': multi,
|
||||
})
|
||||
return rec
|
||||
|
||||
@api.multi
|
||||
def _groupby_invoices(self):
|
||||
'''Split the invoices linked to the wizard according to their commercial partner and their type.
|
||||
|
||||
:return: a dictionary mapping (commercial_partner_id, type) => invoices recordset.
|
||||
'''
|
||||
results = {}
|
||||
# Create a dict dispatching invoices according to their commercial_partner_id and type
|
||||
for inv in self.invoice_ids:
|
||||
key = (inv.commercial_partner_id.id, MAP_INVOICE_TYPE_PARTNER_TYPE[inv.type])
|
||||
if not key in results:
|
||||
results[key] = self.env['account.invoice']
|
||||
results[key] += inv
|
||||
return results
|
||||
|
||||
@api.multi
|
||||
def _prepare_payment_vals(self, invoices):
|
||||
'''Create the payment values.
|
||||
|
||||
:param invoices: The invoices that should have the same commercial partner and the same type.
|
||||
:return: The payment values as a dictionary.
|
||||
'''
|
||||
amount = self._compute_payment_amount(invoices) if self.multi else self.amount
|
||||
payment_type = ('inbound' if amount > 0 else 'outbound') if self.multi else self.payment_type
|
||||
return {
|
||||
'journal_id': self.journal_id.id,
|
||||
'payment_method_id': self.payment_method_id.id,
|
||||
'payment_date': self.payment_date,
|
||||
'communication': self.communication,
|
||||
'invoice_ids': [(6, 0, invoices.ids)],
|
||||
'payment_type': payment_type,
|
||||
'amount': abs(amount),
|
||||
'currency_id': self.currency_id.id,
|
||||
'partner_id': invoices[0].commercial_partner_id.id,
|
||||
'partner_type': MAP_INVOICE_TYPE_PARTNER_TYPE[invoices[0].type],
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def get_payments_vals(self):
|
||||
'''Compute the values for payments.
|
||||
|
||||
:return: a list of payment values (dictionary).
|
||||
'''
|
||||
if self.multi:
|
||||
groups = self._groupby_invoices()
|
||||
return [self._prepare_payment_vals(invoices) for invoices in groups.values()]
|
||||
return [self._prepare_payment_vals(self.invoice_ids)]
|
||||
|
||||
@api.multi
|
||||
def create_payments(self):
|
||||
'''Create payments according to the invoices.
|
||||
Having invoices with different commercial_partner_id or different type (Vendor bills with customer invoices)
|
||||
leads to multiple payments.
|
||||
In case of all the invoices are related to the same commercial_partner_id and have the same type,
|
||||
only one payment will be created.
|
||||
|
||||
:return: The ir.actions.act_window to show created payments.
|
||||
'''
|
||||
Payment = self.env['account.payment']
|
||||
payments = Payment
|
||||
for payment_vals in self.get_payments_vals():
|
||||
payments += Payment.create(payment_vals)
|
||||
payments.post()
|
||||
return {
|
||||
'name': _('Payments'),
|
||||
'domain': [('id', 'in', payments.ids), ('state', '=', 'posted')],
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.payment',
|
||||
'view_id': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
|
||||
|
||||
class account_payment(models.Model):
|
||||
_name = "account.payment"
|
||||
_inherit = ['mail.thread', 'account.abstract.payment']
|
||||
_description = "Payments"
|
||||
_order = "payment_date desc, name desc"
|
||||
|
||||
@api.one
|
||||
@api.depends('invoice_ids')
|
||||
def _get_has_invoices(self):
|
||||
self.has_invoices = bool(self.invoice_ids)
|
||||
|
||||
@api.multi
|
||||
@api.depends('move_line_ids.reconciled')
|
||||
def _get_move_reconciled(self):
|
||||
for payment in self:
|
||||
rec = True
|
||||
for aml in payment.move_line_ids.filtered(lambda x: x.account_id.reconcile):
|
||||
if not aml.reconciled:
|
||||
rec = False
|
||||
payment.move_reconciled = rec
|
||||
|
||||
@api.one
|
||||
@api.depends('invoice_ids', 'amount', 'payment_date', 'currency_id')
|
||||
def _compute_payment_difference(self):
|
||||
if len(self.invoice_ids) == 0:
|
||||
return
|
||||
if self.invoice_ids[0].type in ['in_invoice', 'out_refund']:
|
||||
self.payment_difference = self.amount - self._compute_total_invoices_amount()
|
||||
else:
|
||||
self.payment_difference = self._compute_total_invoices_amount() - self.amount
|
||||
|
||||
company_id = fields.Many2one(store=True)
|
||||
name = fields.Char(readonly=True, copy=False, default="Draft Payment") # The name is attributed upon post()
|
||||
state = fields.Selection([('draft', 'Draft'), ('posted', 'Posted'), ('sent', 'Sent'), ('reconciled', 'Reconciled'), ('cancelled', 'Cancelled')], readonly=True, default='draft', copy=False, string="Status")
|
||||
|
||||
payment_type = fields.Selection(selection_add=[('transfer', 'Internal Transfer')])
|
||||
payment_reference = fields.Char(copy=False, readonly=True, help="Reference of the document used to issue this payment. Eg. check number, file name, etc.")
|
||||
move_name = fields.Char(string='Journal Entry Name', readonly=True,
|
||||
default=False, copy=False,
|
||||
help="Technical field holding the number given to the journal entry, automatically set when the statement line is reconciled then stored to set the same number again if the line is cancelled, set to draft and re-processed again.")
|
||||
|
||||
# Money flows from the journal_id's default_debit_account_id or default_credit_account_id to the destination_account_id
|
||||
destination_account_id = fields.Many2one('account.account', compute='_compute_destination_account_id', readonly=True)
|
||||
# For money transfer, money goes from journal_id to a transfer account, then from the transfer account to destination_journal_id
|
||||
destination_journal_id = fields.Many2one('account.journal', string='Transfer To', domain=[('type', 'in', ('bank', 'cash'))])
|
||||
|
||||
invoice_ids = fields.Many2many('account.invoice', 'account_invoice_payment_rel', 'payment_id', 'invoice_id', string="Invoices", copy=False, readonly=True)
|
||||
has_invoices = fields.Boolean(compute="_get_has_invoices", help="Technical field used for usability purposes")
|
||||
payment_difference = fields.Monetary(compute='_compute_payment_difference', readonly=True)
|
||||
payment_difference_handling = fields.Selection([('open', 'Keep open'), ('reconcile', 'Mark invoice as fully paid')], default='open', string="Payment Difference", copy=False)
|
||||
writeoff_account_id = fields.Many2one('account.account', string="Difference Account", domain=[('deprecated', '=', False)], copy=False)
|
||||
writeoff_label = fields.Char(
|
||||
string='Journal Item Label',
|
||||
help='Change label of the counterpart that will hold the payment difference',
|
||||
default='Write-Off')
|
||||
|
||||
# FIXME: ondelete='restrict' not working (eg. cancel a bank statement reconciliation with a payment)
|
||||
move_line_ids = fields.One2many('account.move.line', 'payment_id', readonly=True, copy=False, ondelete='restrict')
|
||||
move_reconciled = fields.Boolean(compute="_get_move_reconciled", readonly=True)
|
||||
|
||||
def open_payment_matching_screen(self):
|
||||
# Open reconciliation view for customers/suppliers
|
||||
move_line_id = False
|
||||
for move_line in self.move_line_ids:
|
||||
if move_line.account_id.reconcile:
|
||||
move_line_id = move_line.id
|
||||
break;
|
||||
action_context = {'company_ids': [self.company_id.id], 'partner_ids': [self.partner_id.commercial_partner_id.id]}
|
||||
if self.partner_type == 'customer':
|
||||
action_context.update({'mode': 'customers'})
|
||||
elif self.partner_type == 'supplier':
|
||||
action_context.update({'mode': 'suppliers'})
|
||||
if move_line_id:
|
||||
action_context.update({'move_line_id': move_line_id})
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'manual_reconciliation_view',
|
||||
'context': action_context,
|
||||
}
|
||||
|
||||
def _compute_journal_domain_and_types(self):
|
||||
journal_type = ['bank', 'cash']
|
||||
domain = []
|
||||
if self.currency_id.is_zero(self.amount):
|
||||
# In case of payment with 0 amount, allow to select a journal of type 'general' like
|
||||
# 'Miscellaneous Operations' and set this journal by default.
|
||||
journal_type = ['general']
|
||||
self.payment_difference_handling = 'reconcile'
|
||||
else:
|
||||
if self.payment_type == 'inbound':
|
||||
domain.append(('at_least_one_inbound', '=', True))
|
||||
else:
|
||||
domain.append(('at_least_one_outbound', '=', True))
|
||||
return {'domain': domain, 'journal_types': set(journal_type)}
|
||||
|
||||
@api.onchange('amount', 'currency_id')
|
||||
def _onchange_amount(self):
|
||||
jrnl_filters = self._compute_journal_domain_and_types()
|
||||
journal_types = jrnl_filters['journal_types']
|
||||
domain_on_types = [('type', 'in', list(journal_types))]
|
||||
if self.journal_id.type not in journal_types:
|
||||
self.journal_id = self.env['account.journal'].search(domain_on_types, limit=1)
|
||||
return {'domain': {'journal_id': jrnl_filters['domain'] + domain_on_types}}
|
||||
|
||||
@api.one
|
||||
@api.depends('invoice_ids', 'payment_type', 'partner_type', 'partner_id')
|
||||
def _compute_destination_account_id(self):
|
||||
if self.invoice_ids:
|
||||
self.destination_account_id = self.invoice_ids[0].account_id.id
|
||||
elif self.payment_type == 'transfer':
|
||||
if not self.company_id.transfer_account_id.id:
|
||||
raise UserError(_('Transfer account not defined on the company.'))
|
||||
self.destination_account_id = self.company_id.transfer_account_id.id
|
||||
elif self.partner_id:
|
||||
if self.partner_type == 'customer':
|
||||
self.destination_account_id = self.partner_id.property_account_receivable_id.id
|
||||
else:
|
||||
self.destination_account_id = self.partner_id.property_account_payable_id.id
|
||||
|
||||
@api.onchange('partner_type')
|
||||
def _onchange_partner_type(self):
|
||||
# Set partner_id domain
|
||||
if self.partner_type:
|
||||
return {'domain': {'partner_id': [(self.partner_type, '=', True)]}}
|
||||
|
||||
@api.onchange('payment_type')
|
||||
def _onchange_payment_type(self):
|
||||
if not self.invoice_ids:
|
||||
# Set default partner type for the payment type
|
||||
if self.payment_type == 'inbound':
|
||||
self.partner_type = 'customer'
|
||||
elif self.payment_type == 'outbound':
|
||||
self.partner_type = 'supplier'
|
||||
# Set payment method domain
|
||||
res = self._onchange_journal()
|
||||
if not res.get('domain', {}):
|
||||
res['domain'] = {}
|
||||
jrnl_filters = self._compute_journal_domain_and_types()
|
||||
journal_types = jrnl_filters['journal_types']
|
||||
journal_types.update(['bank', 'cash'])
|
||||
res['domain']['journal_id'] = jrnl_filters['domain'] + [('type', 'in', list(journal_types))]
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields):
|
||||
rec = super(account_payment, self).default_get(fields)
|
||||
invoice_defaults = self.resolve_2many_commands('invoice_ids', rec.get('invoice_ids'))
|
||||
if invoice_defaults and len(invoice_defaults) == 1:
|
||||
invoice = invoice_defaults[0]
|
||||
rec['communication'] = invoice['reference'] or invoice['name'] or invoice['number']
|
||||
rec['currency_id'] = invoice['currency_id'][0]
|
||||
rec['payment_type'] = invoice['type'] in ('out_invoice', 'in_refund') and 'inbound' or 'outbound'
|
||||
rec['partner_type'] = MAP_INVOICE_TYPE_PARTNER_TYPE[invoice['type']]
|
||||
rec['partner_id'] = invoice['partner_id'][0]
|
||||
rec['amount'] = invoice['residual']
|
||||
return rec
|
||||
|
||||
@api.multi
|
||||
def button_journal_entries(self):
|
||||
return {
|
||||
'name': _('Journal Items'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.move.line',
|
||||
'view_id': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
'domain': [('payment_id', 'in', self.ids)],
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def button_invoices(self):
|
||||
return {
|
||||
'name': _('Paid Invoices'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.invoice',
|
||||
'view_id': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
'domain': [('id', 'in', [x.id for x in self.invoice_ids])],
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def button_dummy(self):
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def unreconcile(self):
|
||||
""" Set back the payments in 'posted' or 'sent' state, without deleting the journal entries.
|
||||
Called when cancelling a bank statement line linked to a pre-registered payment.
|
||||
"""
|
||||
for payment in self:
|
||||
if payment.payment_reference:
|
||||
payment.write({'state': 'sent'})
|
||||
else:
|
||||
payment.write({'state': 'posted'})
|
||||
|
||||
@api.multi
|
||||
def cancel(self):
|
||||
for rec in self:
|
||||
for move in rec.move_line_ids.mapped('move_id'):
|
||||
if rec.invoice_ids:
|
||||
move.line_ids.remove_move_reconcile()
|
||||
move.button_cancel()
|
||||
move.unlink()
|
||||
rec.state = 'cancelled'
|
||||
|
||||
@api.multi
|
||||
def unlink(self):
|
||||
if any(bool(rec.move_line_ids) for rec in self):
|
||||
raise UserError(_("You can not delete a payment that is already posted"))
|
||||
if any(rec.move_name for rec in self):
|
||||
raise UserError(_('It is not allowed to delete a payment that already created a journal entry since it would create a gap in the numbering. You should create the journal entry again and cancel it thanks to a regular revert.'))
|
||||
return super(account_payment, self).unlink()
|
||||
|
||||
@api.multi
|
||||
def post(self):
|
||||
""" Create the journal items for the payment and update the payment's state to 'posted'.
|
||||
A journal entry is created containing an item in the source liquidity account (selected journal's default_debit or default_credit)
|
||||
and another in the destination reconciliable account (see _compute_destination_account_id).
|
||||
If invoice_ids is not empty, there will be one reconciliable move line per invoice to reconcile with.
|
||||
If the payment is a transfer, a second journal entry is created in the destination journal to receive money from the transfer account.
|
||||
"""
|
||||
for rec in self:
|
||||
|
||||
if rec.state != 'draft':
|
||||
raise UserError(_("Only a draft payment can be posted."))
|
||||
|
||||
if any(inv.state != 'open' for inv in rec.invoice_ids):
|
||||
raise ValidationError(_("The payment cannot be processed because the invoice is not open!"))
|
||||
|
||||
# Use the right sequence to set the name
|
||||
if rec.payment_type == 'transfer':
|
||||
sequence_code = 'account.payment.transfer'
|
||||
else:
|
||||
if rec.partner_type == 'customer':
|
||||
if rec.payment_type == 'inbound':
|
||||
sequence_code = 'account.payment.customer.invoice'
|
||||
if rec.payment_type == 'outbound':
|
||||
sequence_code = 'account.payment.customer.refund'
|
||||
if rec.partner_type == 'supplier':
|
||||
if rec.payment_type == 'inbound':
|
||||
sequence_code = 'account.payment.supplier.refund'
|
||||
if rec.payment_type == 'outbound':
|
||||
sequence_code = 'account.payment.supplier.invoice'
|
||||
rec.name = self.env['ir.sequence'].with_context(ir_sequence_date=rec.payment_date).next_by_code(sequence_code)
|
||||
if not rec.name and rec.payment_type != 'transfer':
|
||||
raise UserError(_("You have to define a sequence for %s in your company.") % (sequence_code,))
|
||||
|
||||
# Create the journal entry
|
||||
amount = rec.amount * (rec.payment_type in ('outbound', 'transfer') and 1 or -1)
|
||||
move = rec._create_payment_entry(amount)
|
||||
|
||||
# In case of a transfer, the first journal entry created debited the source liquidity account and credited
|
||||
# the transfer account. Now we debit the transfer account and credit the destination liquidity account.
|
||||
if rec.payment_type == 'transfer':
|
||||
transfer_credit_aml = move.line_ids.filtered(lambda r: r.account_id == rec.company_id.transfer_account_id)
|
||||
transfer_debit_aml = rec._create_transfer_entry(amount)
|
||||
(transfer_credit_aml + transfer_debit_aml).reconcile()
|
||||
|
||||
rec.write({'state': 'posted', 'move_name': move.name})
|
||||
|
||||
@api.multi
|
||||
def action_draft(self):
|
||||
return self.write({'state': 'draft'})
|
||||
|
||||
def action_validate_invoice_payment(self):
|
||||
""" Posts a payment used to pay an invoice. This function only posts the
|
||||
payment by default but can be overridden to apply specific post or pre-processing.
|
||||
It is called by the "validate" button of the popup window
|
||||
triggered on invoice form by the "Register Payment" button.
|
||||
"""
|
||||
if any(len(record.invoice_ids) != 1 for record in self):
|
||||
# For multiple invoices, there is account.register.payments wizard
|
||||
raise UserError(_("This method should only be called to process a single invoice's payment."))
|
||||
self.post();
|
||||
|
||||
def _create_payment_entry(self, amount):
|
||||
""" Create a journal entry corresponding to a payment, if the payment references invoice(s) they are reconciled.
|
||||
Return the journal entry.
|
||||
"""
|
||||
aml_obj = self.env['account.move.line'].with_context(check_move_validity=False)
|
||||
invoice_currency = False
|
||||
if self.invoice_ids and all([x.currency_id == self.invoice_ids[0].currency_id for x in self.invoice_ids]):
|
||||
#if all the invoices selected share the same currency, record the paiement in that currency too
|
||||
invoice_currency = self.invoice_ids[0].currency_id
|
||||
debit, credit, amount_currency, currency_id = aml_obj.with_context(date=self.payment_date).compute_amount_fields(amount, self.currency_id, self.company_id.currency_id, invoice_currency)
|
||||
|
||||
move = self.env['account.move'].create(self._get_move_vals())
|
||||
|
||||
#Write line corresponding to invoice payment
|
||||
counterpart_aml_dict = self._get_shared_move_line_vals(debit, credit, amount_currency, move.id, False)
|
||||
counterpart_aml_dict.update(self._get_counterpart_move_line_vals(self.invoice_ids))
|
||||
counterpart_aml_dict.update({'currency_id': currency_id})
|
||||
counterpart_aml = aml_obj.create(counterpart_aml_dict)
|
||||
|
||||
#Reconcile with the invoices
|
||||
if self.payment_difference_handling == 'reconcile' and self.payment_difference:
|
||||
writeoff_line = self._get_shared_move_line_vals(0, 0, 0, move.id, False)
|
||||
amount_currency_wo, currency_id = aml_obj.with_context(date=self.payment_date).compute_amount_fields(self.payment_difference, self.currency_id, self.company_id.currency_id, invoice_currency)[2:]
|
||||
# the writeoff debit and credit must be computed from the invoice residual in company currency
|
||||
# minus the payment amount in company currency, and not from the payment difference in the payment currency
|
||||
# to avoid loss of precision during the currency rate computations. See revision 20935462a0cabeb45480ce70114ff2f4e91eaf79 for a detailed example.
|
||||
total_residual_company_signed = sum(invoice.residual_company_signed for invoice in self.invoice_ids)
|
||||
total_payment_company_signed = self.currency_id.with_context(date=self.payment_date).compute(self.amount, self.company_id.currency_id)
|
||||
if self.invoice_ids[0].type in ['in_invoice', 'out_refund']:
|
||||
amount_wo = total_payment_company_signed - total_residual_company_signed
|
||||
else:
|
||||
amount_wo = total_residual_company_signed - total_payment_company_signed
|
||||
# Align the sign of the secondary currency writeoff amount with the sign of the writeoff
|
||||
# amount in the company currency
|
||||
if amount_wo > 0:
|
||||
debit_wo = amount_wo
|
||||
credit_wo = 0.0
|
||||
amount_currency_wo = abs(amount_currency_wo)
|
||||
else:
|
||||
debit_wo = 0.0
|
||||
credit_wo = -amount_wo
|
||||
amount_currency_wo = -abs(amount_currency_wo)
|
||||
writeoff_line['name'] = self.writeoff_label
|
||||
writeoff_line['account_id'] = self.writeoff_account_id.id
|
||||
writeoff_line['debit'] = debit_wo
|
||||
writeoff_line['credit'] = credit_wo
|
||||
writeoff_line['amount_currency'] = amount_currency_wo
|
||||
writeoff_line['currency_id'] = currency_id
|
||||
writeoff_line = aml_obj.create(writeoff_line)
|
||||
if counterpart_aml['debit'] or writeoff_line['credit']:
|
||||
counterpart_aml['debit'] += credit_wo - debit_wo
|
||||
if counterpart_aml['credit'] or writeoff_line['debit']:
|
||||
counterpart_aml['credit'] += debit_wo - credit_wo
|
||||
counterpart_aml['amount_currency'] -= amount_currency_wo
|
||||
|
||||
#Write counterpart lines
|
||||
if not self.currency_id.is_zero(self.amount):
|
||||
if not self.currency_id != self.company_id.currency_id:
|
||||
amount_currency = 0
|
||||
liquidity_aml_dict = self._get_shared_move_line_vals(credit, debit, -amount_currency, move.id, False)
|
||||
liquidity_aml_dict.update(self._get_liquidity_move_line_vals(-amount))
|
||||
aml_obj.create(liquidity_aml_dict)
|
||||
|
||||
#validate the payment
|
||||
move.post()
|
||||
|
||||
#reconcile the invoice receivable/payable line(s) with the payment
|
||||
self.invoice_ids.register_payment(counterpart_aml)
|
||||
|
||||
return move
|
||||
|
||||
def _create_transfer_entry(self, amount):
|
||||
""" Create the journal entry corresponding to the 'incoming money' part of an internal transfer, return the reconciliable move line
|
||||
"""
|
||||
aml_obj = self.env['account.move.line'].with_context(check_move_validity=False)
|
||||
debit, credit, amount_currency, dummy = aml_obj.with_context(date=self.payment_date).compute_amount_fields(amount, self.currency_id, self.company_id.currency_id)
|
||||
amount_currency = self.destination_journal_id.currency_id and self.currency_id.with_context(date=self.payment_date).compute(amount, self.destination_journal_id.currency_id) or 0
|
||||
|
||||
dst_move = self.env['account.move'].create(self._get_move_vals(self.destination_journal_id))
|
||||
|
||||
dst_liquidity_aml_dict = self._get_shared_move_line_vals(debit, credit, amount_currency, dst_move.id)
|
||||
dst_liquidity_aml_dict.update({
|
||||
'name': _('Transfer from %s') % self.journal_id.name,
|
||||
'account_id': self.destination_journal_id.default_credit_account_id.id,
|
||||
'currency_id': self.destination_journal_id.currency_id.id,
|
||||
'journal_id': self.destination_journal_id.id})
|
||||
aml_obj.create(dst_liquidity_aml_dict)
|
||||
|
||||
transfer_debit_aml_dict = self._get_shared_move_line_vals(credit, debit, 0, dst_move.id)
|
||||
transfer_debit_aml_dict.update({
|
||||
'name': self.name,
|
||||
'account_id': self.company_id.transfer_account_id.id,
|
||||
'journal_id': self.destination_journal_id.id})
|
||||
if self.currency_id != self.company_id.currency_id:
|
||||
transfer_debit_aml_dict.update({
|
||||
'currency_id': self.currency_id.id,
|
||||
'amount_currency': -self.amount,
|
||||
})
|
||||
transfer_debit_aml = aml_obj.create(transfer_debit_aml_dict)
|
||||
dst_move.post()
|
||||
return transfer_debit_aml
|
||||
|
||||
def _get_move_vals(self, journal=None):
|
||||
""" Return dict to create the payment move
|
||||
"""
|
||||
journal = journal or self.journal_id
|
||||
if not journal.sequence_id:
|
||||
raise UserError(_('Configuration Error !'), _('The journal %s does not have a sequence, please specify one.') % journal.name)
|
||||
if not journal.sequence_id.active:
|
||||
raise UserError(_('Configuration Error !'), _('The sequence of journal %s is deactivated.') % journal.name)
|
||||
name = self.move_name or journal.with_context(ir_sequence_date=self.payment_date).sequence_id.next_by_id()
|
||||
return {
|
||||
'name': name,
|
||||
'date': self.payment_date,
|
||||
'ref': self.communication or '',
|
||||
'company_id': self.company_id.id,
|
||||
'journal_id': journal.id,
|
||||
}
|
||||
|
||||
def _get_shared_move_line_vals(self, debit, credit, amount_currency, move_id, invoice_id=False):
|
||||
""" Returns values common to both move lines (except for debit, credit and amount_currency which are reversed)
|
||||
"""
|
||||
return {
|
||||
'partner_id': self.payment_type in ('inbound', 'outbound') and self.env['res.partner']._find_accounting_partner(self.partner_id).id or False,
|
||||
'invoice_id': invoice_id and invoice_id.id or False,
|
||||
'move_id': move_id,
|
||||
'debit': debit,
|
||||
'credit': credit,
|
||||
'amount_currency': amount_currency or False,
|
||||
'payment_id': self.id,
|
||||
}
|
||||
|
||||
def _get_counterpart_move_line_vals(self, invoice=False):
|
||||
if self.payment_type == 'transfer':
|
||||
name = self.name
|
||||
else:
|
||||
name = ''
|
||||
if self.partner_type == 'customer':
|
||||
if self.payment_type == 'inbound':
|
||||
name += _("Customer Payment")
|
||||
elif self.payment_type == 'outbound':
|
||||
name += _("Customer Credit Note")
|
||||
elif self.partner_type == 'supplier':
|
||||
if self.payment_type == 'inbound':
|
||||
name += _("Vendor Credit Note")
|
||||
elif self.payment_type == 'outbound':
|
||||
name += _("Vendor Payment")
|
||||
if invoice:
|
||||
name += ': '
|
||||
for inv in invoice:
|
||||
if inv.move_id:
|
||||
name += inv.number + ', '
|
||||
name = name[:len(name)-2]
|
||||
return {
|
||||
'name': name,
|
||||
'account_id': self.destination_account_id.id,
|
||||
'journal_id': self.journal_id.id,
|
||||
'currency_id': self.currency_id != self.company_id.currency_id and self.currency_id.id or False,
|
||||
}
|
||||
|
||||
def _get_liquidity_move_line_vals(self, amount):
|
||||
name = self.name
|
||||
if self.payment_type == 'transfer':
|
||||
name = _('Transfer to %s') % self.destination_journal_id.name
|
||||
vals = {
|
||||
'name': name,
|
||||
'account_id': self.payment_type in ('outbound','transfer') and self.journal_id.default_debit_account_id.id or self.journal_id.default_credit_account_id.id,
|
||||
'journal_id': self.journal_id.id,
|
||||
'currency_id': self.currency_id != self.company_id.currency_id and self.currency_id.id or False,
|
||||
}
|
||||
|
||||
# If the journal has a currency specified, the journal item need to be expressed in this currency
|
||||
if self.journal_id.currency_id and self.currency_id != self.journal_id.currency_id:
|
||||
amount = self.currency_id.with_context(date=self.payment_date).compute(amount, self.journal_id.currency_id)
|
||||
debit, credit, amount_currency, dummy = self.env['account.move.line'].with_context(date=self.payment_date).compute_amount_fields(amount, self.journal_id.currency_id, self.company_id.currency_id)
|
||||
vals.update({
|
||||
'amount_currency': amount_currency,
|
||||
'currency_id': self.journal_id.currency_id.id,
|
||||
})
|
||||
|
||||
return vals
|
||||
|
|
@ -0,0 +1,985 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo.exceptions import AccessError
|
||||
from odoo import api, fields, models, _
|
||||
from odoo import SUPERUSER_ID
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
def migrate_set_tags_and_taxes_updatable(cr, registry, module):
|
||||
''' This is a utility function used to manually set the flag noupdate to False on tags and account tax templates on localization modules
|
||||
that need migration (for example in case of VAT report improvements)
|
||||
'''
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
xml_record_ids = env['ir.model.data'].search([
|
||||
('model', 'in', ['account.tax.template', 'account.account.tag']),
|
||||
('module', 'like', module)
|
||||
]).ids
|
||||
if xml_record_ids:
|
||||
cr.execute("update ir_model_data set noupdate = 'f' where id in %s", (tuple(xml_record_ids),))
|
||||
|
||||
def migrate_tags_on_taxes(cr, registry):
|
||||
''' This is a utiliy function to help migrate the tags of taxes when the localization has been modified on stable version. If
|
||||
called accordingly in a post_init_hooked function, it will reset the tags set on taxes as per their equivalent template.
|
||||
|
||||
Note: This unusual decision has been made in order to help the improvement of VAT reports on version 9.0, to have them more flexible
|
||||
and working out of the box when people are creating/using new taxes.
|
||||
'''
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
xml_records = env['ir.model.data'].search([
|
||||
('model', '=', 'account.tax.template'),
|
||||
('module', 'like', 'l10n_%')
|
||||
])
|
||||
tax_template_ids = [x['res_id'] for x in xml_records.sudo().read(['res_id'])]
|
||||
for tax_template in env['account.tax.template'].browse(tax_template_ids):
|
||||
tax_id = env['account.tax'].search([
|
||||
('name', '=', tax_template.name),
|
||||
('type_tax_use', '=', tax_template.type_tax_use),
|
||||
('description', '=', tax_template.description)
|
||||
])
|
||||
if len(tax_id.ids) == 1:
|
||||
tax_id.sudo().write({'tag_ids': [(6, 0, tax_template.tag_ids.ids)]})
|
||||
|
||||
def preserve_existing_tags_on_taxes(cr, registry, module):
|
||||
''' This is a utility function used to preserve existing previous tags during upgrade of the module.'''
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
xml_records = env['ir.model.data'].search([('model', '=', 'account.account.tag'), ('module', 'like', module)])
|
||||
if xml_records:
|
||||
cr.execute("update ir_model_data set noupdate = 't' where id in %s", [tuple(xml_records.ids)])
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
# Account Templates: Account, Tax, Tax Code and chart. + Wizard
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
|
||||
class AccountAccountTemplate(models.Model):
|
||||
_name = "account.account.template"
|
||||
_description = 'Templates for Accounts'
|
||||
_order = "code"
|
||||
|
||||
name = fields.Char(required=True, index=True)
|
||||
currency_id = fields.Many2one('res.currency', string='Account Currency', help="Forces all moves for this account to have this secondary currency.")
|
||||
code = fields.Char(size=64, required=True, index=True)
|
||||
user_type_id = fields.Many2one('account.account.type', string='Type', required=True, oldname='user_type',
|
||||
help="These types are defined according to your country. The type contains more information "\
|
||||
"about the account and its specificities.")
|
||||
reconcile = fields.Boolean(string='Allow Invoices & payments Matching', default=False,
|
||||
help="Check this option if you want the user to reconcile entries in this account.")
|
||||
note = fields.Text()
|
||||
tax_ids = fields.Many2many('account.tax.template', 'account_account_template_tax_rel', 'account_id', 'tax_id', string='Default Taxes')
|
||||
nocreate = fields.Boolean(string='Optional Create', default=False,
|
||||
help="If checked, the new chart of accounts will not contain this by default.")
|
||||
chart_template_id = fields.Many2one('account.chart.template', string='Chart Template',
|
||||
help="This optional field allow you to link an account template to a specific chart template that may differ from the one its root parent belongs to. This allow you "
|
||||
"to define chart templates that extend another and complete it with few new accounts (You don't need to define the whole structure that is common to both several times).")
|
||||
tag_ids = fields.Many2many('account.account.tag', 'account_account_template_account_tag', string='Account tag', help="Optional tags you may want to assign for custom reporting")
|
||||
group_id = fields.Many2one('account.group')
|
||||
|
||||
@api.multi
|
||||
@api.depends('name', 'code')
|
||||
def name_get(self):
|
||||
res = []
|
||||
for record in self:
|
||||
name = record.name
|
||||
if record.code:
|
||||
name = record.code + ' ' + name
|
||||
res.append((record.id, name))
|
||||
return res
|
||||
|
||||
|
||||
class AccountChartTemplate(models.Model):
|
||||
_name = "account.chart.template"
|
||||
_description = "Templates for Account Chart"
|
||||
|
||||
name = fields.Char(required=True)
|
||||
company_id = fields.Many2one('res.company', string='Company')
|
||||
parent_id = fields.Many2one('account.chart.template', string='Parent Chart Template')
|
||||
code_digits = fields.Integer(string='# of Digits', required=True, default=6, help="No. of Digits to use for account code")
|
||||
visible = fields.Boolean(string='Can be Visible?', default=True,
|
||||
help="Set this to False if you don't want this template to be used actively in the wizard that generate Chart of Accounts from "
|
||||
"templates, this is useful when you want to generate accounts of this template only when loading its child template.")
|
||||
currency_id = fields.Many2one('res.currency', string='Currency', required=True)
|
||||
use_anglo_saxon = fields.Boolean(string="Use Anglo-Saxon accounting", default=False)
|
||||
complete_tax_set = fields.Boolean(string='Complete Set of Taxes', default=True,
|
||||
help="This boolean helps you to choose if you want to propose to the user to encode the sale and purchase rates or choose from list "
|
||||
"of taxes. This last choice assumes that the set of tax defined on this template is complete")
|
||||
account_ids = fields.One2many('account.account.template', 'chart_template_id', string='Associated Account Templates')
|
||||
tax_template_ids = fields.One2many('account.tax.template', 'chart_template_id', string='Tax Template List',
|
||||
help='List of all the taxes that have to be installed by the wizard')
|
||||
bank_account_code_prefix = fields.Char(string='Prefix of the bank accounts', oldname="bank_account_code_char")
|
||||
cash_account_code_prefix = fields.Char(string='Prefix of the main cash accounts')
|
||||
transfer_account_id = fields.Many2one('account.account.template', string='Transfer Account', required=True,
|
||||
domain=lambda self: [('reconcile', '=', True), ('user_type_id.id', '=', self.env.ref('account.data_account_type_current_assets').id)],
|
||||
help="Intermediary account used when moving money from a liquidity account to another")
|
||||
income_currency_exchange_account_id = fields.Many2one('account.account.template',
|
||||
string="Gain Exchange Rate Account", domain=[('internal_type', '=', 'other'), ('deprecated', '=', False)])
|
||||
expense_currency_exchange_account_id = fields.Many2one('account.account.template',
|
||||
string="Loss Exchange Rate Account", domain=[('internal_type', '=', 'other'), ('deprecated', '=', False)])
|
||||
property_account_receivable_id = fields.Many2one('account.account.template', string='Receivable Account', oldname="property_account_receivable")
|
||||
property_account_payable_id = fields.Many2one('account.account.template', string='Payable Account', oldname="property_account_payable")
|
||||
property_account_expense_categ_id = fields.Many2one('account.account.template', string='Category of Expense Account', oldname="property_account_expense_categ")
|
||||
property_account_income_categ_id = fields.Many2one('account.account.template', string='Category of Income Account', oldname="property_account_income_categ")
|
||||
property_account_expense_id = fields.Many2one('account.account.template', string='Expense Account on Product Template', oldname="property_account_expense")
|
||||
property_account_income_id = fields.Many2one('account.account.template', string='Income Account on Product Template', oldname="property_account_income")
|
||||
property_stock_account_input_categ_id = fields.Many2one('account.account.template', string="Input Account for Stock Valuation", oldname="property_stock_account_input_categ")
|
||||
property_stock_account_output_categ_id = fields.Many2one('account.account.template', string="Output Account for Stock Valuation", oldname="property_stock_account_output_categ")
|
||||
property_stock_valuation_account_id = fields.Many2one('account.account.template', string="Account Template for Stock Valuation")
|
||||
|
||||
@api.one
|
||||
def try_loading_for_current_company(self):
|
||||
self.ensure_one()
|
||||
company = self.env.user.company_id
|
||||
# If we don't have any chart of account on this company, install this chart of account
|
||||
if not company.chart_template_id:
|
||||
wizard = self.env['wizard.multi.charts.accounts'].create({
|
||||
'company_id': self.env.user.company_id.id,
|
||||
'chart_template_id': self.id,
|
||||
'code_digits': self.code_digits,
|
||||
'transfer_account_id': self.transfer_account_id.id,
|
||||
'currency_id': self.currency_id.id,
|
||||
'bank_account_code_prefix': self.bank_account_code_prefix,
|
||||
'cash_account_code_prefix': self.cash_account_code_prefix,
|
||||
})
|
||||
wizard.onchange_chart_template_id()
|
||||
wizard.execute()
|
||||
|
||||
@api.multi
|
||||
def open_select_template_wizard(self):
|
||||
# Add action to open wizard to select between several templates
|
||||
if not self.company_id.chart_template_id:
|
||||
todo = self.env['ir.actions.todo']
|
||||
action_rec = self.env['ir.model.data'].xmlid_to_object('account.action_wizard_multi_chart')
|
||||
if action_rec:
|
||||
todo.create({'action_id': action_rec.id, 'name': _('Choose Accounting Template')})
|
||||
return True
|
||||
|
||||
@api.model
|
||||
def generate_journals(self, acc_template_ref, company, journals_dict=None):
|
||||
"""
|
||||
This method is used for creating journals.
|
||||
|
||||
:param chart_temp_id: Chart Template Id.
|
||||
:param acc_template_ref: Account templates reference.
|
||||
:param company_id: company_id selected from wizard.multi.charts.accounts.
|
||||
:returns: True
|
||||
"""
|
||||
JournalObj = self.env['account.journal']
|
||||
for vals_journal in self._prepare_all_journals(acc_template_ref, company, journals_dict=journals_dict):
|
||||
journal = JournalObj.create(vals_journal)
|
||||
if vals_journal['type'] == 'general' and vals_journal['code'] == _('EXCH'):
|
||||
company.write({'currency_exchange_journal_id': journal.id})
|
||||
if vals_journal['type'] == 'general' and vals_journal['code'] == _('CABA'):
|
||||
company.write({'tax_cash_basis_journal_id': journal.id})
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None):
|
||||
def _get_default_account(journal_vals, type='debit'):
|
||||
# Get the default accounts
|
||||
default_account = False
|
||||
if journal['type'] == 'sale':
|
||||
default_account = acc_template_ref.get(self.property_account_income_categ_id.id)
|
||||
elif journal['type'] == 'purchase':
|
||||
default_account = acc_template_ref.get(self.property_account_expense_categ_id.id)
|
||||
elif journal['type'] == 'general' and journal['code'] == _('EXCH'):
|
||||
if type=='credit':
|
||||
default_account = acc_template_ref.get(self.income_currency_exchange_account_id.id)
|
||||
else:
|
||||
default_account = acc_template_ref.get(self.expense_currency_exchange_account_id.id)
|
||||
return default_account
|
||||
|
||||
journals = [{'name': _('Customer Invoices'), 'type': 'sale', 'code': _('INV'), 'favorite': True, 'color': 11, 'sequence': 5},
|
||||
{'name': _('Vendor Bills'), 'type': 'purchase', 'code': _('BILL'), 'favorite': True, 'color': 11, 'sequence': 6},
|
||||
{'name': _('Miscellaneous Operations'), 'type': 'general', 'code': _('MISC'), 'favorite': False, 'sequence': 7},
|
||||
{'name': _('Exchange Difference'), 'type': 'general', 'code': _('EXCH'), 'favorite': False, 'sequence': 9},
|
||||
{'name': _('Cash Basis Tax Journal'), 'type': 'general', 'code': _('CABA'), 'favorite': False, 'sequence': 10}]
|
||||
if journals_dict != None:
|
||||
journals.extend(journals_dict)
|
||||
|
||||
self.ensure_one()
|
||||
journal_data = []
|
||||
for journal in journals:
|
||||
vals = {
|
||||
'type': journal['type'],
|
||||
'name': journal['name'],
|
||||
'code': journal['code'],
|
||||
'company_id': company.id,
|
||||
'default_credit_account_id': _get_default_account(journal, 'credit'),
|
||||
'default_debit_account_id': _get_default_account(journal, 'debit'),
|
||||
'show_on_dashboard': journal['favorite'],
|
||||
'color': journal.get('color', False),
|
||||
'sequence': journal['sequence']
|
||||
}
|
||||
journal_data.append(vals)
|
||||
return journal_data
|
||||
|
||||
@api.multi
|
||||
def generate_properties(self, acc_template_ref, company):
|
||||
"""
|
||||
This method used for creating properties.
|
||||
|
||||
:param self: chart templates for which we need to create properties
|
||||
:param acc_template_ref: Mapping between ids of account templates and real accounts created from them
|
||||
:param company_id: company_id selected from wizard.multi.charts.accounts.
|
||||
:returns: True
|
||||
"""
|
||||
self.ensure_one()
|
||||
PropertyObj = self.env['ir.property']
|
||||
todo_list = [
|
||||
('property_account_receivable_id', 'res.partner', 'account.account'),
|
||||
('property_account_payable_id', 'res.partner', 'account.account'),
|
||||
('property_account_expense_categ_id', 'product.category', 'account.account'),
|
||||
('property_account_income_categ_id', 'product.category', 'account.account'),
|
||||
('property_account_expense_id', 'product.template', 'account.account'),
|
||||
('property_account_income_id', 'product.template', 'account.account'),
|
||||
]
|
||||
for record in todo_list:
|
||||
account = getattr(self, record[0])
|
||||
value = account and 'account.account,' + str(acc_template_ref[account.id]) or False
|
||||
if value:
|
||||
field = self.env['ir.model.fields'].search([('name', '=', record[0]), ('model', '=', record[1]), ('relation', '=', record[2])], limit=1)
|
||||
vals = {
|
||||
'name': record[0],
|
||||
'company_id': company.id,
|
||||
'fields_id': field.id,
|
||||
'value': value,
|
||||
}
|
||||
properties = PropertyObj.search([('name', '=', record[0]), ('company_id', '=', company.id)])
|
||||
if properties:
|
||||
#the property exist: modify it
|
||||
properties.write(vals)
|
||||
else:
|
||||
#create the property
|
||||
PropertyObj.create(vals)
|
||||
stock_properties = [
|
||||
'property_stock_account_input_categ_id',
|
||||
'property_stock_account_output_categ_id',
|
||||
'property_stock_valuation_account_id',
|
||||
]
|
||||
for stock_property in stock_properties:
|
||||
account = getattr(self, stock_property)
|
||||
value = account and acc_template_ref[account.id] or False
|
||||
if value:
|
||||
company.write({stock_property: value})
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def _install_template(self, company, code_digits=None, transfer_account_id=None, obj_wizard=None, acc_ref=None, taxes_ref=None):
|
||||
""" Recursively load the template objects and create the real objects from them.
|
||||
|
||||
:param company: company the wizard is running for
|
||||
:param code_digits: number of digits the accounts code should have in the COA
|
||||
:param transfer_account_id: reference to the account template that will be used as intermediary account for transfers between 2 liquidity accounts
|
||||
:param obj_wizard: the current wizard for generating the COA from the templates
|
||||
:param acc_ref: Mapping between ids of account templates and real accounts created from them
|
||||
:param taxes_ref: Mapping between ids of tax templates and real taxes created from them
|
||||
:returns: tuple with a dictionary containing
|
||||
* the mapping between the account template ids and the ids of the real accounts that have been generated
|
||||
from them, as first item,
|
||||
* a similar dictionary for mapping the tax templates and taxes, as second item,
|
||||
:rtype: tuple(dict, dict, dict)
|
||||
"""
|
||||
self.ensure_one()
|
||||
if acc_ref is None:
|
||||
acc_ref = {}
|
||||
if taxes_ref is None:
|
||||
taxes_ref = {}
|
||||
if self.parent_id:
|
||||
tmp1, tmp2 = self.parent_id._install_template(company, code_digits=code_digits, transfer_account_id=transfer_account_id, acc_ref=acc_ref, taxes_ref=taxes_ref)
|
||||
acc_ref.update(tmp1)
|
||||
taxes_ref.update(tmp2)
|
||||
tmp1, tmp2 = self._load_template(company, code_digits=code_digits, transfer_account_id=transfer_account_id, account_ref=acc_ref, taxes_ref=taxes_ref)
|
||||
acc_ref.update(tmp1)
|
||||
taxes_ref.update(tmp2)
|
||||
return acc_ref, taxes_ref
|
||||
|
||||
@api.multi
|
||||
def _load_template(self, company, code_digits=None, transfer_account_id=None, account_ref=None, taxes_ref=None):
|
||||
""" Generate all the objects from the templates
|
||||
|
||||
:param company: company the wizard is running for
|
||||
:param code_digits: number of digits the accounts code should have in the COA
|
||||
:param transfer_account_id: reference to the account template that will be used as intermediary account for transfers between 2 liquidity accounts
|
||||
:param acc_ref: Mapping between ids of account templates and real accounts created from them
|
||||
:param taxes_ref: Mapping between ids of tax templates and real taxes created from them
|
||||
:returns: tuple with a dictionary containing
|
||||
* the mapping between the account template ids and the ids of the real accounts that have been generated
|
||||
from them, as first item,
|
||||
* a similar dictionary for mapping the tax templates and taxes, as second item,
|
||||
:rtype: tuple(dict, dict, dict)
|
||||
"""
|
||||
self.ensure_one()
|
||||
if account_ref is None:
|
||||
account_ref = {}
|
||||
if taxes_ref is None:
|
||||
taxes_ref = {}
|
||||
if not code_digits:
|
||||
code_digits = self.code_digits
|
||||
if not transfer_account_id:
|
||||
transfer_account_id = self.transfer_account_id
|
||||
AccountTaxObj = self.env['account.tax']
|
||||
|
||||
# Generate taxes from templates.
|
||||
generated_tax_res = self.with_context(active_test=False).tax_template_ids._generate_tax(company)
|
||||
taxes_ref.update(generated_tax_res['tax_template_to_tax'])
|
||||
|
||||
# Generating Accounts from templates.
|
||||
account_template_ref = self.generate_account(taxes_ref, account_ref, code_digits, company)
|
||||
account_ref.update(account_template_ref)
|
||||
|
||||
# writing account values after creation of accounts
|
||||
company.transfer_account_id = account_template_ref[transfer_account_id.id]
|
||||
for key, value in generated_tax_res['account_dict'].items():
|
||||
if value['refund_account_id'] or value['account_id'] or value['cash_basis_account']:
|
||||
AccountTaxObj.browse(key).write({
|
||||
'refund_account_id': account_ref.get(value['refund_account_id'], False),
|
||||
'account_id': account_ref.get(value['account_id'], False),
|
||||
'cash_basis_account': account_ref.get(value['cash_basis_account'], False),
|
||||
})
|
||||
|
||||
# Create Journals - Only done for root chart template
|
||||
if not self.parent_id:
|
||||
self.generate_journals(account_ref, company)
|
||||
|
||||
# generate properties function
|
||||
self.generate_properties(account_ref, company)
|
||||
|
||||
# Generate Fiscal Position , Fiscal Position Accounts and Fiscal Position Taxes from templates
|
||||
self.generate_fiscal_position(taxes_ref, account_ref, company)
|
||||
|
||||
# Generate account operation template templates
|
||||
self.generate_account_reconcile_model(taxes_ref, account_ref, company)
|
||||
|
||||
return account_ref, taxes_ref
|
||||
|
||||
@api.multi
|
||||
def create_record_with_xmlid(self, company, template, model, vals):
|
||||
# Create a record for the given model with the given vals and
|
||||
# also create an entry in ir_model_data to have an xmlid for the newly created record
|
||||
# xmlid is the concatenation of company_id and template_xml_id
|
||||
ir_model_data = self.env['ir.model.data']
|
||||
template_xmlid = ir_model_data.search([('model', '=', template._name), ('res_id', '=', template.id)])
|
||||
new_xml_id = str(company.id)+'_'+template_xmlid.name
|
||||
return ir_model_data._update(model, template_xmlid.module, vals, xml_id=new_xml_id, store=True, noupdate=True, mode='init', res_id=False)
|
||||
|
||||
def _get_account_vals(self, company, account_template, code_acc, tax_template_ref):
|
||||
""" This method generates a dictionnary of all the values for the account that will be created.
|
||||
"""
|
||||
self.ensure_one()
|
||||
tax_ids = []
|
||||
for tax in account_template.tax_ids:
|
||||
tax_ids.append(tax_template_ref[tax.id])
|
||||
val = {
|
||||
'name': account_template.name,
|
||||
'currency_id': account_template.currency_id and account_template.currency_id.id or False,
|
||||
'code': code_acc,
|
||||
'user_type_id': account_template.user_type_id and account_template.user_type_id.id or False,
|
||||
'reconcile': account_template.reconcile,
|
||||
'note': account_template.note,
|
||||
'tax_ids': [(6, 0, tax_ids)],
|
||||
'company_id': company.id,
|
||||
'tag_ids': [(6, 0, [t.id for t in account_template.tag_ids])],
|
||||
'group_id': account_template.group_id.id,
|
||||
}
|
||||
return val
|
||||
|
||||
@api.multi
|
||||
def generate_account(self, tax_template_ref, acc_template_ref, code_digits, company):
|
||||
""" This method for generating accounts from templates.
|
||||
|
||||
:param tax_template_ref: Taxes templates reference for write taxes_id in account_account.
|
||||
:param acc_template_ref: dictionary with the mappping between the account templates and the real accounts.
|
||||
:param code_digits: number of digits got from wizard.multi.charts.accounts, this is use for account code.
|
||||
:param company_id: company_id selected from wizard.multi.charts.accounts.
|
||||
:returns: return acc_template_ref for reference purpose.
|
||||
:rtype: dict
|
||||
"""
|
||||
self.ensure_one()
|
||||
account_tmpl_obj = self.env['account.account.template']
|
||||
acc_template = account_tmpl_obj.search([('nocreate', '!=', True), ('chart_template_id', '=', self.id)], order='id')
|
||||
for account_template in acc_template:
|
||||
code_main = account_template.code and len(account_template.code) or 0
|
||||
code_acc = account_template.code or ''
|
||||
if code_main > 0 and code_main <= code_digits:
|
||||
code_acc = str(code_acc) + (str('0'*(code_digits-code_main)))
|
||||
vals = self._get_account_vals(company, account_template, code_acc, tax_template_ref)
|
||||
new_account = self.create_record_with_xmlid(company, account_template, 'account.account', vals)
|
||||
acc_template_ref[account_template.id] = new_account
|
||||
return acc_template_ref
|
||||
|
||||
def _prepare_reconcile_model_vals(self, company, account_reconcile_model, acc_template_ref, tax_template_ref):
|
||||
""" This method generates a dictionnary of all the values for the account.reconcile.model that will be created.
|
||||
"""
|
||||
self.ensure_one()
|
||||
return {
|
||||
'name': account_reconcile_model.name,
|
||||
'sequence': account_reconcile_model.sequence,
|
||||
'has_second_line': account_reconcile_model.has_second_line,
|
||||
'company_id': company.id,
|
||||
'account_id': acc_template_ref[account_reconcile_model.account_id.id],
|
||||
'label': account_reconcile_model.label,
|
||||
'amount_type': account_reconcile_model.amount_type,
|
||||
'amount': account_reconcile_model.amount,
|
||||
'tax_id': account_reconcile_model.tax_id and tax_template_ref[account_reconcile_model.tax_id.id] or False,
|
||||
'second_account_id': account_reconcile_model.second_account_id and acc_template_ref[account_reconcile_model.second_account_id.id] or False,
|
||||
'second_label': account_reconcile_model.second_label,
|
||||
'second_amount_type': account_reconcile_model.second_amount_type,
|
||||
'second_amount': account_reconcile_model.second_amount,
|
||||
'second_tax_id': account_reconcile_model.second_tax_id and tax_template_ref[account_reconcile_model.second_tax_id.id] or False,
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def generate_account_reconcile_model(self, tax_template_ref, acc_template_ref, company):
|
||||
""" This method for generating accounts from templates.
|
||||
|
||||
:param tax_template_ref: Taxes templates reference for write taxes_id in account_account.
|
||||
:param acc_template_ref: dictionary with the mappping between the account templates and the real accounts.
|
||||
:param company_id: company_id selected from wizard.multi.charts.accounts.
|
||||
:returns: return new_account_reconcile_model for reference purpose.
|
||||
:rtype: dict
|
||||
"""
|
||||
self.ensure_one()
|
||||
account_reconcile_models = self.env['account.reconcile.model.template'].search([
|
||||
('chart_template_id', '=', self.id)
|
||||
])
|
||||
for account_reconcile_model in account_reconcile_models:
|
||||
vals = self._prepare_reconcile_model_vals(company, account_reconcile_model, acc_template_ref, tax_template_ref)
|
||||
self.create_record_with_xmlid(company, account_reconcile_model, 'account.reconcile.model', vals)
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def _get_fp_vals(self, company, position):
|
||||
return {
|
||||
'company_id': company.id,
|
||||
'sequence': position.sequence,
|
||||
'name': position.name,
|
||||
'note': position.note,
|
||||
'auto_apply': position.auto_apply,
|
||||
'vat_required': position.vat_required,
|
||||
'country_id': position.country_id.id,
|
||||
'country_group_id': position.country_group_id.id,
|
||||
'state_ids': position.state_ids and [(6,0, position.state_ids.ids)] or [],
|
||||
'zip_from': position.zip_from,
|
||||
'zip_to': position.zip_to,
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def generate_fiscal_position(self, tax_template_ref, acc_template_ref, company):
|
||||
""" This method generate Fiscal Position, Fiscal Position Accounts and Fiscal Position Taxes from templates.
|
||||
|
||||
:param chart_temp_id: Chart Template Id.
|
||||
:param taxes_ids: Taxes templates reference for generating account.fiscal.position.tax.
|
||||
:param acc_template_ref: Account templates reference for generating account.fiscal.position.account.
|
||||
:param company_id: company_id selected from wizard.multi.charts.accounts.
|
||||
:returns: True
|
||||
"""
|
||||
self.ensure_one()
|
||||
positions = self.env['account.fiscal.position.template'].search([('chart_template_id', '=', self.id)])
|
||||
for position in positions:
|
||||
fp_vals = self._get_fp_vals(company, position)
|
||||
new_fp = self.create_record_with_xmlid(company, position, 'account.fiscal.position', fp_vals)
|
||||
for tax in position.tax_ids:
|
||||
self.create_record_with_xmlid(company, tax, 'account.fiscal.position.tax', {
|
||||
'tax_src_id': tax_template_ref[tax.tax_src_id.id],
|
||||
'tax_dest_id': tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
|
||||
'position_id': new_fp
|
||||
})
|
||||
for acc in position.account_ids:
|
||||
self.create_record_with_xmlid(company, acc, 'account.fiscal.position.account', {
|
||||
'account_src_id': acc_template_ref[acc.account_src_id.id],
|
||||
'account_dest_id': acc_template_ref[acc.account_dest_id.id],
|
||||
'position_id': new_fp
|
||||
})
|
||||
return True
|
||||
|
||||
|
||||
class AccountTaxTemplate(models.Model):
|
||||
_name = 'account.tax.template'
|
||||
_description = 'Templates for Taxes'
|
||||
_order = 'id'
|
||||
|
||||
chart_template_id = fields.Many2one('account.chart.template', string='Chart Template', required=True)
|
||||
|
||||
name = fields.Char(string='Tax Name', required=True)
|
||||
type_tax_use = fields.Selection([('sale', 'Sales'), ('purchase', 'Purchases'), ('none', 'None')], string='Tax Scope', required=True, default="sale",
|
||||
help="Determines where the tax is selectable. Note : 'None' means a tax can't be used by itself, however it can still be used in a group.")
|
||||
tax_adjustment = fields.Boolean(default=False)
|
||||
amount_type = fields.Selection(default='percent', string="Tax Computation", required=True,
|
||||
selection=[('group', 'Group of Taxes'), ('fixed', 'Fixed'), ('percent', 'Percentage of Price'), ('division', 'Percentage of Price Tax Included')])
|
||||
active = fields.Boolean(default=True, help="Set active to false to hide the tax without removing it.")
|
||||
company_id = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.user.company_id)
|
||||
children_tax_ids = fields.Many2many('account.tax.template', 'account_tax_template_filiation_rel', 'parent_tax', 'child_tax', string='Children Taxes')
|
||||
sequence = fields.Integer(required=True, default=1,
|
||||
help="The sequence field is used to define order in which the tax lines are applied.")
|
||||
amount = fields.Float(required=True, digits=(16, 4))
|
||||
account_id = fields.Many2one('account.account.template', string='Tax Account', ondelete='restrict',
|
||||
help="Account that will be set on invoice tax lines for invoices. Leave empty to use the expense account.", oldname='account_collected_id')
|
||||
refund_account_id = fields.Many2one('account.account.template', string='Tax Account on Refunds', ondelete='restrict',
|
||||
help="Account that will be set on invoice tax lines for refunds. Leave empty to use the expense account.", oldname='account_paid_id')
|
||||
description = fields.Char(string='Display on Invoices')
|
||||
price_include = fields.Boolean(string='Included in Price', default=False,
|
||||
help="Check this if the price you use on the product and invoices includes this tax.")
|
||||
include_base_amount = fields.Boolean(string='Affect Subsequent Taxes', default=False,
|
||||
help="If set, taxes which are computed after this one will be computed based on the price tax included.")
|
||||
analytic = fields.Boolean(string="Analytic Cost", help="If set, the amount computed by this tax will be assigned to the same analytic account as the invoice line (if any)")
|
||||
tag_ids = fields.Many2many('account.account.tag', string='Account tag', help="Optional tags you may want to assign for custom reporting")
|
||||
tax_group_id = fields.Many2one('account.tax.group', string="Tax Group")
|
||||
tax_exigibility = fields.Selection(
|
||||
[('on_invoice', 'Based on Invoice'),
|
||||
('on_payment', 'Based on Payment'),
|
||||
], string='Tax Due', default='on_invoice',
|
||||
oldname='use_cash_basis',
|
||||
help="Based on Invoice: the tax is due as soon as the invoice is validated.\n"
|
||||
"Based on Payment: the tax is due as soon as the payment of the invoice is received.")
|
||||
cash_basis_account = fields.Many2one(
|
||||
'account.account.template',
|
||||
string='Tax Received Account',
|
||||
domain=[('deprecated', '=', False)],
|
||||
help='Account used as counterpart for the journal entry, for taxes eligible based on payments.')
|
||||
|
||||
_sql_constraints = [
|
||||
('name_company_uniq', 'unique(name, company_id, type_tax_use, chart_template_id)', 'Tax names must be unique !'),
|
||||
]
|
||||
|
||||
@api.multi
|
||||
@api.depends('name', 'description')
|
||||
def name_get(self):
|
||||
res = []
|
||||
for record in self:
|
||||
name = record.description and record.description or record.name
|
||||
res.append((record.id, name))
|
||||
return res
|
||||
|
||||
def _get_tax_vals(self, company, tax_template_to_tax):
|
||||
""" This method generates a dictionnary of all the values for the tax that will be created.
|
||||
"""
|
||||
# Compute children tax ids
|
||||
children_ids = []
|
||||
for child_tax in self.children_tax_ids:
|
||||
if tax_template_to_tax.get(child_tax.id):
|
||||
children_ids.append(tax_template_to_tax[child_tax.id])
|
||||
self.ensure_one()
|
||||
val = {
|
||||
'name': self.name,
|
||||
'type_tax_use': self.type_tax_use,
|
||||
'amount_type': self.amount_type,
|
||||
'active': self.active,
|
||||
'company_id': company.id,
|
||||
'sequence': self.sequence,
|
||||
'amount': self.amount,
|
||||
'description': self.description,
|
||||
'price_include': self.price_include,
|
||||
'include_base_amount': self.include_base_amount,
|
||||
'analytic': self.analytic,
|
||||
'tag_ids': [(6, 0, [t.id for t in self.tag_ids])],
|
||||
'children_tax_ids': [(6, 0, children_ids)],
|
||||
'tax_adjustment': self.tax_adjustment,
|
||||
'tax_exigibility': self.tax_exigibility,
|
||||
}
|
||||
|
||||
if self.tax_group_id:
|
||||
val['tax_group_id'] = self.tax_group_id.id
|
||||
return val
|
||||
|
||||
@api.multi
|
||||
def _generate_tax(self, company):
|
||||
""" This method generate taxes from templates.
|
||||
|
||||
:param company: the company for which the taxes should be created from templates in self
|
||||
:returns: {
|
||||
'tax_template_to_tax': mapping between tax template and the newly generated taxes corresponding,
|
||||
'account_dict': dictionary containing a to-do list with all the accounts to assign on new taxes
|
||||
}
|
||||
"""
|
||||
todo_dict = {}
|
||||
tax_template_to_tax = {}
|
||||
for tax in self:
|
||||
vals_tax = tax._get_tax_vals(company, tax_template_to_tax)
|
||||
new_tax = self.env['account.chart.template'].create_record_with_xmlid(company, tax, 'account.tax', vals_tax)
|
||||
tax_template_to_tax[tax.id] = new_tax
|
||||
# Since the accounts have not been created yet, we have to wait before filling these fields
|
||||
todo_dict[new_tax] = {
|
||||
'account_id': tax.account_id.id,
|
||||
'refund_account_id': tax.refund_account_id.id,
|
||||
'cash_basis_account': tax.cash_basis_account.id,
|
||||
}
|
||||
|
||||
if any([tax.tax_exigibility == 'on_payment' for tax in self]):
|
||||
# When a CoA is being installed automatically and if it is creating account tax(es) whose field `Use Cash Basis`(tax_exigibility) is set to True by default
|
||||
# (exapmple of such CoA's are l10n_fr and l10n_mx) then in the `Accounting Settings` the option `Cash Basis` should be checked by default.
|
||||
company.tax_exigibility = True
|
||||
|
||||
return {
|
||||
'tax_template_to_tax': tax_template_to_tax,
|
||||
'account_dict': todo_dict
|
||||
}
|
||||
|
||||
# Fiscal Position Templates
|
||||
|
||||
class AccountFiscalPositionTemplate(models.Model):
|
||||
_name = 'account.fiscal.position.template'
|
||||
_description = 'Template for Fiscal Position'
|
||||
|
||||
sequence = fields.Integer()
|
||||
name = fields.Char(string='Fiscal Position Template', required=True)
|
||||
chart_template_id = fields.Many2one('account.chart.template', string='Chart Template', required=True)
|
||||
account_ids = fields.One2many('account.fiscal.position.account.template', 'position_id', string='Account Mapping')
|
||||
tax_ids = fields.One2many('account.fiscal.position.tax.template', 'position_id', string='Tax Mapping')
|
||||
note = fields.Text(string='Notes')
|
||||
auto_apply = fields.Boolean(string='Detect Automatically', help="Apply automatically this fiscal position.")
|
||||
vat_required = fields.Boolean(string='VAT required', help="Apply only if partner has a VAT number.")
|
||||
country_id = fields.Many2one('res.country', string='Country',
|
||||
help="Apply only if delivery or invoicing country match.")
|
||||
country_group_id = fields.Many2one('res.country.group', string='Country Group',
|
||||
help="Apply only if delivery or invoicing country match the group.")
|
||||
state_ids = fields.Many2many('res.country.state', string='Federal States')
|
||||
zip_from = fields.Integer(string='Zip Range From', default=0)
|
||||
zip_to = fields.Integer(string='Zip Range To', default=0)
|
||||
|
||||
|
||||
class AccountFiscalPositionTaxTemplate(models.Model):
|
||||
_name = 'account.fiscal.position.tax.template'
|
||||
_description = 'Template Tax Fiscal Position'
|
||||
_rec_name = 'position_id'
|
||||
|
||||
position_id = fields.Many2one('account.fiscal.position.template', string='Fiscal Position', required=True, ondelete='cascade')
|
||||
tax_src_id = fields.Many2one('account.tax.template', string='Tax Source', required=True)
|
||||
tax_dest_id = fields.Many2one('account.tax.template', string='Replacement Tax')
|
||||
|
||||
|
||||
class AccountFiscalPositionAccountTemplate(models.Model):
|
||||
_name = 'account.fiscal.position.account.template'
|
||||
_description = 'Template Account Fiscal Mapping'
|
||||
_rec_name = 'position_id'
|
||||
|
||||
position_id = fields.Many2one('account.fiscal.position.template', string='Fiscal Mapping', required=True, ondelete='cascade')
|
||||
account_src_id = fields.Many2one('account.account.template', string='Account Source', required=True)
|
||||
account_dest_id = fields.Many2one('account.account.template', string='Account Destination', required=True)
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# Account generation from template wizards
|
||||
# ---------------------------------------------------------
|
||||
|
||||
|
||||
class WizardMultiChartsAccounts(models.TransientModel):
|
||||
"""
|
||||
Create a new account chart for a company.
|
||||
Wizards ask for:
|
||||
* a company
|
||||
* an account chart template
|
||||
* a number of digits for formatting code of non-view accounts
|
||||
* a list of bank accounts owned by the company
|
||||
Then, the wizard:
|
||||
* generates all accounts from the template and assigns them to the right company
|
||||
* generates all taxes and tax codes, changing account assignations
|
||||
* generates all accounting properties and assigns them correctly
|
||||
"""
|
||||
|
||||
_name = 'wizard.multi.charts.accounts'
|
||||
_inherit = 'res.config'
|
||||
|
||||
company_id = fields.Many2one('res.company', string='Company', required=True)
|
||||
currency_id = fields.Many2one('res.currency', string='Currency', help="Currency as per company's country.", required=True)
|
||||
only_one_chart_template = fields.Boolean(string='Only One Chart Template Available')
|
||||
chart_template_id = fields.Many2one('account.chart.template', string='Chart Template', required=True)
|
||||
bank_account_ids = fields.One2many('account.bank.accounts.wizard', 'bank_account_id', string='Cash and Banks', required=True, oldname="bank_accounts_id")
|
||||
bank_account_code_prefix = fields.Char('Bank Accounts Prefix', oldname="bank_account_code_char")
|
||||
cash_account_code_prefix = fields.Char('Cash Accounts Prefix')
|
||||
code_digits = fields.Integer(string='# of Digits', required=True, help="No. of Digits to use for account code")
|
||||
sale_tax_id = fields.Many2one('account.tax.template', string='Default Sales Tax', oldname="sale_tax")
|
||||
purchase_tax_id = fields.Many2one('account.tax.template', string='Default Purchase Tax', oldname="purchase_tax")
|
||||
sale_tax_rate = fields.Float(string='Sales Tax(%)')
|
||||
use_anglo_saxon = fields.Boolean(string='Use Anglo-Saxon Accounting', related='chart_template_id.use_anglo_saxon')
|
||||
transfer_account_id = fields.Many2one('account.account.template', required=True, string='Transfer Account',
|
||||
domain=lambda self: [('reconcile', '=', True), ('user_type_id.id', '=', self.env.ref('account.data_account_type_current_assets').id)],
|
||||
help="Intermediary account used when moving money from a liquidity account to another")
|
||||
purchase_tax_rate = fields.Float(string='Purchase Tax(%)')
|
||||
complete_tax_set = fields.Boolean('Complete Set of Taxes',
|
||||
help="This boolean helps you to choose if you want to propose to the user to encode the sales and purchase rates or use "
|
||||
"the usual m2o fields. This last choice assumes that the set of tax defined for the chosen template is complete")
|
||||
|
||||
@api.model
|
||||
def _get_chart_parent_ids(self, chart_template):
|
||||
""" Returns the IDs of all ancestor charts, including the chart itself.
|
||||
(inverse of child_of operator)
|
||||
|
||||
:param BaseModel chart_template: the account.chart.template record
|
||||
:return: the IDS of all ancestor charts, including the chart itself.
|
||||
"""
|
||||
result = [chart_template.id]
|
||||
while chart_template.parent_id:
|
||||
chart_template = chart_template.parent_id
|
||||
result.append(chart_template.id)
|
||||
return result
|
||||
|
||||
@api.onchange('sale_tax_rate')
|
||||
def onchange_tax_rate(self):
|
||||
self.purchase_tax_rate = self.sale_tax_rate or False
|
||||
|
||||
@api.onchange('chart_template_id')
|
||||
def onchange_chart_template_id(self):
|
||||
res = {}
|
||||
tax_templ_obj = self.env['account.tax.template']
|
||||
if self.chart_template_id:
|
||||
currency_id = self.chart_template_id.currency_id and self.chart_template_id.currency_id.id or self.env.user.company_id.currency_id.id
|
||||
self.complete_tax_set = self.chart_template_id.complete_tax_set
|
||||
self.currency_id = currency_id
|
||||
if self.chart_template_id.complete_tax_set:
|
||||
# default tax is given by the lowest sequence. For same sequence we will take the latest created as it will be the case for tax created while isntalling the generic chart of account
|
||||
chart_ids = self._get_chart_parent_ids(self.chart_template_id)
|
||||
base_tax_domain = [('chart_template_id', 'parent_of', chart_ids)]
|
||||
sale_tax_domain = base_tax_domain + [('type_tax_use', '=', 'sale')]
|
||||
purchase_tax_domain = base_tax_domain + [('type_tax_use', '=', 'purchase')]
|
||||
sale_tax = tax_templ_obj.search(sale_tax_domain, order="sequence, id desc", limit=1)
|
||||
purchase_tax = tax_templ_obj.search(purchase_tax_domain, order="sequence, id desc", limit=1)
|
||||
self.sale_tax_id = sale_tax.id
|
||||
self.purchase_tax_id = purchase_tax.id
|
||||
res.setdefault('domain', {})
|
||||
res['domain']['sale_tax_id'] = repr(sale_tax_domain)
|
||||
res['domain']['purchase_tax_id'] = repr(purchase_tax_domain)
|
||||
if self.chart_template_id.transfer_account_id:
|
||||
self.transfer_account_id = self.chart_template_id.transfer_account_id.id
|
||||
if self.chart_template_id.code_digits:
|
||||
self.code_digits = self.chart_template_id.code_digits
|
||||
if self.chart_template_id.bank_account_code_prefix:
|
||||
self.bank_account_code_prefix = self.chart_template_id.bank_account_code_prefix
|
||||
if self.chart_template_id.cash_account_code_prefix:
|
||||
self.cash_account_code_prefix = self.chart_template_id.cash_account_code_prefix
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def _get_default_bank_account_ids(self):
|
||||
return [{'acc_name': _('Cash'), 'account_type': 'cash'}, {'acc_name': _('Bank'), 'account_type': 'bank'}]
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields):
|
||||
context = self._context or {}
|
||||
res = super(WizardMultiChartsAccounts, self).default_get(fields)
|
||||
tax_templ_obj = self.env['account.tax.template']
|
||||
account_chart_template = self.env['account.chart.template']
|
||||
|
||||
if 'bank_account_ids' in fields:
|
||||
res.update({'bank_account_ids': self._get_default_bank_account_ids()})
|
||||
if 'company_id' in fields:
|
||||
res.update({'company_id': self.env.user.company_id.id})
|
||||
if 'currency_id' in fields:
|
||||
company_id = res.get('company_id') or False
|
||||
if company_id:
|
||||
company = self.env['res.company'].browse(company_id)
|
||||
currency_id = company.on_change_country(company.country_id.id)['value']['currency_id']
|
||||
res.update({'currency_id': currency_id})
|
||||
|
||||
chart_templates = account_chart_template.search([('visible', '=', True)])
|
||||
if chart_templates:
|
||||
#in order to set default chart which was last created set max of ids.
|
||||
chart_id = max(chart_templates.ids)
|
||||
if context.get("default_charts"):
|
||||
model_data = self.env['ir.model.data'].search_read([('model', '=', 'account.chart.template'), ('module', '=', context.get("default_charts"))], ['res_id'])
|
||||
if model_data:
|
||||
chart_id = model_data[0]['res_id']
|
||||
chart = account_chart_template.browse(chart_id)
|
||||
chart_hierarchy_ids = self._get_chart_parent_ids(chart)
|
||||
if 'chart_template_id' in fields:
|
||||
res.update({'only_one_chart_template': len(chart_templates) == 1,
|
||||
'chart_template_id': chart_id})
|
||||
if 'sale_tax_id' in fields:
|
||||
sale_tax = tax_templ_obj.search([('chart_template_id', 'in', chart_hierarchy_ids),
|
||||
('type_tax_use', '=', 'sale')], limit=1, order='sequence')
|
||||
res.update({'sale_tax_id': sale_tax and sale_tax.id or False})
|
||||
if 'purchase_tax_id' in fields:
|
||||
purchase_tax = tax_templ_obj.search([('chart_template_id', 'in', chart_hierarchy_ids),
|
||||
('type_tax_use', '=', 'purchase')], limit=1, order='sequence')
|
||||
res.update({'purchase_tax_id': purchase_tax and purchase_tax.id or False})
|
||||
res.update({
|
||||
'purchase_tax_rate': 15.0,
|
||||
'sale_tax_rate': 15.0,
|
||||
})
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False):
|
||||
context = self._context or {}
|
||||
res = super(WizardMultiChartsAccounts, self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=False)
|
||||
cmp_select = []
|
||||
CompanyObj = self.env['res.company']
|
||||
|
||||
companies = CompanyObj.search([])
|
||||
#display in the widget selection of companies, only the companies that haven't been configured yet (but don't care about the demo chart of accounts)
|
||||
self._cr.execute("SELECT company_id FROM account_account WHERE deprecated = 'f' AND name != 'Chart For Automated Tests' AND name NOT LIKE '%(test)'")
|
||||
configured_cmp = [r[0] for r in self._cr.fetchall()]
|
||||
unconfigured_cmp = list(set(companies.ids) - set(configured_cmp))
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = [('id', 'in', unconfigured_cmp)]
|
||||
res['fields'][field]['selection'] = [('', '')]
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in CompanyObj.browse(unconfigured_cmp)]
|
||||
res['fields'][field]['selection'] = cmp_select
|
||||
return res
|
||||
|
||||
@api.one
|
||||
def _create_tax_templates_from_rates(self, company_id):
|
||||
'''
|
||||
This function checks if the chosen chart template is configured as containing a full set of taxes, and if
|
||||
it's not the case, it creates the templates for account.tax object accordingly to the provided sale/purchase rates.
|
||||
Then it saves the new tax templates as default taxes to use for this chart template.
|
||||
|
||||
:param company_id: id of the company for wich the wizard is running
|
||||
:return: True
|
||||
'''
|
||||
obj_tax_temp = self.env['account.tax.template']
|
||||
all_parents = self._get_chart_parent_ids(self.chart_template_id)
|
||||
# create tax templates from purchase_tax_rate and sale_tax_rate fields
|
||||
if not self.chart_template_id.complete_tax_set:
|
||||
value = self.sale_tax_rate
|
||||
ref_taxs = obj_tax_temp.search([('type_tax_use', '=', 'sale'), ('chart_template_id', 'in', all_parents)], order="sequence, id desc", limit=1)
|
||||
ref_taxs.write({'amount': value, 'name': _('Tax %.2f%%') % value, 'description': '%.2f%%' % value})
|
||||
value = self.purchase_tax_rate
|
||||
ref_taxs = obj_tax_temp.search([('type_tax_use', '=', 'purchase'), ('chart_template_id', 'in', all_parents)], order="sequence, id desc", limit=1)
|
||||
ref_taxs.write({'amount': value, 'name': _('Tax %.2f%%') % value, 'description': '%.2f%%' % value})
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def existing_accounting(self, company_id):
|
||||
model_to_check = ['account.move.line', 'account.invoice', 'account.move', 'account.payment', 'account.bank.statement']
|
||||
for model in model_to_check:
|
||||
if len(self.env[model].search([('company_id', '=', company_id.id)])) > 0:
|
||||
return True
|
||||
return False
|
||||
|
||||
@api.multi
|
||||
def execute(self):
|
||||
'''
|
||||
This function is called at the confirmation of the wizard to generate the COA from the templates. It will read
|
||||
all the provided information to create the accounts, the banks, the journals, the taxes, the
|
||||
accounting properties... accordingly for the chosen company.
|
||||
'''
|
||||
if not self.env.user._is_admin():
|
||||
raise AccessError(_("Only administrators can change the settings"))
|
||||
|
||||
existing_accounts = self.env['account.account'].search([('company_id', '=', self.company_id.id)])
|
||||
if existing_accounts:
|
||||
# we tolerate switching from accounting package (localization module) as long as there isn't yet any accounting
|
||||
# entries created for the company.
|
||||
if self.existing_accounting(self.company_id):
|
||||
raise UserError(_('Could not install new chart of account as there are already accounting entries existing'))
|
||||
|
||||
# delete accounting properties
|
||||
prop_values = ['account.account,%s' % (account_id,) for account_id in existing_accounts.ids]
|
||||
existing_journals = self.env['account.journal'].search([('company_id', '=', self.company_id.id)])
|
||||
if existing_journals:
|
||||
prop_values.extend(['account.journal,%s' % (journal_id,) for journal_id in existing_journals.ids])
|
||||
accounting_props = self.env['ir.property'].search([('value_reference', 'in', prop_values)])
|
||||
if accounting_props:
|
||||
accounting_props.unlink()
|
||||
|
||||
# delete account, journal, tax, fiscal position and reconciliation model
|
||||
models_to_delete = ['account.reconcile.model', 'account.fiscal.position', 'account.tax', 'account.journal']
|
||||
for model in models_to_delete:
|
||||
res = self.env[model].search([('company_id', '=', self.company_id.id)])
|
||||
if len(res):
|
||||
res.unlink()
|
||||
existing_accounts.unlink()
|
||||
|
||||
company = self.company_id
|
||||
self.company_id.write({'currency_id': self.currency_id.id,
|
||||
'accounts_code_digits': self.code_digits,
|
||||
'anglo_saxon_accounting': self.use_anglo_saxon,
|
||||
'bank_account_code_prefix': self.bank_account_code_prefix,
|
||||
'cash_account_code_prefix': self.cash_account_code_prefix,
|
||||
'chart_template_id': self.chart_template_id.id})
|
||||
|
||||
#set the coa currency to active
|
||||
self.currency_id.write({'active': True})
|
||||
|
||||
# When we install the CoA of first company, set the currency to price types and pricelists
|
||||
if company.id == 1:
|
||||
for reference in ['product.list_price', 'product.standard_price', 'product.list0']:
|
||||
try:
|
||||
tmp2 = self.env.ref(reference).write({'currency_id': self.currency_id.id})
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
# If the floats for sale/purchase rates have been filled, create templates from them
|
||||
self._create_tax_templates_from_rates(company.id)
|
||||
|
||||
# Install all the templates objects and generate the real objects
|
||||
acc_template_ref, taxes_ref = self.chart_template_id._install_template(company, code_digits=self.code_digits, transfer_account_id=self.transfer_account_id)
|
||||
|
||||
# write values of default taxes for product as super user and write in the config
|
||||
IrDefault = self.env['ir.default']
|
||||
IrConfig = self.env['ir.config_parameter']
|
||||
if self.sale_tax_id and taxes_ref:
|
||||
IrDefault.sudo().set('product.template', "taxes_id", [taxes_ref[self.sale_tax_id.id]], company_id=company.id)
|
||||
IrConfig.sudo().set_param("account.default_sale_tax_id", taxes_ref[self.sale_tax_id.id])
|
||||
if self.purchase_tax_id and taxes_ref:
|
||||
IrDefault.sudo().set('product.template', "supplier_taxes_id", [taxes_ref[self.purchase_tax_id.id]], company_id=company.id)
|
||||
IrConfig.sudo().set_param("account.default_purchase_tax_id", taxes_ref[self.purchase_tax_id.id])
|
||||
|
||||
# Create Bank journals
|
||||
self._create_bank_journals_from_o2m(company, acc_template_ref)
|
||||
|
||||
# Create the current year earning account if it wasn't present in the CoA
|
||||
company.get_unaffected_earnings_account()
|
||||
return {}
|
||||
|
||||
@api.multi
|
||||
def _create_bank_journals_from_o2m(self, company, acc_template_ref):
|
||||
'''
|
||||
This function creates bank journals and its accounts for each line encoded in the field bank_account_ids of the
|
||||
wizard (which is currently only used to create a default bank and cash journal when the CoA is installed).
|
||||
|
||||
:param company: the company for which the wizard is running.
|
||||
:param acc_template_ref: the dictionary containing the mapping between the ids of account templates and the ids
|
||||
of the accounts that have been generated from them.
|
||||
'''
|
||||
self.ensure_one()
|
||||
bank_journals = self.env['account.journal']
|
||||
# Create the journals that will trigger the account.account creation
|
||||
for acc in self.bank_account_ids:
|
||||
bank_journals += self.env['account.journal'].create({
|
||||
'name': acc.acc_name,
|
||||
'type': acc.account_type,
|
||||
'company_id': company.id,
|
||||
'currency_id': acc.currency_id.id,
|
||||
'sequence': 10
|
||||
})
|
||||
return bank_journals
|
||||
|
||||
|
||||
class AccountBankAccountsWizard(models.TransientModel):
|
||||
_name = 'account.bank.accounts.wizard'
|
||||
|
||||
acc_name = fields.Char(string='Account Name.', required=True)
|
||||
bank_account_id = fields.Many2one('wizard.multi.charts.accounts', string='Bank Account', required=True, ondelete='cascade')
|
||||
currency_id = fields.Many2one('res.currency', string='Account Currency',
|
||||
help="Forces all moves for this account to have this secondary currency.")
|
||||
account_type = fields.Selection([('cash', 'Cash'), ('bank', 'Bank')])
|
||||
|
||||
|
||||
class AccountReconcileModelTemplate(models.Model):
|
||||
_name = "account.reconcile.model.template"
|
||||
|
||||
chart_template_id = fields.Many2one('account.chart.template', string='Chart Template', required=True)
|
||||
name = fields.Char(string='Button Label', required=True)
|
||||
sequence = fields.Integer(required=True, default=10)
|
||||
has_second_line = fields.Boolean(string='Add a second line', default=False)
|
||||
account_id = fields.Many2one('account.account.template', string='Account', ondelete='cascade', domain=[('deprecated', '=', False)])
|
||||
label = fields.Char(string='Journal Item Label')
|
||||
amount_type = fields.Selection([
|
||||
('fixed', 'Fixed'),
|
||||
('percentage', 'Percentage of balance')
|
||||
], required=True, default='percentage')
|
||||
amount = fields.Float(digits=0, required=True, default=100.0, help="Fixed amount will count as a debit if it is negative, as a credit if it is positive.")
|
||||
tax_id = fields.Many2one('account.tax.template', string='Tax', ondelete='restrict', domain=[('type_tax_use', '=', 'purchase')])
|
||||
second_account_id = fields.Many2one('account.account.template', string='Second Account', ondelete='cascade', domain=[('deprecated', '=', False)])
|
||||
second_label = fields.Char(string='Second Journal Item Label')
|
||||
second_amount_type = fields.Selection([
|
||||
('fixed', 'Fixed'),
|
||||
('percentage', 'Percentage of amount')
|
||||
], string="Second Amount type",required=True, default='percentage')
|
||||
second_amount = fields.Float(string='Second Amount', digits=0, required=True, default=100.0, help="Fixed amount will count as a debit if it is negative, as a credit if it is positive.")
|
||||
second_tax_id = fields.Many2one('account.tax.template', string='Second Tax', ondelete='restrict', domain=[('type_tax_use', '=', 'purchase')])
|
||||
|
|
@ -0,0 +1,354 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from datetime import timedelta, datetime
|
||||
import calendar
|
||||
|
||||
from odoo import fields, models, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.tools.float_utils import float_round, float_is_zero
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = "res.company"
|
||||
|
||||
#TODO check all the options/fields are in the views (settings + company form view)
|
||||
fiscalyear_last_day = fields.Integer(default=31, required=True)
|
||||
fiscalyear_last_month = fields.Selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], default=12, required=True)
|
||||
period_lock_date = fields.Date(string="Lock Date for Non-Advisers", help="Only users with the 'Adviser' role can edit accounts prior to and inclusive of this date. Use it for period locking inside an open fiscal year, for example.")
|
||||
fiscalyear_lock_date = fields.Date(string="Lock Date", help="No users, including Advisers, can edit accounts prior to and inclusive of this date. Use it for fiscal year locking for example.")
|
||||
transfer_account_id = fields.Many2one('account.account',
|
||||
domain=lambda self: [('reconcile', '=', True), ('user_type_id.id', '=', self.env.ref('account.data_account_type_current_assets').id), ('deprecated', '=', False)], string="Inter-Banks Transfer Account", help="Intermediary account used when moving money from a liquidity account to another")
|
||||
expects_chart_of_accounts = fields.Boolean(string='Expects a Chart of Accounts', default=True)
|
||||
chart_template_id = fields.Many2one('account.chart.template', help='The chart template for the company (if any)')
|
||||
bank_account_code_prefix = fields.Char(string='Prefix of the bank accounts', oldname="bank_account_code_char")
|
||||
cash_account_code_prefix = fields.Char(string='Prefix of the cash accounts')
|
||||
accounts_code_digits = fields.Integer(string='Number of digits in an account code')
|
||||
tax_cash_basis_journal_id = fields.Many2one('account.journal', string="Cash Basis Journal")
|
||||
tax_calculation_rounding_method = fields.Selection([
|
||||
('round_per_line', 'Round per Line'),
|
||||
('round_globally', 'Round Globally'),
|
||||
], default='round_per_line', string='Tax Calculation Rounding Method')
|
||||
currency_exchange_journal_id = fields.Many2one('account.journal', string="Exchange Gain or Loss Journal", domain=[('type', '=', 'general')])
|
||||
income_currency_exchange_account_id = fields.Many2one('account.account', related='currency_exchange_journal_id.default_credit_account_id',
|
||||
string="Gain Exchange Rate Account", domain="[('internal_type', '=', 'other'), ('deprecated', '=', False), ('company_id', '=', id)]")
|
||||
expense_currency_exchange_account_id = fields.Many2one('account.account', related='currency_exchange_journal_id.default_debit_account_id',
|
||||
string="Loss Exchange Rate Account", domain="[('internal_type', '=', 'other'), ('deprecated', '=', False), ('company_id', '=', id)]")
|
||||
anglo_saxon_accounting = fields.Boolean(string="Use anglo-saxon accounting")
|
||||
property_stock_account_input_categ_id = fields.Many2one('account.account', string="Input Account for Stock Valuation", oldname="property_stock_account_input_categ")
|
||||
property_stock_account_output_categ_id = fields.Many2one('account.account', string="Output Account for Stock Valuation", oldname="property_stock_account_output_categ")
|
||||
property_stock_valuation_account_id = fields.Many2one('account.account', string="Account Template for Stock Valuation")
|
||||
bank_journal_ids = fields.One2many('account.journal', 'company_id', domain=[('type', '=', 'bank')], string='Bank Journals')
|
||||
overdue_msg = fields.Text(string='Overdue Payments Message', translate=True,
|
||||
default='''Dear Sir/Madam,
|
||||
|
||||
Our records indicate that some payments on your account are still due. Please find details below.
|
||||
If the amount has already been paid, please disregard this notice. Otherwise, please forward us the total amount stated below.
|
||||
If you have any queries regarding your account, Please contact us.
|
||||
|
||||
Thank you in advance for your cooperation.
|
||||
Best Regards,''')
|
||||
tax_exigibility = fields.Boolean(string='Use Cash Basis')
|
||||
|
||||
#Fields of the setup step for opening move
|
||||
account_opening_move_id = fields.Many2one(string='Opening Journal Entry', comodel_name='account.move', help="The journal entry containing the initial balance of all this company's accounts.")
|
||||
account_opening_journal_id = fields.Many2one(string='Opening Journal', comodel_name='account.journal', related='account_opening_move_id.journal_id', help="Journal where the opening entry of this company's accounting has been posted.")
|
||||
account_opening_date = fields.Date(string='Opening Date', related='account_opening_move_id.date', help="Date at which the opening entry of this company's accounting has been posted.")
|
||||
|
||||
#Fields marking the completion of a setup step
|
||||
account_setup_company_data_done = fields.Boolean(string='Company Setup Marked As Done', help="Technical field holding the status of the company setup step.")
|
||||
account_setup_bank_data_done = fields.Boolean('Bank Setup Marked As Done', help="Technical field holding the status of the bank setup step.")
|
||||
account_setup_fy_data_done = fields.Boolean('Financial Year Setup Marked As Done', help="Technical field holding the status of the financial year setup step.")
|
||||
account_setup_coa_done = fields.Boolean(string='Chart of Account Checked', help="Technical field holding the status of the chart of account setup step.")
|
||||
account_setup_bar_closed = fields.Boolean(string='Setup Bar Closed', help="Technical field set to True when setup bar has been closed by the user.")
|
||||
|
||||
@api.model
|
||||
def _verify_fiscalyear_last_day(self, company_id, last_day, last_month):
|
||||
company = self.browse(company_id)
|
||||
last_day = last_day or (company and company.fiscalyear_last_day) or 31
|
||||
last_month = last_month or (company and company.fiscalyear_last_month) or 12
|
||||
current_year = datetime.now().year
|
||||
last_day_of_month = calendar.monthrange(current_year, last_month)[1]
|
||||
return last_day > last_day_of_month and last_day_of_month or last_day
|
||||
|
||||
@api.multi
|
||||
def compute_fiscalyear_dates(self, date):
|
||||
""" Computes the start and end dates of the fiscalyear where the given 'date' belongs to
|
||||
@param date: a datetime object
|
||||
@returns: a dictionary with date_from and date_to
|
||||
"""
|
||||
self = self[0]
|
||||
last_month = self.fiscalyear_last_month
|
||||
last_day = self.fiscalyear_last_day
|
||||
if (date.month < last_month or (date.month == last_month and date.day <= last_day)):
|
||||
date = date.replace(month=last_month, day=last_day)
|
||||
else:
|
||||
if last_month == 2 and last_day == 29 and (date.year + 1) % 4 != 0:
|
||||
date = date.replace(month=last_month, day=28, year=date.year + 1)
|
||||
else:
|
||||
date = date.replace(month=last_month, day=last_day, year=date.year + 1)
|
||||
date_to = date
|
||||
date_from = date + timedelta(days=1)
|
||||
if date_from.month == 2 and date_from.day == 29:
|
||||
date_from = date_from.replace(day=28, year=date_from.year - 1)
|
||||
else:
|
||||
date_from = date_from.replace(year=date_from.year - 1)
|
||||
return {'date_from': date_from, 'date_to': date_to}
|
||||
|
||||
def get_new_account_code(self, current_code, old_prefix, new_prefix, digits):
|
||||
return new_prefix + current_code.replace(old_prefix, '', 1).lstrip('0').rjust(digits-len(new_prefix), '0')
|
||||
|
||||
def reflect_code_prefix_change(self, old_code, new_code, digits):
|
||||
accounts = self.env['account.account'].search([('code', 'like', old_code), ('internal_type', '=', 'liquidity'),
|
||||
('company_id', '=', self.id)], order='code asc')
|
||||
for account in accounts:
|
||||
if account.code.startswith(old_code):
|
||||
account.write({'code': self.get_new_account_code(account.code, old_code, new_code, digits)})
|
||||
|
||||
def reflect_code_digits_change(self, digits):
|
||||
accounts = self.env['account.account'].search([('company_id', '=', self.id)], order='code asc')
|
||||
for account in accounts:
|
||||
account.write({'code': account.code.rstrip('0').ljust(digits, '0')})
|
||||
|
||||
@api.multi
|
||||
def _validate_fiscalyear_lock(self, values):
|
||||
if values.get('fiscalyear_lock_date'):
|
||||
nb_draft_entries = self.env['account.move'].search([
|
||||
('company_id', 'in', [c.id for c in self]),
|
||||
('state', '=', 'draft'),
|
||||
('date', '<=', values['fiscalyear_lock_date'])])
|
||||
if nb_draft_entries:
|
||||
raise ValidationError(_('There are still unposted entries in the period you want to lock. You should either post or delete them.'))
|
||||
|
||||
@api.multi
|
||||
def write(self, values):
|
||||
#restrict the closing of FY if there are still unposted entries
|
||||
self._validate_fiscalyear_lock(values)
|
||||
|
||||
# Reflect the change on accounts
|
||||
for company in self:
|
||||
digits = values.get('accounts_code_digits') or company.accounts_code_digits
|
||||
if values.get('bank_account_code_prefix') or values.get('accounts_code_digits'):
|
||||
new_bank_code = values.get('bank_account_code_prefix') or company.bank_account_code_prefix
|
||||
company.reflect_code_prefix_change(company.bank_account_code_prefix, new_bank_code, digits)
|
||||
if values.get('cash_account_code_prefix') or values.get('accounts_code_digits'):
|
||||
new_cash_code = values.get('cash_account_code_prefix') or company.cash_account_code_prefix
|
||||
company.reflect_code_prefix_change(company.cash_account_code_prefix, new_cash_code, digits)
|
||||
if values.get('accounts_code_digits'):
|
||||
company.reflect_code_digits_change(digits)
|
||||
return super(ResCompany, self).write(values)
|
||||
|
||||
@api.model
|
||||
def setting_init_company_action(self):
|
||||
""" Called by the 'Company Data' button of the setup bar."""
|
||||
company = self.env.user.company_id
|
||||
view_id = self.env.ref('account.setup_view_company_form').id
|
||||
return {'type': 'ir.actions.act_window',
|
||||
'name': _('Company Data'),
|
||||
'res_model': 'res.company',
|
||||
'target': 'new',
|
||||
'view_mode': 'form',
|
||||
'res_id': company.id,
|
||||
'views': [[view_id, 'form']],
|
||||
}
|
||||
|
||||
@api.model
|
||||
def setting_init_bank_account_action(self):
|
||||
""" Called by the 'Bank Accounts' button of the setup bar."""
|
||||
company = self.env.user.company_id
|
||||
view_id = self.env.ref('account.setup_bank_journal_form').id
|
||||
|
||||
res = {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Bank Account'),
|
||||
'view_mode': 'form',
|
||||
'res_model': 'account.journal',
|
||||
'target': 'new',
|
||||
'views': [[view_id, 'form']],
|
||||
}
|
||||
|
||||
# If some bank journal already exists, we open it in the form, so the user can edit it.
|
||||
# Otherwise, we just open the form in creation mode.
|
||||
bank_journal = self.env['account.journal'].search([('company_id','=', company.id), ('type','=','bank')], limit=1)
|
||||
if bank_journal:
|
||||
res['res_id'] = bank_journal.id
|
||||
else:
|
||||
res['context'] = {'default_type': 'bank'}
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def setting_init_fiscal_year_action(self):
|
||||
""" Called by the 'Fiscal Year Opening' button of the setup bar."""
|
||||
company = self.env.user.company_id
|
||||
company.create_op_move_if_non_existant()
|
||||
new_wizard = self.env['account.financial.year.op'].create({'company_id': company.id})
|
||||
view_id = self.env.ref('account.setup_financial_year_opening_form').id
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Fiscal Year'),
|
||||
'view_mode': 'form',
|
||||
'res_model': 'account.financial.year.op',
|
||||
'target': 'new',
|
||||
'res_id': new_wizard.id,
|
||||
'views': [[view_id, 'form']],
|
||||
}
|
||||
|
||||
@api.model
|
||||
def setting_chart_of_accounts_action(self):
|
||||
""" Called by the 'Chart of Accounts' button of the setup bar."""
|
||||
company = self.env.user.company_id
|
||||
company.account_setup_coa_done = True
|
||||
|
||||
# If an opening move has already been posted, we open the tree view showing all the accounts
|
||||
if company.opening_move_posted():
|
||||
return 'account.action_account_form'
|
||||
|
||||
# Otherwise, we create the opening move
|
||||
company.create_op_move_if_non_existant()
|
||||
|
||||
# Then, we open will open a custom tree view allowing to edit opening balances of the account
|
||||
view_id = self.env.ref('account.init_accounts_tree').id
|
||||
# Hide the current year earnings account as it is automatically computed
|
||||
domain = [('user_type_id', '!=', self.env.ref('account.data_unaffected_earnings').id), ('company_id','=', company.id)]
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Chart of Accounts'),
|
||||
'res_model': 'account.account',
|
||||
'view_mode': 'tree',
|
||||
'search_view_id': self.env.ref('account.view_account_search').id,
|
||||
'views': [[view_id, 'list']],
|
||||
'domain': domain,
|
||||
}
|
||||
|
||||
@api.model
|
||||
def setting_opening_move_action(self):
|
||||
""" Called by the 'Initial Balances' button of the setup bar."""
|
||||
company = self.env.user.company_id
|
||||
|
||||
# If the opening move has already been posted, we open its form view
|
||||
if company.opening_move_posted():
|
||||
form_view_id = self.env.ref('account.setup_posted_move_form').id
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Initial Balances'),
|
||||
'view_mode': 'form',
|
||||
'res_model': 'account.move',
|
||||
'target': 'new',
|
||||
'res_id': company.account_opening_move_id.id,
|
||||
'views': [[form_view_id, 'form']],
|
||||
}
|
||||
|
||||
# Otherwise, we open a custom wizard to post it.
|
||||
company.create_op_move_if_non_existant()
|
||||
new_wizard = self.env['account.opening'].create({'company_id': company.id})
|
||||
view_id = self.env.ref('account.setup_opening_move_wizard_form').id
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Initial Balances'),
|
||||
'view_mode': 'form',
|
||||
'res_model': 'account.opening',
|
||||
'target': 'new',
|
||||
'res_id': new_wizard.id,
|
||||
'views': [[view_id, 'form']],
|
||||
'context': {'check_move_validity': False},
|
||||
}
|
||||
|
||||
@api.model
|
||||
def setting_hide_setup_bar(self):
|
||||
""" Called by the cross button of the setup bar, to close it."""
|
||||
self.env.user.company_id.account_setup_bar_closed = True
|
||||
|
||||
@api.model
|
||||
def create_op_move_if_non_existant(self):
|
||||
""" Creates an empty opening move in 'draft' state for the current company
|
||||
if there wasn't already one defined. For this, the function needs at least
|
||||
one journal of type 'general' to exist (required by account.move).
|
||||
"""
|
||||
self.ensure_one()
|
||||
if not self.account_opening_move_id:
|
||||
default_journal = self.env['account.journal'].search([('type', '=', 'general'), ('company_id', '=', self.id)], limit=1)
|
||||
|
||||
if not default_journal:
|
||||
raise UserError(_("No miscellaneous journal could be found. Please create one before proceeding."))
|
||||
|
||||
self.account_opening_move_id = self.env['account.move'].create({
|
||||
'name': _('Opening Journal Entry'),
|
||||
'company_id': self.id,
|
||||
'journal_id': default_journal.id,
|
||||
})
|
||||
|
||||
def mark_company_setup_as_done_action(self):
|
||||
""" Marks the 'company' setup step as completed."""
|
||||
self.account_setup_company_data_done = True
|
||||
|
||||
def unmark_company_setup_as_done_action(self):
|
||||
""" Marks the 'company' setup step as uncompleted."""
|
||||
self.account_setup_company_data_done = False
|
||||
|
||||
def opening_move_posted(self):
|
||||
""" Returns true if this company has an opening account move and this move is posted."""
|
||||
return bool(self.account_opening_move_id) and self.account_opening_move_id.state == 'posted'
|
||||
|
||||
def get_unaffected_earnings_account(self):
|
||||
""" Returns the unaffected earnings account for this company, creating one
|
||||
if none has yet been defined.
|
||||
"""
|
||||
unaffected_earnings_type = self.env.ref("account.data_unaffected_earnings")
|
||||
account = self.env['account.account'].search([('company_id', '=', self.id),
|
||||
('user_type_id', '=', unaffected_earnings_type.id)])
|
||||
if not account:
|
||||
account = self.env['account.account'].create({
|
||||
'code': '999999',
|
||||
'name': _('Undistributed Profits/Losses'),
|
||||
'user_type_id': unaffected_earnings_type.id,
|
||||
'company_id': self.id,
|
||||
})
|
||||
return account
|
||||
|
||||
def get_opening_move_differences(self, opening_move_lines):
|
||||
currency = self.currency_id
|
||||
balancing_move_line = opening_move_lines.filtered(lambda x: x.account_id == self.get_unaffected_earnings_account())
|
||||
|
||||
debits_sum = credits_sum = 0.0
|
||||
for line in opening_move_lines:
|
||||
if line != balancing_move_line:
|
||||
#skip the autobalancing move line
|
||||
debits_sum += line.debit
|
||||
credits_sum += line.credit
|
||||
|
||||
difference = abs(debits_sum - credits_sum)
|
||||
debit_diff = (debits_sum > credits_sum) and float_round(difference, precision_rounding=currency.rounding) or 0.0
|
||||
credit_diff = (debits_sum < credits_sum) and float_round(difference, precision_rounding=currency.rounding) or 0.0
|
||||
return debit_diff, credit_diff
|
||||
|
||||
def _auto_balance_opening_move(self):
|
||||
""" Checks the opening_move of this company. If it has not been posted yet
|
||||
and is unbalanced, balances it with a automatic account.move.line in the
|
||||
current year earnings account.
|
||||
"""
|
||||
if self.account_opening_move_id and self.account_opening_move_id.state == 'draft':
|
||||
debit_diff, credit_diff = self.get_opening_move_differences(self.account_opening_move_id.line_ids)
|
||||
|
||||
currency = self.currency_id
|
||||
balancing_move_line = self.account_opening_move_id.line_ids.filtered(lambda x: x.account_id == self.get_unaffected_earnings_account())
|
||||
|
||||
if float_is_zero(debit_diff + credit_diff, precision_rounding=currency.rounding):
|
||||
if balancing_move_line:
|
||||
# zero difference and existing line : delete the line
|
||||
balancing_move_line.unlink()
|
||||
else:
|
||||
if balancing_move_line:
|
||||
# Non-zero difference and existing line : edit the line
|
||||
balancing_move_line.write({'debit': credit_diff, 'credit': debit_diff})
|
||||
else:
|
||||
# Non-zero difference and no existing line : create a new line
|
||||
balancing_account = self.get_unaffected_earnings_account()
|
||||
self.env['account.move.line'].create({
|
||||
'name': _('Automatic Balancing Line'),
|
||||
'move_id': self.account_opening_move_id.id,
|
||||
'account_id': balancing_account.id,
|
||||
'debit': credit_diff,
|
||||
'credit': debit_diff,
|
||||
})
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue