Commit 32052b99 by aa.gusti

village

1 parent d1b50cc4
......@@ -4,65 +4,60 @@ 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Odoo supports multiple currencies, multiple users with different access rights, multiple companies with real time
consolidation and unlimited analytic plans.
......@@ -23,8 +23,8 @@ Menydiakan module untuk followup Wajib Pajak/Retribusi.
'views/view_config.xml',
'views/objek_pajak.xml',
'views/district.xml',
# 'views/sub_district.xml',
# 'views/village.xml',
'views/sub_district.xml',
'views/village.xml',
'views/sudut_pandang.xml',
'views/pdl_kab_menus.xml',
'security/account_security.xml',
......
......@@ -30,7 +30,8 @@ class PortalAccount(CustomerPortal):
return self._get_page_view_values(invoice, access_token, values, 'my_pad_history', False, **kwargs)
def _get_pad_domain(self):
return [('move_type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]
return [
('move_type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]
@http.route(['/my/pad', '/my/pad/page/<int:page>'], type='http', auth="user", website=True)
def portal_my_pad(self, page=1, date_begin=None, date_end=None, sortby=None, filterby=None, **kw):
......@@ -86,7 +87,7 @@ class PortalAccount(CustomerPortal):
'searchbar_sortings': searchbar_sortings,
'sortby': sortby,
'searchbar_filters': OrderedDict(sorted(searchbar_filters.items())),
'filterby':filterby,
'filterby': filterby,
})
return request.render("account.portal_my_pad", values)
......@@ -98,13 +99,15 @@ class PortalAccount(CustomerPortal):
return request.redirect('/my')
if report_type in ('html', 'pdf', 'text'):
return self._show_report(model=invoice_sudo, report_type=report_type, report_ref='account.account_pad', download=download)
return self._show_report(model=invoice_sudo, report_type=report_type, report_ref='account.account_pad',
download=download)
values = self._invoice_get_page_view_values(invoice_sudo, access_token, **kw)
acquirers = values.get('acquirers')
if acquirers:
country_id = values.get('partner_id') and values.get('partner_id')[0].country_id.id
values['acq_extra_fees'] = acquirers.get_acquirer_extra_fees(invoice_sudo.amount_residual, invoice_sudo.currency_id, country_id)
values['acq_extra_fees'] = acquirers.get_acquirer_extra_fees(invoice_sudo.amount_residual,
invoice_sudo.currency_id, country_id)
return request.render("account.portal_invoice_page", values)
......@@ -119,11 +122,16 @@ class PortalAccount(CustomerPortal):
if not partner.can_edit_vat():
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 pad have been issued for your account. Please contact us directly for this operation.'))
error_message.append(
_('Changing VAT number is not allowed once pad 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 pad have been issued for your account. Please contact us directly for this operation.'))
error_message.append(
_('Changing your name is not allowed once pad have been issued for your account. Please contact '
'us directly for this operation.'))
if 'company_name' in data and (data['company_name'] or False) != (partner.company_name or False):
error['company_name'] = 'error'
error_message.append(_('Changing your company name is not allowed once pad have been issued for your account. Please contact us directly for this operation.'))
error_message.append(
_('Changing your company name is not allowed once pad have been issued for your account. Please contact us directly for this operation.'))
return error, error_message
......@@ -8,11 +8,19 @@ class District(models.Model):
_name = 'res.district'
_description = 'Kota/Kabupaten'
state_id = fields.Many2one('res.country.state', string='Provinsi', required=True)
typ = fields.Selection([
('kab', 'Kabupaten'),
('kabtif', 'Kabupaten Administratif'),
('kota', 'Kota'),
('kotif', 'Kota Administratif')],
string='Jenis')
code = fields.Char(string="Kode Kota/Kabupaten")
name = fields.Char(string="Nama Kota/Kabupaten", index=True)
display_code = fields.Char(index=True)
# display_code = fields.Char(compute='_compute_display_code', store=True, index=True)
# sub_district_ids = fields.One2many('res.district.sub', 'district_id', string='Kecamatan')
# display_code = fields.Char(compute='_compute_display_code') #, store=True, index=True)
display_name = fields.Char(index=True)
# display_name = fields.Char(compute='_compute_display_name') #, store=True, index=True)
sub_district_ids = fields.One2many('res.district.sub', 'district_id', string='Kecamatan')
# address_view_id = fields.Many2one(
# comodel_name='ir.ui.view', string="Input View",
# domain=[('model', '=', 'res.partner'), ('type', '=', 'form')],
......@@ -25,49 +33,55 @@ class District(models.Model):
# compute="_compute_image_url", string="Flag",
# help="Url of static flag image",
# )
_sql_constraints = [
('code_uniq', 'unique (state_id,code)', 'Kode Kabupaten/Kota Harus Unik !'),
('name_uniq', 'unique (state_id,typ,name)', 'Nama Kabupaten/Kota Harus Unik !'),
]
@api.model
def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
args = args or []
if self.env.context.get('state_id'):
args = expression.AND([args, [('state_id', '=', self.env.context.get('state_id'))]])
if operator == 'ilike' and not (name or '').strip():
first_domain = []
domain = []
else:
first_domain = [('code', '=ilike', name)]
domain = [('name', operator, name)]
first_district_ids = self._search(expression.AND([first_domain, args]), limit=limit,
access_rights_uid=name_get_uid) if first_domain else []
return list(first_district_ids) + [
state_id
for state_id in self._search(expression.AND([domain, args]),
limit=limit, access_rights_uid=name_get_uid)
if state_id not in first_district_ids
]
def name_get(self):
result = []
for record in self:
result.append((record.id, "{} {} ({})".format(record.typ, record.name, record.state_id.code)))
return result
def code_get(self):
result = []
for record in self:
result.append((record.id, "{}.{}".format(record.state_id.code, record.code)))
return result
@api.depends('name')
def _compute_display_name(self):
pass
# self.display_name = "{} {}".format(self.typ, self.name)
@api.depends('code')
def _compute_display_code(self):
pass
# self.display_code = "{}.{}".format(self.state_id.code, self.code)
# @api.model
# def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
# args = args or []
# if self.env.context.get('state_id'):
# args = expression.AND([args, [('state_id', '=', self.env.context.get('state_id'))]])
#
# if operator == 'ilike' and not (name or '').strip():
# first_domain = []
# domain = []
# else:
# first_domain = [('code', '=ilike', name)]
# domain = [('name', operator, name)]
#
# first_district_ids = self._search(expression.AND([first_domain, args]), limit=limit,
# access_rights_uid=name_get_uid) if first_domain else []
# return list(first_district_ids) + [
# state_id
# for state_id in self._search(expression.AND([domain, args]),
# limit=limit, access_rights_uid=name_get_uid)
# if state_id not in first_district_ids
# ]
#
# def name_get(self):
# result = []
# for record in self:
# result.append((record.id, "{} ({})".format(record.name, record.state_id.code)))
# return result
#
# def code_get(self):
# result = []
# for record in self:
# result.append((record.id, "{} ({})".format(record.state_id.code, record.code)))
# return result
#
# @api.depends('code')
# def _compute_display_code(self):
# return self.code_get()
# # result = []
# # for record in self:
# # result.append((record.id, "{} ({})".format(record.state_id.code, record.code)))
# # return result
#
# @api.model_create_multi
# def create(self, vals_list):
# for vals in vals_list:
......@@ -112,11 +126,15 @@ class Village(models.Model):
_name = 'res.district.village'
_description = "Desa/Keurahan"
sub_district_id = fields.Many2one('res.district.sub', string='Kecamatan', required=True)
typ = fields.Selection([
('desa', 'Desa'),
('kelurahan', 'Kelurahan')],
string='Jenis')
code = fields.Char(string="Kode Desa/Kelurahan")
name = fields.Char(string="Nama Desa/Kelurahan", index=True)
display_code = fields.Char(index=True) # compute='_compute_display_code', store=True,
display_name = fields.Char(index=True) # compute='_compute_display_name', store=True,
_sql_constraints = [
('village_code_uniq', 'unique (sub_district_id,code)', 'Kode Kelurahan/Desa Harus Unik !'),
('village_name_uniq', 'unique (sub_district_id,name)', 'Nama Kelurahan/Desa Harus Unik !'),
('village_name_uniq', 'unique (sub_district_id,typ,name)', 'Nama Kelurahan/Desa Harus Unik !'),
]
import time
import logging
from psycopg2 import sql, DatabaseError
from odoo import api, fields, models, _
from odoo import fields, models
class PdlSudutPandang(models.Model):
_name = 'pdl.sudut.pandang'
_description = 'Sudut Pandang'
code = fields.Char(String='Kode', width=32)
name = fields.Char(index=True, String='Nama', width=64)
value = fields.Float(String='Nilai')
code = fields.Char(string='Kode', size=32)
name = fields.Char(index=True, string='Nama', size=64)
value = fields.Float(string='Nilai')
_sql_constraints = [
('code_uniq', 'unique (code)', 'Kode harus unik')
......
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<record model="ir.module.category" id="pdl_kab">
<field name="name">PDL</field>
<field name="description">PDL</field>
......
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_sudut_pandang_config","access.sudut.pandang.config","model_pdl_sudut_pandang","base.group_system",1,1,1,1
"access_sudut_pandang_config_pdl_admin","access.sudut.pandang.config.pdl.admin","model_pdl_sudut_pandang","group_pdl_konfigurasi",1,1,1,1
"access_sudut_pandang_admin","access.sudut.pandang.admin","model_pdl_sudut_pandang","base.group_system",1,1,1,1
"access_sudut_pandang_admin_pdl","access.sudut.pandang.admin.pdl","model_pdl_sudut_pandang","group_pdl_konfigurasi",1,1,1,1
"access_district_admin","access.district.admin","model_res_district","base.group_system",1,1,1,1
"access_district_admin_pdl","access.district.admin.pdl","model_res_district","group_pdl_konfigurasi",1,1,1,1
"access_district_sub_admin","access.district.sub.admin","model_res_district_sub","base.group_system",1,1,1,1
"access_district_sub_admin_pdl","access.district.sub.admin.pdl","model_res_district_sub","group_pdl_konfigurasi",1,1,1,1
"access_village_admin","access.village.admin","model_res_district_village","base.group_system",1,1,1,1
"access_village_admin_pdl","access.village.admin.pdl","model_res_district_village","group_pdl_konfigurasi",1,1,1,1
.openerp div.oe_account_help {
background : #D6EBFF;
background: #D6EBFF;
width: 100%;
padding: 10px;
border: 3px solid #C1D4E6;
}
.openerp p.oe_account_font_help{
.openerp p.oe_account_font_help {
text-align: left;
font-weight: bold;
margin: 0px;
font-size: 14px;
}
.openerp p.oe_account_font_content{
.openerp p.oe_account_font_content {
margin-left: 30px;
font-size: 14px;
}
.openerp p.oe_account_font_title{
.openerp p.oe_account_font_title {
margin-top: 7px;
font-size: 15px;
font-style: italic;
......
.openerp .oe_force_bold {
font-weight: bold !important;
}
.openerp label.oe_open_balance{
.openerp label.oe_open_balance {
margin-right: -18px;
}
.openerp label.oe_subtotal_footer_separator{
float:right;
.openerp label.oe_subtotal_footer_separator {
float: right;
width: 184px !important;
}
.openerp label.oe_mini_subtotal_footer_separator{
.openerp label.oe_mini_subtotal_footer_separator {
margin-right: -14px;
}
.openerp .oe_account_total, .openerp .oe_pos_total {
margin-left: -2px;
}
.openerp label.oe_real_closing_balance{
.openerp label.oe_real_closing_balance {
min-width: 184px !important;
}
.openerp label.oe_difference, .openerp label.oe_pos_difference {
margin-right: -10px;
padding-left: 10px !important;
min-width: 195px !important;
}
.openerp .oe_opening_total{
.openerp .oe_opening_total {
margin-right: 4px;
}
.o_payment_label{
.o_payment_label {
padding-right: 20px;
}
\ No newline at end of file
odoo.define('account.payment', function (require) {
"use strict";
"use strict";
var AbstractField = require('web.AbstractField');
var core = require('web.core');
var field_registry = require('web.field_registry');
var field_utils = require('web.field_utils');
var AbstractField = require('web.AbstractField');
var core = require('web.core');
var field_registry = require('web.field_registry');
var field_utils = require('web.field_utils');
var QWeb = core.qweb;
var _t = core._t;
var QWeb = core.qweb;
var _t = core._t;
var ShowPaymentLineWidget = AbstractField.extend({
var ShowPaymentLineWidget = AbstractField.extend({
events: _.extend({
'click .outstanding_credit_assign': '_onOutstandingCreditAssign',
}, AbstractField.prototype.events),
......@@ -23,7 +23,7 @@ var ShowPaymentLineWidget = AbstractField.extend({
* @override
* @returns {boolean}
*/
isSet: function() {
isSet: function () {
return true;
},
......@@ -35,17 +35,17 @@ var ShowPaymentLineWidget = AbstractField.extend({
* @private
* @override
*/
_render: function() {
_render: function () {
var self = this;
var info = JSON.parse(this.value);
if (!info) {
this.$el.html('');
return;
}
_.each(info.content, function (k, v){
_.each(info.content, function (k, v) {
k.index = v;
k.amount = field_utils.format.float(k.amount, {digits: k.digits});
if (k.date){
if (k.date) {
k.date = field_utils.format.date(field_utils.parse.date(k.date, {}, {isUTC: true}));
}
});
......@@ -54,7 +54,7 @@ var ShowPaymentLineWidget = AbstractField.extend({
outstanding: info.outstanding,
title: info.title
}));
_.each(this.$('.js_payment_info'), function (k, v){
_.each(this.$('.js_payment_info'), function (k, v) {
var isRTL = _t.database.parameters.direction === "rtl";
var content = info.content[v];
var options = {
......@@ -69,7 +69,7 @@ var ShowPaymentLineWidget = AbstractField.extend({
placement: isRTL ? 'bottom' : 'left',
title: 'Payment Information',
trigger: 'focus',
delay: { "show": 0, "hide": 100 },
delay: {"show": 0, "hide": 100},
container: $(k).parent(), // FIXME Ugly, should use the default body container but system & tests to adapt to properly destroy the popover
};
$(k).popover(options);
......@@ -90,10 +90,10 @@ var ShowPaymentLineWidget = AbstractField.extend({
var moveId = parseInt($(event.target).attr('move-id'));
var res_model;
var id;
if (paymentId !== undefined && !isNaN(paymentId)){
if (paymentId !== undefined && !isNaN(paymentId)) {
res_model = "account.payment";
id = paymentId;
} else if (moveId !== undefined && !isNaN(moveId)){
} else if (moveId !== undefined && !isNaN(moveId)) {
res_model = "account.move";
id = moveId;
}
......@@ -135,7 +135,7 @@ var ShowPaymentLineWidget = AbstractField.extend({
var self = this;
var moveId = parseInt($(event.target).attr('move-id'));
var partialId = parseInt($(event.target).attr('partial-id'));
if (partialId !== undefined && !isNaN(partialId)){
if (partialId !== undefined && !isNaN(partialId)) {
this._rpc({
model: 'account.move',
method: 'js_remove_outstanding_partial',
......@@ -145,12 +145,12 @@ var ShowPaymentLineWidget = AbstractField.extend({
});
}
},
});
});
field_registry.add('payment', ShowPaymentLineWidget);
field_registry.add('payment', ShowPaymentLineWidget);
return {
return {
ShowPaymentLineWidget: ShowPaymentLineWidget
};
};
});
odoo.define('account.AccountPortalSidebar', function (require) {
'use strict';
'use strict';
const dom = require('web.dom');
var publicWidget = require('web.public.widget');
var PortalSidebar = require('portal.PortalSidebar');
var utils = require('web.utils');
const dom = require('web.dom');
var publicWidget = require('web.public.widget');
var PortalSidebar = require('portal.PortalSidebar');
var utils = require('web.utils');
publicWidget.registry.AccountPortalSidebar = PortalSidebar.extend({
publicWidget.registry.AccountPortalSidebar = PortalSidebar.extend({
selector: '.o_portal_invoice_sidebar',
events: {
'click .o_portal_invoice_print': '_onPrintInvoice',
......@@ -69,5 +69,5 @@ publicWidget.registry.AccountPortalSidebar = PortalSidebar.extend({
var href = $(ev.currentTarget).attr('href');
this._printIframeContent(href);
},
});
});
});
odoo.define('account.ShowResequenceRenderer', function (require) {
"use strict";
"use strict";
const { Component } = owl;
const { useState } = owl.hooks;
const AbstractFieldOwl = require('web.AbstractFieldOwl');
const field_registry = require('web.field_registry_owl');
const {Component} = owl;
const {useState} = owl.hooks;
const AbstractFieldOwl = require('web.AbstractFieldOwl');
const field_registry = require('web.field_registry_owl');
class ChangeLine extends Component { }
ChangeLine.template = 'account.ResequenceChangeLine';
ChangeLine.props = ["changeLine", 'ordering'];
class ChangeLine extends Component {
}
ChangeLine.template = 'account.ResequenceChangeLine';
ChangeLine.props = ["changeLine", 'ordering'];
class ShowResequenceRenderer extends AbstractFieldOwl {
class ShowResequenceRenderer extends AbstractFieldOwl {
constructor(...args) {
super(...args);
this.data = this.value ? JSON.parse(this.value) : {
......@@ -19,14 +21,16 @@ class ShowResequenceRenderer extends AbstractFieldOwl {
ordering: 'date',
};
}
async willUpdateProps(nextProps) {
await super.willUpdateProps(nextProps);
Object.assign(this.data, JSON.parse(this.value));
}
}
ShowResequenceRenderer.template = 'account.ResequenceRenderer';
ShowResequenceRenderer.components = { ChangeLine }
}
ShowResequenceRenderer.template = 'account.ResequenceRenderer';
ShowResequenceRenderer.components = {ChangeLine}
field_registry.add('account_resequence_widget', ShowResequenceRenderer);
return ShowResequenceRenderer;
field_registry.add('account_resequence_widget', ShowResequenceRenderer);
return ShowResequenceRenderer;
});
odoo.define('account.hierarchy.selection', function (require) {
"use strict";
"use strict";
var core = require('web.core');
var relational_fields = require('web.relational_fields');
......@@ -23,30 +23,48 @@ odoo.define('account.hierarchy.selection', function (require) {
domain: [],
fields: ['id', 'internal_group', 'display_name'],
},
}).then(function(arg) {
}).then(function (arg) {
self.values = _.map(arg, v => [v['id'], v['display_name']])
self.hierarchy_groups = [
{
'name': _t('Balance Sheet'),
'children': [
{'name': _t('Assets'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'asset'), v => v['id'])},
{'name': _t('Liabilities'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'liability'), v => v['id'])},
{'name': _t('Equity'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'equity'), v => v['id'])},
{
'name': _t('Assets'),
'ids': _.map(_.filter(arg, v => v['internal_group'] == 'asset'), v => v['id'])
},
{
'name': _t('Liabilities'),
'ids': _.map(_.filter(arg, v => v['internal_group'] == 'liability'), v => v['id'])
},
{
'name': _t('Equity'),
'ids': _.map(_.filter(arg, v => v['internal_group'] == 'equity'), v => v['id'])
},
],
},
{
'name': _t('Profit & Loss'),
'children': [
{'name': _t('Income'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'income'), v => v['id'])},
{'name': _t('Expense'), 'ids': _.map(_.filter(arg, v => v['internal_group'] == 'expense'), v => v['id'])},
{
'name': _t('Income'),
'ids': _.map(_.filter(arg, v => v['internal_group'] == 'income'), v => v['id'])
},
{
'name': _t('Expense'),
'ids': _.map(_.filter(arg, v => v['internal_group'] == 'expense'), v => v['id'])
},
],
},
{'name': _t('Other'), 'ids': _.map(_.filter(arg, v => !['asset', 'liability', 'equity', 'income', 'expense'].includes(v['internal_group'])), v => v['id'])},
{
'name': _t('Other'),
'ids': _.map(_.filter(arg, v => !['asset', 'liability', 'equity', 'income', 'expense'].includes(v['internal_group'])), v => v['id'])
},
]
});
}
Promise.resolve(prom).then(function() {
Promise.resolve(prom).then(function () {
self.$el.empty();
self._addHierarchy(self.$el, self.hierarchy_groups, 0);
var value = self.value;
......@@ -56,13 +74,13 @@ odoo.define('account.hierarchy.selection', function (require) {
self.$el.val(JSON.stringify(value));
});
},
_addHierarchy: function(el, group, level) {
_addHierarchy: function (el, group, level) {
var self = this;
_.each(group, function(item) {
_.each(group, function (item) {
var optgroup = $('<optgroup/>').attr(({
'label': $('<div/>').html('&nbsp;'.repeat(6 * level) + item['name']).text(),
}))
_.each(item['ids'], function(id) {
_.each(item['ids'], function (id) {
var value = _.find(self.values, v => v[0] == id)
optgroup.append($('<option/>', {
value: JSON.stringify(value[0]),
......
odoo.define('account.bank_statement', function(require) {
odoo.define('account.bank_statement', function (require) {
"use strict";
var KanbanController = require("web.KanbanController");
......
odoo.define('account.upload.bill.mixin', function (require) {
"use strict";
"use strict";
var core = require('web.core');
var _t = core._t;
......@@ -29,7 +29,7 @@ odoo.define('account.upload.bill.mixin', function (require) {
var self = this;
var attachments = Array.prototype.slice.call(arguments, 1);
// Get id from result
var attachent_ids = attachments.reduce(function(filtered, record) {
var attachent_ids = attachments.reduce(function (filtered, record) {
if (record.id) {
filtered.push(record.id);
}
......@@ -40,7 +40,7 @@ odoo.define('account.upload.bill.mixin', function (require) {
method: 'create_invoice_from_attachment',
args: ["", attachent_ids],
context: this.initialState.context,
}).then(function(result) {
}).then(function (result) {
self.do_action(result);
});
},
......@@ -62,7 +62,7 @@ odoo.define('account.upload.bill.mixin', function (require) {
odoo.define('account.bills.tree', function (require) {
"use strict";
"use strict";
var core = require('web.core');
var ListController = require('web.ListController');
var ListView = require('web.ListView');
......@@ -87,7 +87,7 @@ odoo.define('account.bills.tree', function (require) {
});
odoo.define('account.dashboard.kanban', function (require) {
"use strict";
"use strict";
var core = require('web.core');
var KanbanController = require('web.KanbanController');
var KanbanView = require('web.KanbanView');
......
odoo.define('account.ShowGroupedList', function (require) {
"use strict";
"use strict";
const { Component } = owl;
const { useState } = owl.hooks;
const AbstractFieldOwl = require('web.AbstractFieldOwl');
const field_registry = require('web.field_registry_owl');
const {Component} = owl;
const {useState} = owl.hooks;
const AbstractFieldOwl = require('web.AbstractFieldOwl');
const field_registry = require('web.field_registry_owl');
class ListItem extends Component { }
ListItem.template = 'account.GroupedItemTemplate';
ListItem.props = ["item_vals", "options"];
class ListItem extends Component {
}
ListItem.template = 'account.GroupedItemTemplate';
ListItem.props = ["item_vals", "options"];
class ListGroup extends Component {
}
class ListGroup extends Component { }
ListGroup.template = 'account.GroupedItemsTemplate';
ListGroup.components = { ListItem }
ListGroup.props = ["group_vals", "options"];
ListGroup.template = 'account.GroupedItemsTemplate';
ListGroup.components = {ListItem}
ListGroup.props = ["group_vals", "options"];
class ShowGroupedList extends AbstractFieldOwl {
class ShowGroupedList extends AbstractFieldOwl {
constructor(...args) {
super(...args);
this.data = this.value ? JSON.parse(this.value) : {
......@@ -27,14 +31,16 @@ class ShowGroupedList extends AbstractFieldOwl {
},
};
}
async willUpdateProps(nextProps) {
await super.willUpdateProps(nextProps);
Object.assign(this.data, JSON.parse(this.value));
}
}
ShowGroupedList.template = 'account.GroupedListTemplate';
ShowGroupedList.components = { ListGroup }
}
ShowGroupedList.template = 'account.GroupedListTemplate';
ShowGroupedList.components = {ListGroup}
field_registry.add('grouped_view_widget', ShowGroupedList);
return ShowGroupedList;
field_registry.add('grouped_view_widget', ShowGroupedList);
return ShowGroupedList;
});
odoo.define('account.activity', function (require) {
"use strict";
"use strict";
var AbstractField = require('web.AbstractField');
var core = require('web.core');
var field_registry = require('web.field_registry');
var AbstractField = require('web.AbstractField');
var core = require('web.core');
var field_registry = require('web.field_registry');
var QWeb = core.qweb;
var _t = core._t;
var QWeb = core.qweb;
var _t = core._t;
var VatActivity = AbstractField.extend({
var VatActivity = AbstractField.extend({
className: 'o_journal_activity_kanban',
events: {
'click .see_all_activities': '_onOpenAll',
......@@ -36,7 +36,7 @@ var VatActivity = AbstractField.extend({
this.$el.html(QWeb.render('accountJournalDashboardActivity', info));
},
_onOpenActivity: function(e) {
_onOpenActivity: function (e) {
e.preventDefault();
var self = this;
self.do_action({
......@@ -49,7 +49,7 @@ var VatActivity = AbstractField.extend({
});
},
_onOpenAll: function(e) {
_onOpenAll: function (e) {
e.preventDefault();
var self = this;
self.do_action({
......@@ -61,9 +61,9 @@ var VatActivity = AbstractField.extend({
domain: [['journal_id', '=', self.res_id], ['activity_ids', '!=', false]],
});
}
})
})
field_registry.add('kanban_vat_activity', VatActivity);
field_registry.add('kanban_vat_activity', VatActivity);
return VatActivity;
return VatActivity;
});
odoo.define('account.section_and_note_backend', function (require) {
// The goal of this file is to contain JS hacks related to allowing
// section and note on sale order and invoice.
// [UPDATED] now also allows configuring products on sale order.
"use strict";
var FieldChar = require('web.basic_fields').FieldChar;
var FieldOne2Many = require('web.relational_fields').FieldOne2Many;
var fieldRegistry = require('web.field_registry');
var ListFieldText = require('web.basic_fields').ListFieldText;
var ListRenderer = require('web.ListRenderer');
"use strict";
var FieldChar = require('web.basic_fields').FieldChar;
var FieldOne2Many = require('web.relational_fields').FieldOne2Many;
var fieldRegistry = require('web.field_registry');
var ListFieldText = require('web.basic_fields').ListFieldText;
var ListRenderer = require('web.ListRenderer');
var SectionAndNoteListRenderer = ListRenderer.extend({
var SectionAndNoteListRenderer = ListRenderer.extend({
/**
* We want section and note to take the whole line (except handle and trash)
* to look better and to hide the unnecessary fields.
......@@ -71,12 +70,12 @@ var SectionAndNoteListRenderer = ListRenderer.extend({
self.$('.o_list_table').addClass('o_section_and_note_list_view');
});
}
});
});
// We create a custom widget because this is the cleanest way to do it:
// to be sure this custom code will only impact selected fields having the widget
// and not applied to any other existing ListRenderer.
var SectionAndNoteFieldOne2Many = FieldOne2Many.extend({
var SectionAndNoteFieldOne2Many = FieldOne2Many.extend({
/**
* We want to use our custom renderer for the list.
*
......@@ -88,19 +87,19 @@ var SectionAndNoteFieldOne2Many = FieldOne2Many.extend({
}
return this._super.apply(this, arguments);
},
});
});
// This is a merge between a FieldText and a FieldChar.
// We want a FieldChar for section,
// and a FieldText for the rest (product and note).
var SectionAndNoteFieldText = function (parent, name, record, options) {
var SectionAndNoteFieldText = function (parent, name, record, options) {
var isSection = record.data.display_type === 'line_section';
var Constructor = isSection ? FieldChar : ListFieldText;
return new Constructor(parent, name, record, options);
};
};
fieldRegistry.add('section_and_note_one2many', SectionAndNoteFieldOne2Many);
fieldRegistry.add('section_and_note_text', SectionAndNoteFieldText);
fieldRegistry.add('section_and_note_one2many', SectionAndNoteFieldOne2Many);
fieldRegistry.add('section_and_note_text', SectionAndNoteFieldText);
return SectionAndNoteListRenderer;
return SectionAndNoteListRenderer;
});
......@@ -32,7 +32,7 @@ odoo.define('account.tax_group', function (require) {
const self = this;
// Search for the first tax line with the same tax group and modify its value
function applyChange(line_id){
function applyChange(line_id) {
let debitAmount = 0;
let creditAmount = 0;
let amount_currency = 0;
......@@ -63,14 +63,23 @@ odoo.define('account.tax_group', function (require) {
// Trigger ORM
self.trigger_up('field_changed', {
dataPointID: self.record.id,
changes: { line_ids: { operation: "UPDATE", id: line_id.id, data: { amount_currency: amount_currency, debit: debitAmount, credit: creditAmount } } }, // account.move change
initialEvent: { dataPointID: line_id.id, changes: { amount_currency: amount_currency, debit: debitAmount, credit: creditAmount }, }, // account.move.line change
changes: {
line_ids: {
operation: "UPDATE",
id: line_id.id,
data: {amount_currency: amount_currency, debit: debitAmount, credit: creditAmount}
}
}, // account.move change
initialEvent: {
dataPointID: line_id.id,
changes: {amount_currency: amount_currency, debit: debitAmount, credit: creditAmount},
}, // account.move.line change
});
}
let line_id = self.record.data.line_ids.data.find(elem => elem.data.tax_group_id && elem.data.tax_group_id.data.id === taxGroupId);
if (line_id){
if (line_id) {
applyChange(line_id);
} else {
const {limit, id, count} = self.record.data.line_ids;
......@@ -147,7 +156,7 @@ odoo.define('account.tax_group', function (require) {
return this._render();
}
var taxGroupId = $input.parents('.oe_tax_group_editable').data('taxGroupId');
this._changeTaxValueByTaxGroup(taxGroupId, oldValue-newValue);
this._changeTaxValueByTaxGroup(taxGroupId, oldValue - newValue);
},
/**
......
odoo.define('account.tour', function(require) {
"use strict";
odoo.define('account.tour', function (require) {
"use strict";
var core = require('web.core');
var tour = require('web_tour.tour');
var core = require('web.core');
var tour = require('web_tour.tour');
var _t = core._t;
var _t = core._t;
tour.register('account_tour', {
tour.register('account_tour', {
url: "/web",
sequence: 60,
}, [
}, [
...tour.stepUtils.goToAppSteps('account.menu_finance', _t('Send invoices to your customers in no time with the <b>Invoicing app</b>.')),
{
trigger: "a.o_onboarding_step_action[data-method=action_open_base_onboarding_company]",
......@@ -88,6 +88,6 @@ tour.register('account_tour', {
content: _t("Let's send the invoice."),
position: "top"
}
]);
]);
});
.o_journal_activity_kanban {
display: block;
.align_activity_center {
width: 100%;
align-items: center;
......
......@@ -24,6 +24,7 @@
.fa-gift {
color: #eeeeee;
&:hover {
color: #555555;
}
......
......@@ -15,15 +15,18 @@
border-top: 1px solid;
border-color: $o-brand-lightsecondary;
}
.o_dashboard_star {
font-size: 12px;
&.fa-star-o {
color: $o-main-color-muted;
&:hover {
color: gold;
}
}
&.fa-star {
color: gold;
}
......
......@@ -3,6 +3,7 @@
font-size: 1.08333333rem;
height: 14px;
background-color: $o-enterprise-color;
span {
display: contents;
}
......@@ -15,10 +16,12 @@
position: relative;
width: 150px;
margin: 0.5rem !important;
.searchIcon {
position: absolute;
right: 10px;
}
.o_filter_input {
border: none;
border-bottom: 1px black solid;
......@@ -47,16 +50,20 @@
border-right: 1px solid #333;
padding-right: 5px;
}
.edit_amount {
margin-left: 20px;
color: #bbb;
}
.cell:hover .edit_amount {
color: #00A09D;
}
.strike_amount {
text-decoration: line-through;
}
tbody tr:hover .cell_account_code::before {
content: "\f068";
font-family: FontAwesome;
......@@ -71,27 +78,35 @@
.o_multi_currency {
margin-right: 5px;
&.o_multi_currency_color_0 {
color: #dd6666;
}
&.o_multi_currency_color_1 {
color: #aaaaaa;
}
&.o_multi_currency_color_2 {
color: #66dd66;
}
&.o_multi_currency_color_3 {
color: #6666dd;
}
&.o_multi_currency_color_4 {
color: #dddd66;
}
&.o_multi_currency_color_5 {
color: #dd66dd;
}
&.o_multi_currency_color_6 {
color: #66dddd;
}
&.o_multi_currency_color_7 {
color: #aaa333;
}
......@@ -99,28 +114,35 @@
.o_reconciliation_line {
margin-bottom: 30px;
table {
width: 100%;
vertical-align: top;
}
tbody tr {
cursor: pointer;
}
tr.already_reconciled {
color: $o-account-info-color;
}
tr.invalid {
text-decoration: line-through;
}
td {
padding: 1px 2px;
}
thead td {
border-top: $o-account-light-border;
padding-top: 4px;
padding-bottom: 5px;
background-color: $o-account-initial-line-background;
}
tfoot td {
color: #bbb;
}
......@@ -133,34 +155,43 @@
background: #fff;
border: 0;
text-align: center;
.fa-add-remove:before {
content: "";
}
}
tr:hover .cell_action .fa-add-remove:before {
content: "\f068";
}
.is_tax .cell_action .fa-add-remove:before {
position: relative;
top: -18px;
}
.cell_account_code {
width: 80px;
padding-left: 5px;
}
.cell_due_date {
width: 100px;
}
.cell_label {
width: auto;
}
.cell_left {
padding-right: 5px;
}
.cell_right, .cell_left {
text-align: right;
width: 120px;
}
.cell_info_popover {
text-align: right;
width: 15px;
......@@ -173,10 +204,11 @@
}
table.accounting_view {
.cell_right, .cell_left, .cell_label, .cell_due_date, .cell_account_code,.cell_info_popover {
.cell_right, .cell_left, .cell_label, .cell_due_date, .cell_account_code, .cell_info_popover {
box-shadow: 0 1px 0 #EAEAEA;
}
}
/* info popover */
.popover {
max-width: none;
......@@ -184,6 +216,7 @@
table.details {
vertical-align: top;
td:first-child {
vertical-align: top;
padding-right: 10px;
......@@ -205,10 +238,12 @@
transform: rotate(0deg);
transition: transform 300ms ease 0s;
}
.visible_toggle, &[data-mode="match"] .toggle_match, &[data-mode="create"] .toggle_create {
visibility: visible !important;
transform: rotate(90deg);
}
.toggle_create {
font-size: 10px;
}
......@@ -239,11 +274,13 @@
&:not(:focus-within) .o_web_accesskey_overlay {
display: none;
}
&:focus caption .o_buttons button {
outline: none;
box-shadow: 4px 4px 4px 0px $o-enterprise-color;
}
&:focus{
&:focus {
outline: none;
box-shadow: 0 0 0 0;
}
......@@ -259,9 +296,11 @@
.cell_action .fa-add-remove:before {
content: "";
}
tr:hover .cell_action .fa-add-remove:before {
content: "\f067";
}
.match_controls {
padding: 5px 0 5px ($o-account-action-col-width+$o-account-main-table-borders-padding);
......@@ -284,6 +323,7 @@
cursor: default;
}
}
.show_more {
display: inline-block;
margin-left: ($o-account-action-col-width+$o-account-main-table-borders-padding);
......@@ -303,22 +343,27 @@
flex-grow: 0;
}
}
.quick_add {
margin-bottom: 7px;
padding: 0 8px;
}
.o_group table.o_group_col_6 {
width: 49%;
margin: 0;
vertical-align: top;
}
.o_group table.o_group_col_6:first-child {
margin-left: 8px;
}
.btn {
padding-top: 0;
padding-bottom: 0;
}
.add_line_container {
text-align: center;
clear: both;
......@@ -339,11 +384,13 @@
width: 100%;
display: inline-block;
}
td[colspan="2"] {
border-bottom: 1px solid #333;
text-align: center;
width: 240px;
}
.do_partial_reconcile_true {
display: none;
}
......@@ -359,6 +406,7 @@
transform: rotate(180deg);
transition: transform 300ms;
}
.visible_toggle, &[data-mode="match"] .toggle_match, &[data-mode="create"] .toggle_create {
transform: rotate(270deg);
}
......
......@@ -2,24 +2,30 @@
flex: 0 0 50px;
padding: 6px;
scrollbar-width: thin;
.o_search_panel_section_header {
display: none;
}
.list-group-item span.o_search_panel_label_title {
display: contents;
}
.o_search_panel_category_value {
header {
margin-left: 0;
padding-left: 0;
}
.o_search_panel_category_value .o_toggle_fold {
width: 0.3rem;
}
}
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
background: lightgray;
}
......
// The goal of this file is to contain CSS hacks related to allowing
// section and note on sale order and invoice.
......@@ -7,11 +6,13 @@ table.o_section_and_note_list_view tr.o_data_row.o_is_line_note textarea[name="n
div.oe_kanban_card.o_is_line_note {
font-style: italic;
}
table.o_section_and_note_list_view tr.o_data_row.o_is_line_section,
div.oe_kanban_card.o_is_line_section {
font-weight: bold;
background-color: #DDDDDD;
}
table.o_section_and_note_list_view tr.o_data_row.o_is_line_section {
border-top: 1px solid #BBB;
border-bottom: 1px solid #BBB;
......
......@@ -6,12 +6,17 @@
<t t-foreach="activities" t-as="activity">
<div class="row">
<div class="col-8 o_mail_activity">
<a href="#" t-att-class="(activity.status == 'late' ? 'o_activity_color_overdue ' : ' ') + (activity.activity_category == 'tax_report' ? 'o_open_vat_report' : 'see_activity')" t-att-data-res-id="activity.res_id" t-att-data-id="activity.id" t-att-data-model="activity.res_model">
<a href="#"
t-att-class="(activity.status == 'late' ? 'o_activity_color_overdue ' : ' ') + (activity.activity_category == 'tax_report' ? 'o_open_vat_report' : 'see_activity')"
t-att-data-res-id="activity.res_id" t-att-data-id="activity.id"
t-att-data-model="activity.res_model">
<t t-esc="activity.name"/>
</a>
</div>
<div class="col-4 text-right">
<span><t t-esc="activity.date"/></span>
<span>
<t t-esc="activity.date"/>
</span>
</div>
</div>
</t>
......
......@@ -14,22 +14,29 @@
<tr>
<t t-if="outstanding">
<td>
<a title="assign to invoice" role="button" class="oe_form_field btn btn-link outstanding_credit_assign" t-att-data-id="line.id" style="margin-right: 10px;" href="#" data-toggle="tooltip">Add</a>
<a title="assign to invoice" role="button"
class="oe_form_field btn btn-link outstanding_credit_assign" t-att-data-id="line.id"
style="margin-right: 10px;" href="#" data-toggle="tooltip">Add</a>
</td>
<td style="max-width: 30em;">
<div class="oe_form_field" style="margin-right: 30px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;" t-att-title="line.date" data-toggle="tooltip"><t t-esc="line.journal_name"></t></div>
<div class="oe_form_field"
style="margin-right: 30px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;"
t-att-title="line.date" data-toggle="tooltip"><t t-esc="line.journal_name"></t></div>
</td>
</t>
<t t-if="!outstanding">
<td>
<a role="button" tabindex="0" class="js_payment_info fa fa-info-circle" t-att-index="line.index" style="margin-right:5px;" aria-label="Info" title="Payment Info" data-toggle="tooltip"></a>
<a role="button" tabindex="0" class="js_payment_info fa fa-info-circle"
t-att-index="line.index" style="margin-right:5px;" aria-label="Info" title="Payment Info"
data-toggle="tooltip"></a>
</td>
<td>
<i class="o_field_widget text-right o_payment_label">Paid on <t t-esc="line.date"></t></i>
</td>
</t>
<td style="text-align:right;">
<span class="oe_form_field oe_form_field_float oe_form_field_monetary" style="margin-left: -10px;">
<span class="oe_form_field oe_form_field_float oe_form_field_monetary"
style="margin-left: -10px;">
<t t-if="line.position === 'before'">
<t t-esc="line.currency"/>
</t>
......@@ -74,12 +81,16 @@
</tr>
<tr>
<td><strong>Payment Journal: </strong></td>
<td><t t-esc="journal_name"/><span t-if="payment_method_name"> (<t t-esc="payment_method_name"/>)</span></td>
<td><t t-esc="journal_name"/>
<span t-if="payment_method_name"> (<t t-esc="payment_method_name"/>)</span></td>
</tr>
</table>
</div>
<button class="btn btn-sm btn-primary js_unreconcile_payment float-left" t-att-partial-id="partial_id" t-att-payment-id="payment_id" t-att-move-id="move_id" style="margin-top:5px; margin-bottom:5px;" groups="account.group_account_invoice">Unreconcile</button>
<button class="btn btn-sm btn-secondary js_open_payment float-right" t-att-payment-id="account_payment_id" t-att-move-id="move_id" style="margin-top:5px; margin-bottom:5px;">View</button>
<button class="btn btn-sm btn-primary js_unreconcile_payment float-left" t-att-partial-id="partial_id"
t-att-payment-id="payment_id" t-att-move-id="move_id" style="margin-top:5px; margin-bottom:5px;"
groups="account.group_account_invoice">Unreconcile</button>
<button class="btn btn-sm btn-secondary js_open_payment float-right" t-att-payment-id="account_payment_id"
t-att-move-id="move_id" style="margin-top:5px; margin-bottom:5px;">View</button>
</t>
</templates>
......@@ -3,11 +3,13 @@
<div t-name="account.ResequenceRenderer" owl="1" class="d-block">
<table t-if="data.changeLines.length" class="table table-sm">
<thead><tr>
<thead>
<tr>
<th>Date</th>
<th>Before</th>
<th>After</th>
</tr></thead>
</tr>
</thead>
<tbody t-foreach="data.changeLines" t-as="changeLine" t-key="changeLine.id">
<ChangeLine changeLine="changeLine" ordering="data.ordering"/>
</tbody>
......@@ -18,8 +20,10 @@
<tr>
<td t-esc="props.changeLine.date"/>
<td t-esc="props.changeLine.current_name"/>
<td t-if="props.ordering == 'keep'" t-esc="props.changeLine.new_by_name" t-attf-class="{{ props.changeLine.new_by_name != props.changeLine.new_by_date ? 'animate' : ''}}"/>
<td t-else="" t-esc="props.changeLine.new_by_date" t-attf-class="{{ props.changeLine.new_by_name != props.changeLine.new_by_date ? 'animate' : ''}}"/>
<td t-if="props.ordering == 'keep'" t-esc="props.changeLine.new_by_name"
t-attf-class="{{ props.changeLine.new_by_name != props.changeLine.new_by_date ? 'animate' : ''}}"/>
<td t-else="" t-esc="props.changeLine.new_by_date"
t-attf-class="{{ props.changeLine.new_by_name != props.changeLine.new_by_date ? 'animate' : ''}}"/>
</tr>
</t>
</templates>
<?xml version="1.0" encoding="utf-8"?>
<templates>
<div t-name="account.GroupedListTemplate" owl="1" class="d-block">
<table t-if="data.groups_vals.length" class="table table-sm o_list_table table table-sm table-hover table-striped o_list_table_grouped">
<thead><tr>
<table t-if="data.groups_vals.length"
class="table table-sm o_list_table table table-sm table-hover table-striped o_list_table_grouped">
<thead>
<tr>
<t t-foreach="data.options.columns" t-as="col">
<th t-esc="col['label']" t-attf-class="{{col['class']}}"/>
</t>
</tr></thead>
</tr>
</thead>
<t t-foreach="data.groups_vals" t-as="group_vals">
<ListGroup group_vals="group_vals" options="data.options"/>
</t>
</table>
<t t-if="data.options.discarded_number">
<span><t t-esc="data.options.discarded_number"/> are not shown in the preview</span>
<span>
<t t-esc="data.options.discarded_number"/>
are not shown in the preview
</span>
</t>
</div>
......
......@@ -18,7 +18,8 @@
</span>
</span>
<span class="tax_group_edit_input d-none">
<input type="text" class="o_field_float o_field_number o_input" t-att-data-original-value="line[1]"/>
<input type="text" class="o_field_float o_field_number o_input"
t-att-data-original-value="line[1]"/>
</span>
</t>
<t t-if="!displayEditWidget or line[1] === 0">
......
odoo.define('account.reconciliation_field_tests', function (require) {
"use strict";
"use strict";
var FormView = require('web.FormView');
var testUtils = require('web.test_utils');
var FormView = require('web.FormView');
var testUtils = require('web.test_utils');
var createView = testUtils.createView;
var createView = testUtils.createView;
QUnit.module('account', {
QUnit.module('account', {
beforeEach: function () {
this.data = {
'account.move': {
fields: {
payments_widget: {string: "payments_widget data", type: "char"},
outstanding_credits_debits_widget: {string: "outstanding_credits_debits_widget data", type: "char"},
outstanding_credits_debits_widget: {
string: "outstanding_credits_debits_widget data",
type: "char"
},
},
records: [{
id: 1,
......@@ -22,7 +25,7 @@ QUnit.module('account', {
},
};
}
}, function () {
}, function () {
QUnit.module('Reconciliation');
QUnit.test('Reconciliation form field', async function (assert) {
......@@ -32,9 +35,9 @@ QUnit.module('account', {
View: FormView,
model: 'account.move',
data: this.data,
arch: '<form>'+
'<field name="outstanding_credits_debits_widget" widget="payment"/>'+
'<field name="payments_widget" widget="payment"/>'+
arch: '<form>' +
'<field name="outstanding_credits_debits_widget" widget="payment"/>' +
'<field name="payments_widget" widget="payment"/>' +
'</form>',
res_id: 1,
mockRPC: function (route, args) {
......@@ -80,5 +83,5 @@ QUnit.module('account', {
form.destroy();
});
});
});
});
odoo.define('account.section_and_note_tests', function (require) {
"use strict";
"use strict";
var FormView = require('web.FormView');
var testUtils = require('web.test_utils');
var createView = testUtils.createView;
var FormView = require('web.FormView');
var testUtils = require('web.test_utils');
var createView = testUtils.createView;
QUnit.module('section_and_note', {
QUnit.module('section_and_note', {
beforeEach: function () {
this.data = {
invoice: {
......@@ -45,7 +45,7 @@ QUnit.module('section_and_note', {
},
};
},
}, function () {
}, function () {
QUnit.test('correct display of section and note fields', async function (assert) {
assert.expect(5);
var form = await createView({
......@@ -94,5 +94,5 @@ QUnit.module('section_and_note', {
form.destroy();
});
});
});
});
......@@ -17,7 +17,9 @@
<field name="model">res.district</field>
<field name="arch" type="xml">
<tree string="Kabupaten/Kota" sample="1">
<field name="display_code" string="Kode"/>
<field name="display_code" string="Prov"/>
<field name="typ" string="Jenis"/>
<field name="code" string="Kode"/>
<field name="name" string="Nama"/>
</tree>
</field>
......@@ -43,6 +45,7 @@
<form>
<group>
<field name="state_id" string="Provinsi"/>
<field name="typ" string="Jenis"/>
<field name="code" string="Kabupaten/Kota"/>
<field name="display_code" string="Full Kode"/>
<field name="name" string="Nama"/>
......
......@@ -47,19 +47,19 @@
<field name="inherit_id" ref="account.product_template_form_view"/>
<field name="arch" type="xml">
<!-- <xpath expr="//page[@name='general_information']" position="replace"/>-->
<!-- <xpath expr="//page[@name='general_information']" position="replace"/>-->
<xpath expr="//page[@name='inventory']" position="replace"/>
<xpath expr="//page[@name='sales']" position="replace"/>
<xpath expr="//page[@name='purchase']" position="replace"/>
<!-- <xpath expr="//div[@name='options']" position="after">-->
<!-- <xpath expr="//div[@name='options']" position="after">-->
<!-- Menambah field setelah pricing -->
<!-- <field name="active" invisible=""/>-->
<!-- <field name="categ_id" invisible="0"/>-->
<!-- </xpath>-->
<!-- <xpath expr="//div[@name='default_code']" position="attribute">-->
<!-- <field name="string" string="NOPD"/>-->
<!-- </xpath>-->
<!-- <field name="active" invisible=""/>-->
<!-- <field name="categ_id" invisible="0"/>-->
<!-- </xpath>-->
<!-- <xpath expr="//div[@name='default_code']" position="attribute">-->
<!-- <field name="string" string="NOPD"/>-->
<!-- </xpath>-->
</field>
</record>
......
......@@ -60,16 +60,16 @@
parent="config_pdl_kab_menu"
action="action_district_config_pdl_kab"
sequence="2"/>
<!-- <menuitem id="sub_district_config_pdl_kab_menu"-->
<!-- name="Kecamatan"-->
<!-- parent="config_pdl_kab_menu"-->
<!-- action="action_sub_district_config_pdl_kab"-->
<!-- sequence="2"/>-->
<!-- <menuitem id="village_config_pdl_kab_menu"-->
<!-- name="Desa/Kelurahan"-->
<!-- parent="config_pdl_kab_menu"-->
<!-- action="action_village_config_pdl_kab"-->
<!-- sequence="2"/>-->
<menuitem id="sub_district_config_pdl_kab_menu"
name="Kecamatan"
parent="config_pdl_kab_menu"
action="action_sub_district_config_pdl_kab"
sequence="2"/>
<menuitem id="village_config_pdl_kab_menu"
name="Desa/Kelurahan"
parent="config_pdl_kab_menu"
action="action_village_config_pdl_kab"
sequence="2"/>
<menuitem id="sudut_pandang_config_pdl_kab_menu"
name="Sudut Pandang"
parent="config_pdl_kab_menu"
......
......@@ -7,6 +7,7 @@
<field name="arch" type="xml">
<tree string="Kecamatan" sample="1">
<field name="display_code" string="Kode"/>
<field name="code" string="Kode"/>
<field name="name" string="Nama"/>
</tree>
</field>
......@@ -25,8 +26,8 @@
</record>
<record id="sub_district_template_form" model="ir.ui.view">
<field name="name">sub_district.template.form</field>
<field name="model">res.sub_district</field>
<field name="name">sub.district.template.form</field>
<field name="model">res.district.sub</field>
<field name="priority">4</field>
<field name="arch" type="xml">
<form>
......
......@@ -3,37 +3,39 @@
<data>
<record id="village_template_tree" model="ir.ui.view">
<field name="name">sub.district.template.tree</field>
<field name="model">res.district.sub</field>
<field name="model">res.district.village</field>
<field name="arch" type="xml">
<tree string="Kecamatan" sample="1">
<tree string="Desa/Kelurahan" sample="1">
<field name="display_code" string="Kode"/>
<field name="code" string="Kode"/>
<field name="name" string="Nama"/>
</tree>
</field>
</record>
<record id="action_village_config_pdl_kab" model="ir.actions.act_window">
<field name="name">Kecamatan</field>
<field name="res_model">res.district.sub</field>
<field name="name">Desa/Kelurahan</field>
<field name="res_model">res.district.village</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_id" ref="village_template_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Kecamatan
Desa/Kelurahan
</p>
</field>
</record>
<record id="village_template_form" model="ir.ui.view">
<field name="name">village.template.form</field>
<field name="model">res.village</field>
<field name="model">res.district.village</field>
<field name="priority">4</field>
<field name="arch" type="xml">
<form>
<group>
<field name="display_code" string="Full Kode"/>
<field name="sub_district_id" string="Kecamatan"/>
<field name="typ" string="Jenis"/>
<field name="code" string="Desa/Kelurahan"/>
<field name="display_code" string="Full Kode"/>
<field name="name" string="Nama"/>
</group>
</form>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!