mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-27 21:22:01 +02:00
19.0 vanilla
This commit is contained in:
parent
ff721d030e
commit
7721452493
1826 changed files with 124775 additions and 274114 deletions
3
odoo-bringout-oca-ocb-l10n_pk/l10n_pk/demo/__init__.py
Normal file
3
odoo-bringout-oca-ocb-l10n_pk/l10n_pk/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
|
||||
244
odoo-bringout-oca-ocb-l10n_pk/l10n_pk/demo/account_demo.py
Normal file
244
odoo-bringout-oca-ocb-l10n_pk/l10n_pk/demo/account_demo.py
Normal file
|
|
@ -0,0 +1,244 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from odoo import api, fields, models, Command
|
||||
|
||||
|
||||
class AccountChartTemplate(models.AbstractModel):
|
||||
_inherit = "account.chart.template"
|
||||
|
||||
@api.model
|
||||
def _get_demo_data_move(self, company=False):
|
||||
moves = super()._get_demo_data_move(company)
|
||||
if company.account_fiscal_country_id.code == "PK":
|
||||
sale_journal = self.env['account.journal'].search(
|
||||
domain=[
|
||||
*self.env['account.journal']._check_company_domain((company or self.env.company).id),
|
||||
('type', '=', 'sale'),
|
||||
], limit=1)
|
||||
moves.update({
|
||||
self.company_xmlid('l10n_pk_demo_invoice_1'): {
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'l10n_pk.res_partner_punjab',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': fields.Datetime.today() - relativedelta(days=1),
|
||||
'journal_id': sale_journal.id,
|
||||
'invoice_line_ids': [
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_8',
|
||||
'quantity': 2,
|
||||
'price_unit': 40000.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_10'
|
||||
])],
|
||||
}),
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_9',
|
||||
'quantity': 3,
|
||||
'price_unit': 400.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_17',
|
||||
'pk_tax_wh_S_1'
|
||||
])],
|
||||
}),
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_10',
|
||||
'quantity': 4,
|
||||
'price_unit': 300.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_5'
|
||||
])],
|
||||
}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('l10n_pk_demo_invoice_2'): {
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'l10n_pk.res_partner_punjab',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': fields.Datetime.today() - relativedelta(days=2),
|
||||
'journal_id': sale_journal.id,
|
||||
'invoice_line_ids': [
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_9',
|
||||
'quantity': 2,
|
||||
'price_unit': 4000.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_10'
|
||||
])],
|
||||
}),
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_10',
|
||||
'quantity': 3,
|
||||
'price_unit': 300.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_5'
|
||||
])],
|
||||
}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('l10n_pk_demo_invoice_3'): {
|
||||
'move_type': 'out_invoice',
|
||||
'partner_id': 'base.res_partner_3',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': fields.Datetime.today() - relativedelta(days=3),
|
||||
'journal_id': sale_journal.id,
|
||||
'invoice_line_ids': [
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_4',
|
||||
'quantity': 10,
|
||||
'price_unit': 800.0,
|
||||
'tax_ids': False,
|
||||
}),
|
||||
]
|
||||
},
|
||||
self.company_xmlid('l10n_pk_demo_reconcile_1'): {
|
||||
'move_type': 'out_refund',
|
||||
'partner_id': 'l10n_pk.res_partner_punjab',
|
||||
'invoice_date': fields.Datetime.today() - relativedelta(days=1),
|
||||
'delivery_date': fields.Datetime.today() - relativedelta(days=1),
|
||||
'invoice_line_ids': [
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_8',
|
||||
'quantity': 2,
|
||||
'price_unit': 40000.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_10'
|
||||
])],
|
||||
}),
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_9',
|
||||
'quantity': 3,
|
||||
'price_unit': 400.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_10',
|
||||
'pk_tax_wh_S_5'
|
||||
])],
|
||||
}),
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_10',
|
||||
'quantity': 4,
|
||||
'price_unit': 300.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_5'
|
||||
])],
|
||||
}),
|
||||
],
|
||||
},
|
||||
self.company_xmlid('l10n_pk_demo_reconcile_2'): {
|
||||
'move_type': 'out_refund',
|
||||
'partner_id': 'base.res_partner_3',
|
||||
'invoice_date': fields.Datetime.today() - relativedelta(days=2),
|
||||
'delivery_date': fields.Datetime.today() - relativedelta(days=2),
|
||||
'invoice_line_ids': [
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_4',
|
||||
'quantity': 10,
|
||||
'price_unit': 800.0,
|
||||
'tax_ids': False,
|
||||
}),
|
||||
]
|
||||
},
|
||||
self.company_xmlid('l10n_pk_demo_vendor_bill_1'): {
|
||||
'ref': 'INV/001',
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'l10n_pk.res_partner_islamabad',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': fields.Datetime.today() - relativedelta(days=1),
|
||||
'invoice_line_ids': [
|
||||
Command.create({
|
||||
'product_id': 'product.consu_delivery_01',
|
||||
'quantity': 1,
|
||||
'price_unit': 1000.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_15'
|
||||
])],
|
||||
}),
|
||||
Command.create({
|
||||
'product_id': 'product.consu_delivery_03',
|
||||
'quantity': 1,
|
||||
'price_unit': 2000.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_10',
|
||||
'pk_tax_wh_S_1'
|
||||
])],
|
||||
}),
|
||||
]
|
||||
},
|
||||
self.company_xmlid('l10n_pk_demo_vendor_bill_2'): {
|
||||
'ref': 'INV/002',
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'l10n_pk.res_partner_islamabad',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': fields.Datetime.today() - relativedelta(days=2),
|
||||
'invoice_line_ids': [
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_8',
|
||||
'quantity': 4,
|
||||
'price_unit': 1000.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_17'
|
||||
])],
|
||||
}),
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_7',
|
||||
'quantity': 3,
|
||||
'price_unit': 2000.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_10'
|
||||
])],
|
||||
}),
|
||||
]
|
||||
},
|
||||
self.company_xmlid('l10n_pk_demo_vendor_bill_3'): {
|
||||
'ref': 'INV/003',
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': 'l10n_pk.res_partner_islamabad',
|
||||
'invoice_user_id': 'base.user_demo',
|
||||
'invoice_payment_term_id': 'account.account_payment_term_end_following_month',
|
||||
'invoice_date': fields.Datetime.today() - relativedelta(days=3),
|
||||
'invoice_line_ids': [
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_9',
|
||||
'quantity': 1,
|
||||
'price_unit': 1000.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_17'
|
||||
])],
|
||||
}),
|
||||
Command.create({
|
||||
'product_id': 'product.product_product_10',
|
||||
'quantity': 1,
|
||||
'price_unit': 2000.0,
|
||||
'tax_ids': [Command.set([
|
||||
'pk_sales_tax_services_10',
|
||||
'pk_tax_wh_S_5'
|
||||
])],
|
||||
}),
|
||||
]
|
||||
},
|
||||
})
|
||||
return moves
|
||||
|
||||
def _post_load_demo_data(self, company=False):
|
||||
company = company or self.env.company
|
||||
if company.account_fiscal_country_id.code == "PK":
|
||||
invoices = (
|
||||
self.ref('l10n_pk_demo_invoice_1')
|
||||
+ self.ref('l10n_pk_demo_invoice_2')
|
||||
+ self.ref('l10n_pk_demo_invoice_3')
|
||||
+ self.ref('l10n_pk_demo_reconcile_1')
|
||||
+ self.ref('l10n_pk_demo_reconcile_2')
|
||||
+ self.ref('l10n_pk_demo_vendor_bill_1')
|
||||
+ self.ref('l10n_pk_demo_vendor_bill_2')
|
||||
+ self.ref('l10n_pk_demo_vendor_bill_3')
|
||||
)
|
||||
for move in invoices:
|
||||
move.action_post()
|
||||
return super()._post_load_demo_data(company)
|
||||
|
|
@ -1,34 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="partner_demo_company_pk" model="res.partner">
|
||||
<record id="base.partner_demo_company_pk" model="res.partner" forcecreate="1">
|
||||
<field name="name">PK Company</field>
|
||||
<field name="vat"></field>
|
||||
<field name="vat"/>
|
||||
<field name="street">38st Floor, Saddar, Sindh</field>
|
||||
<field name="street2">Unit 07 - 10, 38/F Yat Chau International Plaza</field>
|
||||
<field name="city">Karachi</field>
|
||||
<field name="state_id" ref="base.state_pk_sd"/>
|
||||
<field name="country_id" ref="base.pk"/>
|
||||
<field name="zip"></field>
|
||||
<field name="zip"/>
|
||||
<field name="phone">+92215684711</field>
|
||||
<field name="email">hih3l5npkwl@temporary-mail.net</field>
|
||||
<field name="website">www.pkexample.com</field>
|
||||
<field name="is_company" eval="True"/>
|
||||
</record>
|
||||
|
||||
<record id="demo_company_pk" model="res.company">
|
||||
<record id="base.demo_company_pk" model="res.company" forcecreate="1">
|
||||
<field name="name">PK Company</field>
|
||||
<field name="partner_id" ref="partner_demo_company_pk"/>
|
||||
<field name="partner_id" ref="base.partner_demo_company_pk"/>
|
||||
</record>
|
||||
|
||||
<function model="res.company" name="_onchange_country_id">
|
||||
<value eval="[ref('demo_company_pk')]"/>
|
||||
<value eval="[ref('base.demo_company_pk')]"/>
|
||||
</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_pk.demo_company_pk'))]}"/>
|
||||
<value eval="{'company_ids': [(4, ref('base.demo_company_pk'))]}"/>
|
||||
</function>
|
||||
|
||||
<function model="account.chart.template" name="try_loading">
|
||||
<value eval="[ref('l10n_pk.l10n_pk_chart_template')]"/>
|
||||
<value model="res.company" eval="obj().env.ref('l10n_pk.demo_company_pk')"/>
|
||||
<value eval="[]"/>
|
||||
<value>pk</value>
|
||||
<value model="res.company" eval="obj().env.ref('base.demo_company_pk')"/>
|
||||
<value name="install_demo" eval="True"/>
|
||||
</function>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="res_partner_punjab" model="res.partner">
|
||||
<field name="name">Punjab Customer</field>
|
||||
<field name="is_company">1</field>
|
||||
<field name="street">38/A Gulberg Main Boulevard</field>
|
||||
<field name="city">Lahore</field>
|
||||
<field name="state_id" ref='base.state_pk_pb'/>
|
||||
<field name="zip">54000</field>
|
||||
<field name="country_id" ref="base.pk"/>
|
||||
<field name="email">support@punjabpartner.odoo.com</field>
|
||||
<field name="phone">+92 9876543210</field>
|
||||
<field name="website">http://punjabpartner.odoo.com</field>
|
||||
<field name="vat">4174942</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_islamabad" model="res.partner">
|
||||
<field name="name">Islamabad Vendor</field>
|
||||
<field name="is_company">0</field>
|
||||
<field name="street">Office 12, 3rd Floor, Giga Mall</field>
|
||||
<field name="city">Taxila</field>
|
||||
<field name="state_id" ref='base.state_pk_is'/>
|
||||
<field name="zip">40000</field>
|
||||
<field name="country_id" ref="base.pk"/>
|
||||
<field name="email">support@islamabadvendor.odoo.com</field>
|
||||
<field name="phone">+92 1234567890</field>
|
||||
<field name="website">http://islamabadvendor.odoo.com</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue