Skip to content

Commit

Permalink
[ADD] l10n_uy_account, l10n_uy_edi: demo and afp
Browse files Browse the repository at this point in the history
Fixes to make it work in 16

X-original-commit: 0a166db
X-original-commit: 06b25f3
  • Loading branch information
fw-bot-adhoc authored and zaoral committed Oct 17, 2023
1 parent a5cd0fe commit a175bf2
Show file tree
Hide file tree
Showing 15 changed files with 568 additions and 73 deletions.
6 changes: 6 additions & 0 deletions l10n_uy_account/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@
],
'demo': [
'demo/res_company_demo.xml',
'demo/account_journal_demo.xml',
'demo/res_currency_rate_demo.xml',
'demo/account_chart_template_demo.xml',
'demo/res_partner_demo.xml',
'demo/account_customer_invoice_demo.xml',
'demo/account_customer_refund_demo.xml',
'demo/account_supplier_invoice_demo.xml',
'demo/account_supplier_refund_demo.xml',
'demo/l10n_uy_adenda_demo.xml',
# restore
'demo/res_users_demo.xml',
Expand Down
42 changes: 25 additions & 17 deletions l10n_uy_account/data/account_fiscal_position_template_data.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<!-- TODO review this if needed -->
<record model='account.fiscal.position.template' id='fiscal_position_template_zona_franca'>
<field name='name'>Exportaciones a la Zona Franca</field>
<field name='name'>Zona Franca</field>
<field name="chart_template_id" ref="l10n_uy_chart_template"/>
</record>
<record id="fiscal_position_template_zona_franca_tax_10" model="account.fiscal.position.tax.template">
Expand All @@ -16,35 +15,44 @@
<field name="tax_src_id" ref="tax_template_vat_22_ventas"/>
<field name="tax_dest_id" ref="tax_template_vat_exento_ventas"/>
</record>
<record id="fiscal_position_template_zona_franca_compras_tax_10" model="account.fiscal.position.tax.template">
<field name="position_id" ref="fiscal_position_template_zona_franca"/>
<field name="tax_src_id" ref="tax_template_vat_10_compras"/>
<field name="tax_dest_id" ref="tax_template_vat_exento_compras"/>
</record>
<record id="fiscal_position_template_zona_franca_compras_tax_22" model="account.fiscal.position.tax.template">
<field name="position_id" ref="fiscal_position_template_zona_franca"/>
<field name="tax_src_id" ref="tax_template_vat_22_compras"/>
<field name="tax_dest_id" ref="tax_template_vat_exento_compras"/>
</record>

<record model='account.fiscal.position.template' id='fiscal_position_template_exportation'>
<field name='name'>Exportaciones al exterior</field>
<field name='name'>Exportación</field>
<field name="auto_apply">True</field>
<field name="chart_template_id" ref="l10n_uy_chart_template"/>
</record>
<record id="fiscal_position_template_exportation_10" model="account.fiscal.position.tax.template">
<field name="position_id" ref="fiscal_position_template_exportation"/>
<field name="tax_src_id" ref="tax_template_vat_10_ventas"/>
<field name="tax_dest_id" ref="tax_template_vat_exento_ventas"/>
</record>
<record id="fiscal_position_template_exportation_22" model="account.fiscal.position.tax.template">
<field name="position_id" ref="fiscal_position_template_exportation"/>
<field name="tax_src_id" ref="tax_template_vat_22_ventas"/>
<field name="tax_dest_id" ref="tax_template_vat_exento_ventas"/>
</record>

<record model='account.fiscal.position.template' id='fiscal_position_template_excepmt'>
<field name='name'>Operaciones Exentas</field>
<field name="chart_template_id" ref="l10n_uy_chart_template"/>
<record id="fiscal_position_template_exportation_compras_10" model="account.fiscal.position.tax.template">
<field name="position_id" ref="fiscal_position_template_exportation"/>
<field name="tax_src_id" ref="tax_template_vat_10_compras"/>
</record>
<record id="fiscal_position_template_excepmt_10" model="account.fiscal.position.tax.template">
<field name="position_id" ref="fiscal_position_template_excepmt"/>
<field name="tax_src_id" ref="tax_template_vat_10_ventas"/>
<field name="tax_dest_id" ref="tax_template_vat_exento_ventas"/>
<record id="fiscal_position_template_exportation_compras_22" model="account.fiscal.position.tax.template">
<field name="position_id" ref="fiscal_position_template_exportation"/>
<field name="tax_src_id" ref="tax_template_vat_22_compras"/>
</record>
<record id="fiscal_position_template_excepmt_22" model="account.fiscal.position.tax.template">
<field name="position_id" ref="fiscal_position_template_excepmt"/>
<field name="tax_src_id" ref="tax_template_vat_22_ventas"/>
<field name="tax_dest_id" ref="tax_template_vat_exento_ventas"/>

<record model='account.fiscal.position.template' id='account_fiscal_position_local_uruguay'>
<field name='name'>Local - Uruguay</field>
<field name="auto_apply">True</field>
<field name="chart_template_id" ref="l10n_uy_chart_template"/>
<field name="country_id" ref="base.uy"/>
</record>

</odoo>
2 changes: 2 additions & 0 deletions l10n_uy_account/data/res_partner_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
<field name="name">DGI</field>
<field name="is_company" eval="True"/>
<field name='l10n_latam_identification_type_id' ref='it_rut'/>
<field name='country_id' ref='base.uy'/>
</record>

<record model='res.partner' id='partner_cfu'>
<field name='name'>Consumidor Final Uruguayo</field>
<field name='l10n_latam_identification_type_id' ref='it_dni'/>
<field name='country_id' ref='base.uy'/>
</record>

</odoo>
192 changes: 192 additions & 0 deletions l10n_uy_account/demo/account_customer_invoice_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">

<record id="demo_invoice_1" model="account.move" context="{'allowed_company_ids': [ref('company_uy')]}">
<field name="ref">demo_invoice_1</field>
<field name="company_id" ref="company_uy"/>
<field name="partner_id" ref="demo_partner_5"/>
<field name="invoice_user_id" ref="base.user_demo"/>
<field name="invoice_payment_term_id" ref="account.account_payment_term_end_following_month"/>
<field name="move_type">out_invoice</field>
<field name="invoice_date" eval="time.strftime('%Y-%m')+'-01'"/>
<field name="journal_id" model="account.journal" eval="obj().search([('type', '=', 'sale'), ('l10n_uy_type', '=', 'preprinted')], limit=1)"/>
<field name="invoice_line_ids" eval="[
(0, 0, {'product_id': ref('product.product_product_2'), 'price_unit': 642.0, 'quantity': 1}),
(0, 0, {'product_id': ref('product.product_product_12'), 'price_unit': 120.0, 'quantity': 4}),
(0, 0, {'product_id': ref('product.product_product_16'), 'price_unit': 25.0, 'quantity': 20}),
(0, 0, {'product_id': ref('product.product_product_20'), 'price_unit': 1950.0, 'quantity': 4}),
]"/>
</record>

<record id="demo_invoice_2" model="account.move" context="{'allowed_company_ids': [ref('company_uy')]}">
<field name="ref">demo_invoice_2</field>
<field name="company_id" ref="company_uy"/>
<field name="partner_id" ref="demo_partner_5"/>
<field name="invoice_user_id" ref="base.user_demo"/>
<field name="invoice_payment_term_id" ref="account.account_payment_term_end_following_month"/>
<field name="move_type">out_invoice</field>
<field name="invoice_date" eval="time.strftime('%Y-%m')+'-05'"/>
<field name="journal_id" model="account.journal" eval="obj().search([('type', '=', 'sale'), ('l10n_uy_type', '=', 'preprinted')], limit=1)"/>
<field name="l10n_latam_document_type_id" model="l10n_latam.document.type" eval="obj().env.ref('l10n_uy_account.dc_e_inv')"/>
<field name="invoice_line_ids" eval="[
(0, 0, {'product_id': ref('product.product_product_27'), 'price_unit': 642.0, 'quantity': 5}),
(0, 0, {'product_id': ref('product.product_product_25'), 'price_unit': 3245.0, 'quantity': 2}),
(0, 0, {'product_id': ref('product.consu_delivery_01'), 'price_unit': 4000.0, 'quantity': 5}),
]"/>
</record>

<record id="demo_invoice_3" model="account.move" context="{'allowed_company_ids': [ref('company_uy')]}">
<field name="ref">demo_invoice_3</field>
<field name="company_id" ref="company_uy"/>
<field name="partner_id" ref="partner_cfu"/>
<field name="invoice_user_id" ref="base.user_demo"/>
<field name="invoice_payment_term_id" ref="account.account_payment_term_end_following_month"/>
<field name="move_type">out_invoice</field>
<field name="invoice_date" eval="time.strftime('%Y-%m')+'-10'"/>
<field name="journal_id" model="account.journal" eval="obj().search([('type', '=', 'sale'), ('l10n_uy_type', '=', 'preprinted')], limit=1)"/>
<field name="l10n_latam_document_type_id" model="l10n_latam.document.type" eval="obj().env.ref('l10n_uy_account.dc_e_ticket')"/>
<field name="invoice_line_ids" eval="[
(0, 0, {'product_id': ref('product.product_product_27'), 'price_unit': 642.0, 'quantity': 5}),
(0, 0, {'product_id': ref('product.product_product_2'), 'price_unit': 642.0, 'quantity': 1}),
(0, 0, {'product_id': ref('product.product_delivery_02'), 'price_unit': 40.0, 'quantity': 5}),
(0, 0, {'product_id': ref('product.product_order_01'), 'price_unit': 280.0, 'quantity': 3}),
(0, 0, {'product_id': ref('product.product_product_3'), 'price_unit': 450.0, 'quantity': 2}),
]"/>
</record>

<record id="base.USD" model="res.currency">
<field name="active" eval="True"/>
</record>

<record id="demo_invoice_4" model="account.move" context="{'allowed_company_ids': [ref('company_uy')]}">
<field name="ref">demo_invoice_4</field>
<field name="partner_id" ref="demo_partner_4"/>
<field name="invoice_user_id" ref="base.user_demo"/>
<field name="invoice_payment_term_id" ref="account.account_payment_term_end_following_month"/>
<field name="move_type">out_invoice</field>
<field name="invoice_date" eval="time.strftime('%Y-%m')+'-13'"/>
<field name="l10n_latam_document_type_id" model="l10n_latam.document.type" eval="obj().env.ref('l10n_uy_account.dc_e_inv')"/>
<field name="invoice_line_ids" eval="[
(0, 0, {'product_id': ref('product.product_product_27'), 'price_unit': 1000.0, 'quantity': 5}),
(0, 0, {'product_id': ref('product.product_product_3'), 'price_unit': 450.0, 'quantity': 2}),
(0, 0, {'product_id': ref('product.product_product_12'), 'price_unit': 120.0, 'quantity': 4}),
(0, 0, {'product_id': ref('product.product_product_13'), 'price_unit': 85.0, 'quantity': 3}),
]"/>
<field name="currency_id" ref="base.USD"/>
</record>

<record id="demo_invoice_5" model="account.move" context="{'allowed_company_ids': [ref('company_uy')]}">
<field name="ref">demo_invoice_5</field>
<field name="partner_id" ref="res_partner_foreign"/>
<field name="invoice_user_id" ref="base.user_demo"/>
<field name="invoice_payment_term_id" ref="account.account_payment_term_end_following_month"/>
<field name="move_type">out_invoice</field>
<field name="invoice_date" eval="time.strftime('%Y-%m')+'-11'"/>
<field name="l10n_latam_document_type_id" model="l10n_latam.document.type" eval="obj().env.ref('l10n_uy_account.dc_e_inv_exp')"/>
<field name="invoice_line_ids" eval="[
(0, 0, {'product_id': ref('product.consu_delivery_02'), 'price_unit': 4000.0, 'quantity': 5}),
(0, 0, {'product_id': ref('product.product_product_3'), 'price_unit': 450.0, 'quantity': 2}),
(0, 0, {'product_id': ref('product.product_product_12'), 'price_unit': 120.0, 'quantity': 4}),
(0, 0, {'product_id': ref('product.product_product_13'), 'price_unit': 85.0, 'quantity': 3}),
(0, 0, {'product_id': ref('product.consu_delivery_03'), 'price_unit': 2350.0, 'quantity': 1}),
]"/>
<field name="currency_id" ref="base.USD"/>
</record>

<record id="demo_invoice_6" model="account.move" context="{'allowed_company_ids': [ref('company_uy')]}">
<field name="ref">demo_invoice_6</field>
<field name="company_id" ref="company_uy"/>
<field name="partner_id" ref="partner_cfu"/>
<field name="invoice_user_id" ref="base.user_demo"/>
<field name="invoice_payment_term_id" ref="account.account_payment_term_end_following_month"/>
<field name="move_type">out_invoice</field>
<field name="invoice_date" eval="time.strftime('%Y-%m')+'-14'"/>
<field name="l10n_latam_document_type_id" model="l10n_latam.document.type" eval="obj().env.ref('l10n_uy_account.dc_e_ticket')"/>
<field name="invoice_line_ids" eval="[
(0, 0, {'product_id': ref('product.product_product_1'), 'price_unit': 216.0, 'quantity': 9}),
(0, 0, {'product_id': ref('product.product_delivery_01'), 'price_unit': 70.0, 'quantity': 11}),
(0, 0, {'product_id': ref('product.product_delivery_02'), 'price_unit': 40.0, 'quantity': 5}),
(0, 0, {'product_id': ref('product.product_order_01'), 'price_unit': 280.0, 'quantity': 3}),
(0, 0, {'product_id': ref('product.consu_delivery_02'), 'price_unit': 4000.0, 'quantity': 5}),
(0, 0, {'product_id': ref('product.product_product_3'), 'price_unit': 450.0, 'quantity': 2}),
(0, 0, {'product_id': ref('product.product_product_12'), 'price_unit': 120.0, 'quantity': 4}),
(0, 0, {'product_id': ref('product.product_product_13'), 'price_unit': 85.0, 'quantity': 3}),
(0, 0, {'product_id': ref('product.product_product_16'), 'price_unit': 25.0, 'quantity': 20}),
(0, 0, {'product_id': ref('product.product_product_20'), 'price_unit': 1950.0, 'quantity': 4}),
]"/>
</record>

<record id="demo_invoice_7" model="account.move" context="{'allowed_company_ids': [ref('company_uy')]}">
<field name="ref">demo_invoice_7</field>
<field name="company_id" ref="company_uy"/>
<field name="partner_id" ref="partner_cfu"/>
<field name="invoice_user_id" ref="base.user_demo"/>
<field name="invoice_payment_term_id" ref="account.account_payment_term_end_following_month"/>
<field name="move_type">out_invoice</field>
<field name="invoice_date" eval="time.strftime('%Y-%m')+'-14'"/>
<field name="l10n_latam_document_type_id" model="l10n_latam.document.type" eval="obj().env.ref('l10n_uy_account.dc_e_ticket')"/>
<field name="invoice_line_ids" eval="[
(0, 0, {'product_id': ref('product.product_product_1'), 'price_unit': 216.0, 'quantity': 3}),
(0, 0, {'product_id': ref('product.product_delivery_01'), 'price_unit': 70.0, 'quantity': 1}),
(0, 0, {'product_id': ref('product.product_delivery_02'), 'price_unit': 40.0, 'quantity': 5}),
(0, 0, {'product_id': ref('product.product_product_3'), 'price_unit': 450.0, 'quantity': 7}),
(0, 0, {'product_id': ref('product.product_product_12'), 'price_unit': 120.0, 'quantity': 4}),
(0, 0, {'product_id': ref('product.product_product_16'), 'price_unit': 25.0, 'quantity': 16}),
(0, 0, {'product_id': ref('product.product_product_20'), 'price_unit': 1950.0, 'quantity': 2}),
]"/>
</record>

<record id="demo_invoice_8" model="account.move" context="{'allowed_company_ids': [ref('company_uy')]}">
<field name="ref">demo_invoice_8</field>
<field name="company_id" ref="company_uy"/>
<field name="partner_id" ref="demo_partner_5"/>
<field name="invoice_user_id" ref="base.user_demo"/>
<field name="invoice_payment_term_id" ref="account.account_payment_term_end_following_month"/>
<field name="move_type">out_invoice</field>
<field name="invoice_date" eval="time.strftime('%Y-%m')+'-01'"/>
<field name="l10n_latam_document_type_id" model="l10n_latam.document.type" eval="obj().env.ref('l10n_uy_account.dc_dn_e_inv')"/>
<field name="invoice_line_ids" eval="[
(0, 0, {'product_id': ref('product.product_product_27'), 'price_unit': 642.0, 'quantity': 4}),
(0, 0, {'product_id': ref('product.product_product_25'), 'price_unit': 3245.0, 'quantity': 2}),
(0, 0, {'product_id': ref('product.consu_delivery_01'), 'price_unit': 4000.0, 'quantity': 1}),
(0, 0, {'product_id': ref('product.product_product_12'), 'price_unit': 120.0, 'quantity': 3}),
]"/>
</record>

<record id="demo_invoice_9" model="account.move" context="{'allowed_company_ids': [ref('company_uy')]}">
<field name="ref">demo_invoice_9</field>
<field name="company_id" ref="company_uy"/>
<field name="partner_id" ref="demo_partner_4"/>
<field name="invoice_user_id" ref="base.user_demo"/>
<field name="invoice_payment_term_id" ref="account.account_payment_term_end_following_month"/>
<field name="move_type">out_invoice</field>
<field name="l10n_latam_document_type_id" model="l10n_latam.document.type" eval="obj().env.ref('l10n_uy_account.dc_e_ticket')"/>
<field name="invoice_date" eval="time.strftime('%Y-%m')+'-05'"/>
<field name="invoice_line_ids" eval="[
(0, 0, {'product_id': ref('product.product_product_27'), 'price_unit': 642.0, 'quantity': 5}),
(0, 0, {'product_id': ref('product.product_product_25'), 'price_unit': 3245.0, 'quantity': 2}),
(0, 0, {'product_id': ref('product.consu_delivery_01'), 'price_unit': 4000.0, 'quantity': 5}),
(0, 0, {'product_id': ref('product.product_delivery_02'), 'price_unit': 4000.0, 'quantity': 1}),
]"/>
</record>

<function model="account.move.line" name="write" context="{'check_move_validity': False, 'active_test': False}">
<value model="account.move.line" search="[('move_id', '=', ref('demo_invoice_1')), ('product_id', '=', ref('product.product_product_20'))]"/>
<value model="account.tax" eval="{'tax_ids': [(6, 0, obj().search([('company_id', '=', ref('company_uy')), ('type_tax_use', '=', 'sale'), ('tax_group_id.l10n_uy_vat_code', '=', 'vat_10')], limit=1).ids)]}"/>
</function>

<function model="account.move.line" name="write" context="{'check_move_validity': False, 'active_test': False}">
<value model="account.move.line" search="[('move_id', '=', ref('demo_invoice_4')), ('product_id', '=', ref('product.product_product_27'))]"/>
<value model="account.tax" eval="{'tax_ids': [(6, 0, obj().search([('company_id', '=', ref('company_uy')), ('type_tax_use', '=', 'sale'), ('tax_group_id.l10n_uy_vat_code', '=', 'vat_10')], limit=1).ids)]}"/>
</function>

<function model="account.move.line" name="write" context="{'check_move_validity': False, 'active_test': False}">
<value model="account.move.line" search="[('move_id', '=', ref('demo_invoice_9')), ('product_id', '=', ref('product.product_product_25'))]"/>
<value model="account.tax" eval="{'tax_ids': [(6, 0, obj().search([('company_id', '=', ref('company_uy')), ('type_tax_use', '=', 'sale'), ('tax_group_id.l10n_uy_vat_code', '=', 'vat_10')], limit=1).ids)]}"/>
</function>

<function model="account.move" name="action_post">
<value eval="[ref('demo_invoice_1'), ref('demo_invoice_2'), ref('demo_invoice_3'), ref('demo_invoice_4'), ref('demo_invoice_5'), ref('demo_invoice_6'), ref('demo_invoice_8'), ref('demo_invoice_9')]"/>
</function>

</odoo>
Loading

0 comments on commit a175bf2

Please sign in to comment.