mirror of
https://github.com/bringout/oca-ocb-l10n_americas.git
synced 2026-04-27 19:12:05 +02:00
19.0 vanilla
This commit is contained in:
parent
89c6e82fe7
commit
1b82c20a58
572 changed files with 43570 additions and 53303 deletions
3
odoo-bringout-oca-ocb-l10n_uy/l10n_uy/demo/__init__.py
Normal file
3
odoo-bringout-oca-ocb-l10n_uy/l10n_uy/demo/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import account_demo
|
||||
527
odoo-bringout-oca-ocb-l10n_uy/l10n_uy/demo/account_demo.py
Normal file
527
odoo-bringout-oca-ocb-l10n_uy/l10n_uy/demo/account_demo.py
Normal file
|
|
@ -0,0 +1,527 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
import time
|
||||
import logging
|
||||
from odoo import api, models, Command
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AccountChartTemplate(models.AbstractModel):
|
||||
_inherit = "account.chart.template"
|
||||
|
||||
@api.model
|
||||
def _get_demo_data(self, company=False):
|
||||
if company.account_fiscal_country_id.code == "UY":
|
||||
return {
|
||||
'res.partner': self._l10n_uy_get_demo_data_res_partner(company),
|
||||
'account.move': self._l10n_uy_get_demo_data_move(company),
|
||||
'account.move.reversal': self._l10n_uy_get_demo_data_move_reversal(company),
|
||||
}
|
||||
else:
|
||||
return super()._get_demo_data(company)
|
||||
|
||||
def _post_load_demo_data(self, company=False):
|
||||
if company.account_fiscal_country_id.code != "UY":
|
||||
return super()._post_load_demo_data(company)
|
||||
invoices = (
|
||||
self.ref('demo_invoice_1')
|
||||
+ self.ref('demo_invoice_2')
|
||||
+ self.ref('demo_invoice_3')
|
||||
+ self.ref('demo_invoice_4')
|
||||
+ self.ref('demo_invoice_5')
|
||||
+ self.ref('demo_invoice_6')
|
||||
+ self.ref('demo_invoice_8')
|
||||
+ self.ref('demo_invoice_9')
|
||||
+ self.ref('demo_sup_invoice_1')
|
||||
+ self.ref('demo_sup_invoice_2')
|
||||
+ self.ref('demo_sup_invoice_3')
|
||||
+ self.ref('demo_sup_invoice_6')
|
||||
+ self.ref('demo_sup_invoice_7')
|
||||
+ self.ref('demo_sup_invoice_8')
|
||||
+ self.ref('demo_sup_invoice_9')
|
||||
)
|
||||
# the invoice_extract acts like a placeholder for the OCR to be ran and
|
||||
# doesn't contain any lines yet
|
||||
for move in invoices:
|
||||
try:
|
||||
move.action_post()
|
||||
except (UserError, ValidationError):
|
||||
_logger.exception('Error while posting invoices')
|
||||
|
||||
# Post the reversal moves
|
||||
invoices_to_revert = (
|
||||
self.ref('demo_refund_invoice_1')
|
||||
+ self.ref('demo_refund_invoice_2')
|
||||
+ self.ref('demo_refund_invoice_3')
|
||||
+ self.ref('demo_refund_invoice_4')
|
||||
+ self.ref('demo_sup_refund_invoice_3')
|
||||
+ self.ref('demo_sup_refund_invoice_2')
|
||||
)
|
||||
for move in invoices_to_revert:
|
||||
try:
|
||||
self.env['account.move'].browse(move.refund_moves().get('res_id')).action_post()
|
||||
except (UserError, ValidationError):
|
||||
_logger.exception('Error while posting reversal moves')
|
||||
|
||||
@api.model
|
||||
def _l10n_uy_get_demo_data_move(self, company=False):
|
||||
cid = company.id or self.env.company.id
|
||||
sale_journal = self.env['account.journal'].search(
|
||||
domain=[
|
||||
*self.env['account.journal']._check_company_domain(cid),
|
||||
('type', '=', 'sale')
|
||||
], limit=1,
|
||||
)
|
||||
purchase_journal = self.env['account.journal'].search(
|
||||
domain=[
|
||||
*self.env['account.journal']._check_company_domain(cid),
|
||||
('type', '=', 'purchase')
|
||||
], limit=1,
|
||||
)
|
||||
return {
|
||||
# Customer invoice demo
|
||||
self.company_xmlid('demo_invoice_1'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'base.res_partner_4',
|
||||
'journal_id': sale_journal.id,
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m-01'),
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_2', 'price_unit': 642.0, 'quantity': 1}),
|
||||
Command.create({'product_id': 'product.product_product_12', 'price_unit': 120.0, 'quantity': 4}),
|
||||
Command.create({'product_id': 'product.product_product_16', 'price_unit': 25.0, 'quantity': 20}),
|
||||
Command.create({'product_id': 'product.product_product_20', 'price_unit': 1950.0, 'quantity': 4}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_invoice_2'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'base.res_partner_4',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'journal_id': sale_journal.id,
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m-05'),
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_inv',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 642.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_product_25', 'price_unit': 3245.0, 'quantity': 2}),
|
||||
Command.create({'product_id': 'product.consu_delivery_01', 'price_unit': 4000.0, 'quantity': 5}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_invoice_3'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'l10n_uy.partner_cfu',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'journal_id': sale_journal.id,
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m-10'),
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_ticket',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 642.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_product_2', 'price_unit': 642.0, 'quantity': 1}),
|
||||
Command.create({'product_id': 'product.product_delivery_02', 'price_unit': 40.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_order_01', 'price_unit': 280.0, 'quantity': 3}),
|
||||
Command.create({'product_id': 'product.product_product_3', 'price_unit': 450.0, 'quantity': 2}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_invoice_4'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'demo_partner_4',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'journal_id': sale_journal.id,
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m-13'),
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_inv',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 1000.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_product_3', 'price_unit': 450.0, 'quantity': 2}),
|
||||
Command.create({'product_id': 'product.product_product_12', 'price_unit': 120.0, 'quantity': 4}),
|
||||
Command.create({'product_id': 'product.product_product_13', 'price_unit': 85.0, 'quantity': 3}),
|
||||
],
|
||||
'currency_id': 'base.USD',
|
||||
},
|
||||
self.company_xmlid('demo_invoice_5'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'res_partner_foreign',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'journal_id': sale_journal.id,
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m-11'),
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_inv_exp',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.consu_delivery_02', 'price_unit': 4000.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_product_3', 'price_unit': 450.0, 'quantity': 2}),
|
||||
Command.create({'product_id': 'product.product_product_12', 'price_unit': 120.0, 'quantity': 4}),
|
||||
Command.create({'product_id': 'product.product_product_13', 'price_unit': 85.0, 'quantity': 3}),
|
||||
Command.create({'product_id': 'product.consu_delivery_03', 'price_unit': 2350.0, 'quantity': 1}),
|
||||
|
||||
],
|
||||
'currency_id': 'base.USD',
|
||||
},
|
||||
self.company_xmlid('demo_invoice_6'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'l10n_uy.partner_cfu',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'journal_id': sale_journal.id,
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m-14'),
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_ticket',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_1', 'price_unit': 216.0, 'quantity': 9}),
|
||||
Command.create({'product_id': 'product.product_delivery_01', 'price_unit': 70.0, 'quantity': 11}),
|
||||
Command.create({'product_id': 'product.product_delivery_02', 'price_unit': 40.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_order_01', 'price_unit': 280.0, 'quantity': 3}),
|
||||
Command.create({'product_id': 'product.consu_delivery_02', 'price_unit': 4000.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_product_3', 'price_unit': 450.0, 'quantity': 2}),
|
||||
Command.create({'product_id': 'product.product_product_12', 'price_unit': 120.0, 'quantity': 4}),
|
||||
Command.create({'product_id': 'product.product_product_13', 'price_unit': 85.0, 'quantity': 3}),
|
||||
Command.create({'product_id': 'product.product_product_16', 'price_unit': 25.0, 'quantity': 20}),
|
||||
Command.create({'product_id': 'product.product_product_20', 'price_unit': 1950.0, 'quantity': 4}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_invoice_7'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'l10n_uy.partner_cfu',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m-14'),
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_ticket',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_1', 'price_unit': 216.0, 'quantity': 3}),
|
||||
Command.create({'product_id': 'product.product_delivery_01', 'price_unit': 70.0, 'quantity': 1}),
|
||||
Command.create({'product_id': 'product.product_delivery_02', 'price_unit': 40.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_product_3', 'price_unit': 450.0, 'quantity': 7}),
|
||||
Command.create({'product_id': 'product.product_product_12', 'price_unit': 120.0, 'quantity': 4}),
|
||||
Command.create({'product_id': 'product.product_product_16', 'price_unit': 25.0, 'quantity': 16}),
|
||||
Command.create({'product_id': 'product.product_product_20', 'price_unit': 1950.0, 'quantity': 2}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_invoice_8'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'demo_partner_5',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m-01'),
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_dn_e_inv',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 642.0, 'quantity': 4}),
|
||||
Command.create({'product_id': 'product.product_product_25', 'price_unit': 3245.0, 'quantity': 2}),
|
||||
Command.create({'product_id': 'product.consu_delivery_01', 'price_unit': 4000.0, 'quantity': 1}),
|
||||
Command.create({'product_id': 'product.product_product_12', 'price_unit': 120.0, 'quantity': 3}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_invoice_9'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'demo_partner_4',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m-05'),
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_ticket',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 642.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_product_25', 'price_unit': 3245.0, 'quantity': 2}),
|
||||
Command.create({'product_id': 'product.consu_delivery_01', 'price_unit': 4000.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_delivery_02', 'price_unit': 4000.0, 'quantity': 1}),
|
||||
],
|
||||
},
|
||||
|
||||
# Supplier invoice demo
|
||||
self.company_xmlid('demo_sup_invoice_1'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'demo_partner_5',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'journal_id': purchase_journal.id,
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m') + '-01',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_inv',
|
||||
'l10n_latam_document_number': 'AA0000008',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_2', 'price_unit': 642.0, 'quantity': 3}),
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 228.0, 'quantity': 1}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_sup_invoice_2'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'res_partner_foreign',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'journal_id': purchase_journal.id,
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m') + '-01',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_inv_exp',
|
||||
'l10n_latam_document_number': 'AA0000009',
|
||||
'currency_id': 'base.USD',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 642.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_product_2', 'price_unit': 2584.0, 'quantity': 2}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_sup_invoice_3'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'demo_partner_4',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m') + '-26',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_inv',
|
||||
'l10n_latam_document_number': 'AA0000010',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_2', 'price_unit': 1642.0, 'quantity': 8}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_sup_invoice_4'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'l10n_uy.partner_cfu',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m') + '-26',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_ticket',
|
||||
'l10n_latam_document_number': 'AA0000011',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_2', 'price_unit': 1642.0, 'quantity': 3}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_sup_invoice_5'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'res_partner_foreign',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m') + '-01',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_inv_exp',
|
||||
'l10n_latam_document_number': 'AA0000012',
|
||||
'currency_id': 'base.USD',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 642.0, 'quantity': 4}),
|
||||
Command.create({'product_id': 'product.product_product_2', 'price_unit': 3245.0, 'quantity': 1}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_sup_invoice_6'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'res_partner_foreign',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m') + '-01',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_inv_exp',
|
||||
'l10n_latam_document_number': 'AA0000013',
|
||||
'currency_id': 'base.USD',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 335.0, 'quantity': 8}),
|
||||
Command.create({'product_id': 'product.product_product_2', 'price_unit': 9584.0, 'quantity': 16}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_sup_invoice_7'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'demo_partner_5',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'journal_id': purchase_journal.id,
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m') + '-01',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_ticket',
|
||||
'l10n_latam_document_number': 'AA0000014',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 642.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_product_25', 'price_unit': 3245.0, 'quantity': 2}),
|
||||
Command.create({'product_id': 'product.consu_delivery_01', 'price_unit': 4000.0, 'quantity': 5}),
|
||||
Command.create({'product_id': 'product.product_delivery_02', 'price_unit': 4000.0, 'quantity': 1}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_sup_invoice_8'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'l10n_uy.partner_cfu',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m') + '-01',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_ticket',
|
||||
'l10n_latam_document_number': 'AA0000015',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.consu_delivery_02', 'price_unit': 4000.0, 'quantity': 7}),
|
||||
Command.create({'product_id': 'product.product_product_3', 'price_unit': 450.0, 'quantity': 6}),
|
||||
Command.create({'product_id': 'product.product_product_12', 'price_unit': 120.0, 'quantity': 1}),
|
||||
Command.create({'product_id': 'product.product_product_13', 'price_unit': 85.0, 'quantity': 1}),
|
||||
Command.create({'product_id': 'product.consu_delivery_03', 'price_unit': 2350.0, 'quantity': 4}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_sup_invoice_9'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'demo_partner_4',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m') + '-01',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_e_ticket',
|
||||
'l10n_latam_document_number': 'AA0000016',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_27', 'price_unit': 1000.0, 'quantity': 8}),
|
||||
Command.create({'product_id': 'product.product_product_3', 'price_unit': 450.0, 'quantity': 7}),
|
||||
Command.create({'product_id': 'product.product_product_12', 'price_unit': 120.0, 'quantity': 1}),
|
||||
Command.create({'product_id': 'product.product_product_13', 'price_unit': 85.0, 'quantity': 2}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('demo_sup_invoice_10'): {
|
||||
'company_id': company.id,
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'demo_partner_5',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': time.strftime('%Y-%m') + '-01',
|
||||
'l10n_latam_document_number': 'AA0000017',
|
||||
'invoice_line_ids': [
|
||||
Command.create({'product_id': 'product.product_product_2', 'price_unit': 642.0, 'quantity': 1}),
|
||||
Command.create({'product_id': 'product.product_product_12', 'price_unit': 120.0, 'quantity': 4}),
|
||||
Command.create({'product_id': 'product.product_product_16', 'price_unit': 25.0, 'quantity': 20}),
|
||||
Command.create({'product_id': 'product.product_product_20', 'price_unit': 1950.0, 'quantity': 4}),
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
@api.model
|
||||
def _l10n_uy_get_demo_data_move_reversal(self, company=False):
|
||||
cid = company.id or self.env.company.id
|
||||
sale_journal = self.env['account.journal'].search(
|
||||
domain=[
|
||||
*self.env['account.journal']._check_company_domain(cid),
|
||||
('type', '=', 'sale')
|
||||
], limit=1,
|
||||
)
|
||||
purchase_journal = self.env['account.journal'].search(
|
||||
domain=[
|
||||
*self.env['account.journal']._check_company_domain(cid),
|
||||
('type', '=', 'purchase')
|
||||
], limit=1,
|
||||
)
|
||||
return {
|
||||
# Account Customer Refund
|
||||
|
||||
# Create draft refund for invoice 3
|
||||
self.company_xmlid('demo_refund_invoice_1'): {
|
||||
'reason': 'Venta Cancelada',
|
||||
'move_ids': 'demo_invoice_1',
|
||||
'journal_id': sale_journal.id,
|
||||
'date': time.strftime('%Y-%m') + '-01'
|
||||
},
|
||||
# Create draft refund for invoice 4
|
||||
self.company_xmlid('demo_refund_invoice_2'): {
|
||||
'reason': 'Venta Cancelada',
|
||||
'move_ids': 'demo_invoice_4',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_cn_e_ticket',
|
||||
'journal_id': sale_journal.id,
|
||||
'date': time.strftime('%Y-%m') + '-01'
|
||||
},
|
||||
self.company_xmlid('demo_refund_invoice_3'): {
|
||||
'reason': 'Venta Cancelada',
|
||||
'move_ids': 'demo_invoice_5',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_cn_e_inv_exp',
|
||||
'journal_id': sale_journal.id,
|
||||
'date': time.strftime('%Y-%m') + '-01'
|
||||
},
|
||||
self.company_xmlid('demo_refund_invoice_4'): {
|
||||
'reason': 'Venta Cancelada',
|
||||
'move_ids': 'demo_invoice_6',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_cn_e_ticket',
|
||||
'journal_id': sale_journal.id,
|
||||
'date': time.strftime('%Y-%m') + '-01'
|
||||
},
|
||||
|
||||
# Account supplier refund
|
||||
self.company_xmlid('demo_sup_refund_invoice_3'): {
|
||||
'reason': 'Mercadería defectuosa',
|
||||
'l10n_latam_document_number': 'BB0123456',
|
||||
'move_ids': 'demo_sup_invoice_1',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_cn_e_inv',
|
||||
'journal_id': purchase_journal.id,
|
||||
'date': time.strftime('%Y-%m') + '-01'
|
||||
},
|
||||
self.company_xmlid('demo_sup_refund_invoice_2'): {
|
||||
'reason': 'Venta cancelada',
|
||||
'l10n_latam_document_number': 'BB0123457',
|
||||
'move_ids': 'demo_sup_invoice_2',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_cn_e_inv_exp',
|
||||
'journal_id': purchase_journal.id,
|
||||
'date': time.strftime('%Y-%m') + '-01'
|
||||
},
|
||||
self.company_xmlid('demo_sup_refund_invoice_1'): {
|
||||
'reason': 'Venta cancelada',
|
||||
'l10n_latam_document_number': 'BB0123458',
|
||||
'move_ids': 'demo_sup_invoice_7',
|
||||
'l10n_latam_document_type_id': 'l10n_uy.dc_cn_e_ticket',
|
||||
'journal_id': purchase_journal.id,
|
||||
'date': time.strftime('%Y-%m') + '-01'
|
||||
},
|
||||
}
|
||||
|
||||
@api.model
|
||||
def _l10n_uy_get_demo_data_res_partner(self, company=False):
|
||||
return {
|
||||
self.company_xmlid('demo_partner_4'): {
|
||||
'name': 'Global Solutions Corp',
|
||||
'l10n_latam_identification_type_id': 'l10n_uy.it_rut',
|
||||
'vat': '218435730016',
|
||||
'street': 'Avenida Central 5678',
|
||||
'city': 'Punta del Este',
|
||||
'state_id': 'base.state_uy_01',
|
||||
'country_id': 'base.uy',
|
||||
'email': 'info@globalsolutions.com',
|
||||
},
|
||||
self.company_xmlid('demo_partner_5'): {
|
||||
'name': 'Tech Innovations S.A.',
|
||||
'l10n_latam_identification_type_id': 'l10n_uy.it_rut',
|
||||
'vat': '219999830019',
|
||||
'street': 'Avenida de la Libertad 1234',
|
||||
'city': 'Montevideo',
|
||||
'state_id': 'base.state_uy_01',
|
||||
'country_id': 'base.uy',
|
||||
'email': 'contact@techinnovations.com',
|
||||
},
|
||||
self.company_xmlid('demo_partner_6'): {
|
||||
'name': 'CORREO URUGUAYO',
|
||||
'l10n_latam_identification_type_id': 'l10n_uy.it_rut',
|
||||
'vat': '214130990011',
|
||||
'street': 'Buenos Aires 451',
|
||||
'city': 'Montevideo',
|
||||
'state_id': 'base.state_uy_10',
|
||||
'country_id': 'base.uy',
|
||||
'email': 'correo@example.com',
|
||||
},
|
||||
# Foreign Company
|
||||
'res_partner_foreign': {
|
||||
'name': 'Foreign Inc',
|
||||
'l10n_latam_identification_type_id': 'l10n_latam_base.it_vat',
|
||||
'is_company': True,
|
||||
'vat': '17-2038053',
|
||||
'zip': '95380',
|
||||
'street': '7841 Red Road',
|
||||
'city': 'San Francisco',
|
||||
'state_id': 'base.state_us_5',
|
||||
'country_id': 'base.us',
|
||||
'email': 'foreing@example.com',
|
||||
'phone': '(123)-456-7890',
|
||||
'website': 'http://www.foreign-inc.com',
|
||||
},
|
||||
# Resident Alien (Foreign living at Uruguay)
|
||||
'res_partner_resident_alien': {
|
||||
'name': 'Resident Alien',
|
||||
'l10n_latam_identification_type_id': 'l10n_uy.it_nie',
|
||||
'vat': '93:402.010-1',
|
||||
'zip': '2343',
|
||||
'street': 'Calle False 1234',
|
||||
'city': 'Montevideo',
|
||||
'state_id': 'base.state_uy_10',
|
||||
'country_id': 'base.uy',
|
||||
'email': 'nie@example.com',
|
||||
},
|
||||
}
|
||||
|
|
@ -1,34 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="partner_demo_company_uy" model="res.partner">
|
||||
<record id="base.partner_demo_company_uy" model="res.partner" forcecreate="1">
|
||||
<field name="name">UY Company</field>
|
||||
<field name="vat">UY130551600010</field>
|
||||
<field name="street"></field>
|
||||
<field name='l10n_latam_identification_type_id' ref='it_rut'/>
|
||||
<field name="vat">218296790015</field>
|
||||
<field name='state_id' ref="base.state_uy_10"/>
|
||||
<field name="street">Calle Falsa 123</field>
|
||||
<field name="city">Montevideo</field>
|
||||
<field name="country_id" ref="base.uy"/>
|
||||
|
||||
<field name="zip">12800</field>
|
||||
<field name="phone">+598 94 231 234</field>
|
||||
<field name="email">info@company.uyexample.com</field>
|
||||
<field name="website">www.uyexample.com</field>
|
||||
<field name="is_company" eval="True"/>
|
||||
</record>
|
||||
|
||||
<record id="demo_company_uy" model="res.company">
|
||||
<record id="base.demo_company_uy" model="res.company" forcecreate="1">
|
||||
<field name="name">UY Company</field>
|
||||
<field name="partner_id" ref="partner_demo_company_uy"/>
|
||||
<field name="partner_id" ref="base.partner_demo_company_uy"/>
|
||||
</record>
|
||||
|
||||
<function model="res.company" name="_onchange_country_id">
|
||||
<value eval="[ref('demo_company_uy')]"/>
|
||||
<value eval="[ref('base.demo_company_uy')]"/>
|
||||
</function>
|
||||
|
||||
<function model="res.users" name="write">
|
||||
<value eval="[ref('base.user_root'), ref('base.user_admin'), ref('base.user_demo')]"/>
|
||||
<value eval="{'company_ids': [(4, ref('l10n_uy.demo_company_uy'))]}"/>
|
||||
<value eval="{'company_ids': [(4, ref('base.demo_company_uy'))]}"/>
|
||||
</function>
|
||||
|
||||
<function model="account.chart.template" name="try_loading">
|
||||
<value eval="[ref('l10n_uy.uy_chart_template')]"/>
|
||||
<value model="res.company" eval="obj().env.ref('l10n_uy.demo_company_uy')"/>
|
||||
<value eval="[]"/>
|
||||
<value>uy</value>
|
||||
<value model="res.company" eval="obj().env.ref('base.demo_company_uy')"/>
|
||||
<value name="install_demo" eval="True"/>
|
||||
</function>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<odoo>
|
||||
|
||||
<record id="rateUSD" model="res.currency.rate">
|
||||
<field name="company_id" ref="base.demo_company_uy"/>
|
||||
<field name="rate">0.026</field>
|
||||
<field name="currency_id" ref="base.USD"/>
|
||||
<field eval="('2023-03-02')" name="name"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue