[FIX] account: various cosmetics fixes
This commit is contained in:
committed by
Cédric Snauwaert
parent
d55a796dbb
commit
4f03ec98cc
@@ -21,8 +21,8 @@ class AccountCashboxLine(models.Model):
|
||||
""" Calculates Sub total"""
|
||||
self.subtotal = self.coin_value * self.number
|
||||
|
||||
coin_value = fields.Float(string='Unit of Currency', required=True, digits=0)
|
||||
number = fields.Integer(string='Opening Number of Units', help='Opening Unit Numbers')
|
||||
coin_value = fields.Float(string='Coin/Bill Value', required=True, digits=0)
|
||||
number = fields.Integer(string='Number of Coins/Bills', help='Opening Unit Numbers')
|
||||
subtotal = fields.Float(compute='_sub_total', string='Subtotal', digits=0, readonly=True)
|
||||
cashbox_id = fields.Many2one('account.bank.statement.cashbox')
|
||||
|
||||
@@ -178,7 +178,7 @@ class AccountBankStatement(models.Model):
|
||||
if context.get('cashbox_id'):
|
||||
context['active_id'] = self.id
|
||||
return {
|
||||
'name': _('Cashbox Entries'),
|
||||
'name': _('Cash Control'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'account.bank.statement.cashbox',
|
||||
|
||||
@@ -195,7 +195,7 @@ class AccountInvoice(models.Model):
|
||||
move_name = fields.Char(string='Journal Entry', readonly=True,
|
||||
default=False, copy=False,
|
||||
help="Technical field holding the number given to the invoice, automatically set when the invoice is validated then stored to set the same number again if the invoice is cancelled, set to draft and re-validated.")
|
||||
reference = fields.Char(string='Partner\'s Invoice Reference',
|
||||
reference = fields.Char(string='Supplier Reference',
|
||||
help="The partner reference of this invoice.")
|
||||
reference_type = fields.Selection('_get_reference_type', string='Payment Reference',
|
||||
required=True, readonly=True, states={'draft': [('readonly', False)]},
|
||||
|
||||
@@ -293,7 +293,7 @@ class AccountMoveLine(models.Model):
|
||||
counterpart = counterpart[0:2] + ["..."]
|
||||
self.counterpart = ",".join(counterpart)
|
||||
|
||||
name = fields.Char(required=True)
|
||||
name = fields.Char(required=True, string="Label")
|
||||
quantity = fields.Float(digits=(16, 2),
|
||||
help="The optional quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very useful for some reports.")
|
||||
product_uom_id = fields.Many2one('product.uom', string='Unit of Measure')
|
||||
@@ -333,7 +333,7 @@ class AccountMoveLine(models.Model):
|
||||
help="You can check this box to mark this journal item as a litigation with the associated partner")
|
||||
date_maturity = fields.Date(string='Due date', index=True, required=True,
|
||||
help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line.")
|
||||
date = fields.Date(related='move_id.date', string='Effective date', required=True, index=True, default=fields.Date.context_today, store=True, copy=False)
|
||||
date = fields.Date(related='move_id.date', string='Date', required=True, index=True, default=fields.Date.context_today, store=True, copy=False)
|
||||
analytic_lines = fields.One2many('account.analytic.line', 'move_id', string='Analytic lines')
|
||||
tax_ids = fields.Many2many('account.tax', string='Taxes', copy=False, readonly=True)
|
||||
tax_line_id = fields.Many2one('account.tax', string='Originator tax', copy=False, readonly=True)
|
||||
|
||||
@@ -39,8 +39,8 @@ class account_abstract_payment(models.AbstractModel):
|
||||
amount = fields.Monetary(string='Payment Amount', required=True)
|
||||
currency_id = fields.Many2one('res.currency', string='Currency', required=True, default=lambda self: self.env.user.company_id.currency_id)
|
||||
payment_date = fields.Date(string='Payment Date', default=fields.Date.context_today, required=True, copy=False)
|
||||
communication = fields.Char()
|
||||
journal_id = fields.Many2one('account.journal', string='Bank Journal', required=True, domain=[('type', 'in', ('bank', 'cash'))])
|
||||
communication = fields.Char(string='Memo')
|
||||
journal_id = fields.Many2one('account.journal', string='Payment Mode', required=True, domain=[('type', 'in', ('bank', 'cash'))])
|
||||
company_id = fields.Many2one('res.company', related='journal_id.company_id', string='Company', readonly=True)
|
||||
|
||||
hide_payment_method = fields.Boolean(compute='_compute_hide_payment_method',
|
||||
@@ -214,8 +214,8 @@ class account_payment(models.Model):
|
||||
|
||||
invoice_ids = fields.Many2many('account.invoice', 'account_invoice_payment_rel', 'payment_id', 'invoice_id', string="Invoices", copy=False, readonly=True)
|
||||
has_invoices = fields.Boolean(compute="_get_has_invoices", help="Technical field used for usablity purposes")
|
||||
payment_difference = fields.Float(compute='_compute_payment_difference', readonly=True)
|
||||
payment_difference_handling = fields.Selection([('open', 'Keep Open'), ('reconcile', 'Reconcile Payment Balance')], default='open', string="Payment Difference", copy=False)
|
||||
payment_difference = fields.Monetary(compute='_compute_payment_difference', readonly=True)
|
||||
payment_difference_handling = fields.Selection([('open', 'Partial payment'), ('reconcile', 'Mark invoice as fully paid')], default='open', string="Payment Difference", copy=False)
|
||||
writeoff_account = fields.Many2one('account.account', string="Counterpart Account", domain=[('deprecated', '=', False)], copy=False)
|
||||
|
||||
# FIXME: ondelete='restrict' not working (eg. cancel a bank statement reconciliation with a payment)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</t>
|
||||
<t t-if="!outstanding">
|
||||
<td>
|
||||
<i class="oe_form_field text-right" t-att-title="line.name + '\n'+ line.ref">Paid on <t t-esc="line.date"></t></i>
|
||||
<i class="oe_form_field text-right" t-att-title="line.name + '\n'+ line.ref">Payment on <t t-esc="line.date"></t></i>
|
||||
</td>
|
||||
</t>
|
||||
<td style="text-align:right;">
|
||||
|
||||
@@ -122,9 +122,9 @@
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state == 'draft';black:state in ('proforma','proforma2','open');gray:state == 'cancel'" string="Invoice">
|
||||
<field name="partner_id" groups="base.group_user" string="Customer"/>
|
||||
<field name="date_invoice"/>
|
||||
<field name="number"/>
|
||||
<field name="partner_id" groups="base.group_user"/>
|
||||
<field name="commercial_partner_id" invisible="1"/>
|
||||
<field name="reference" invisible="1"/>
|
||||
<field name="name" invisible="1"/>
|
||||
@@ -186,9 +186,9 @@
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state == 'draft';black:state in ('proforma','proforma2','open');gray:state == 'cancel'" string="Invoice">
|
||||
<field name="partner_id" groups="base.group_user" string="Supplier"/>
|
||||
<field name="date_invoice"/>
|
||||
<field name="number"/>
|
||||
<field name="partner_id" groups="base.group_user"/>
|
||||
<field name="reference"/>
|
||||
<field name="commercial_partner_id" invisible="1"/>
|
||||
<field name="name" invisible="1"/>
|
||||
@@ -223,7 +223,7 @@
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
|
||||
</header>
|
||||
<div class="alert alert-info" role="alert" style="margin-bottom:0px;" attrs="{'invisible': [('has_outstanding','=',False)]}">
|
||||
You have <bold><a class="alert-link" href="#outstanding">unassigned outstanding debit</a></bold> for this invoice
|
||||
You have <bold><a class="alert-link" onclick="var current_url=location.href;location.href='#outstanding';history.replaceState(null,null,current_url);">outstanding payments</a></bold> for this customer. You can reconcile them to pay this invoice.
|
||||
</div>
|
||||
<field name="has_outstanding" invisible="1"/>
|
||||
<sheet string="Supplier Bill">
|
||||
@@ -364,7 +364,7 @@
|
||||
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
|
||||
</header>
|
||||
<div class="alert alert-info" role="alert" style="margin-bottom:0px;" attrs="{'invisible': [('has_outstanding','=',False)]}">
|
||||
You have <bold><a class="alert-link" href="#outstanding">unassigned outstanding credit</a></bold> for this invoice
|
||||
You have <bold><a class="alert-link" onclick="var current_url=location.href;location.href='#outstanding';history.replaceState(null,null,current_url);">outstanding payments</a></bold> for this customer. You can reconcile them to pay this invoice.
|
||||
</div>
|
||||
<field name="has_outstanding" invisible="1"/>
|
||||
<sheet string="Invoice">
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="payment_date" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
|
||||
<field name="communication" string="Memo" attrs="{'invisible': [('state', '!=', 'draft'), ('communication', '=', False)], 'readonly': [('state', '!=', 'draft')]}"/>
|
||||
<field name="communication" attrs="{'invisible': [('state', '!=', 'draft'), ('communication', '=', False)], 'readonly': [('state', '!=', 'draft')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
@@ -111,6 +111,22 @@
|
||||
</record>
|
||||
|
||||
<record id="action_account_payments" model="ir.actions.act_window">
|
||||
<field name="name">Payments</field>
|
||||
<field name="res_model">account.payment</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="context">{'default_payment_type': 'inbound'}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to register a payment
|
||||
</p><p>
|
||||
Payments are used to register liquidity movements (send, collect or transfer money).
|
||||
You can then process those payments by your own means or by using installed facilities.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_payments_payable" model="ir.actions.act_window">
|
||||
<field name="name">Payments</field>
|
||||
<field name="res_model">account.payment</field>
|
||||
<field name="view_type">form</field>
|
||||
@@ -125,8 +141,9 @@
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_payments" id="menu_action_account_payments_receivable" parent="menu_finance_receivables" sequence="20" groups="group_account_user"/>
|
||||
<menuitem action="action_account_payments" id="menu_action_account_payments_payable" parent="menu_finance_payables" sequence="20" groups="group_account_user"/>
|
||||
<menuitem action="action_account_payments_payable" id="menu_action_account_payments_payable" parent="menu_finance_payables" sequence="20" groups="group_account_user"/>
|
||||
|
||||
<record id="view_account_payment_invoice_form" model="ir.ui.view">
|
||||
<field name="name">account.payment.invoice.form</field>
|
||||
@@ -155,14 +172,17 @@
|
||||
<field name="communication"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('payment_difference', '<=', 0.0)]}">
|
||||
<label for="payment_difference"/>
|
||||
<div>
|
||||
<field name="payment_difference"/>
|
||||
<field name="payment_difference_handling" widget="radio"/>
|
||||
<field name="payment_difference_handling" widget="radio" nolabel="1"/>
|
||||
</div>
|
||||
<field name="writeoff_account" attrs="{'required': [('payment_difference_handling', '=', 'reconcile')], 'invisible': [('payment_difference_handling', '!=', 'reconcile')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
<footer>
|
||||
<button string='Pay' name="post" type="object" class="oe_highlight"/>
|
||||
<button string='Validate' name="post" type="object" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel"/>
|
||||
</footer>
|
||||
@@ -206,7 +226,7 @@
|
||||
</group>
|
||||
</group>
|
||||
<footer>
|
||||
<button string='Pay' name="create_payment" type="object" class="oe_highlight"/>
|
||||
<button string='Validate' name="create_payment" type="object" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel"/>
|
||||
</footer>
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
<tree editable="bottom">
|
||||
<field name="coin_value"/>
|
||||
<field name="number"/>
|
||||
<field name="subtotal"/>
|
||||
<field name="subtotal" sum="Total"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
@@ -347,7 +347,7 @@
|
||||
</record>
|
||||
|
||||
<record id="action_view_account_bnk_stmt_cashbox" model="ir.actions.act_window">
|
||||
<field name="name">Cashbox Entries</field>
|
||||
<field name="name">Cash Control</field>
|
||||
<field name="res_model">account.bank.statement.cashbox</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
@@ -1061,6 +1061,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Journal Items" create="false">
|
||||
<field name="date"/>
|
||||
<field name="move_id" required="0"/>
|
||||
<field name="journal_id" options='{"no_open":True}' invisible="context.get('journal_id',False)"/>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
@@ -1068,7 +1069,6 @@
|
||||
<field name="partner_id"/>
|
||||
<field name="account_id" options='{"no_open":True}' domain="[('company_id', '=', company_id)]"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('type','not in',['view','template'])]" invisible="not context.get('analytic_journal_id',False)"/>
|
||||
<field name="move_id" required="0"/>
|
||||
<field name="reconciled"/>
|
||||
<field name="debit" sum="Total Debit"/>
|
||||
<field name="credit" sum="Total Credit"/>
|
||||
@@ -1230,13 +1230,13 @@
|
||||
<tree editable="top" string="Journal Items">
|
||||
<field name="name"/>
|
||||
<field name="account_id" domain="[('company_id', '=', parent.company_id)]"/>
|
||||
<field name="debit" sum="Total Debit"/>
|
||||
<field name="credit" sum="Total Credit"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="amount_currency" groups="base.group_multi_currency"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
<field name="reconciled"/>
|
||||
<field name="debit" sum="Total Debit"/>
|
||||
<field name="credit" sum="Total Credit"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="narration" colspan="4" placeholder="Add an internal note..." nolabel="1" height="50"/>
|
||||
@@ -1816,7 +1816,6 @@
|
||||
<field colspan="4" name="name"/>
|
||||
<field name="debit_credit"/>
|
||||
<field name="report_type"/>
|
||||
<separator string="Lines"/>
|
||||
<field colspan="4" name="line_ids" nolabel="1"/>
|
||||
</group>
|
||||
</sheet>
|
||||
@@ -1891,10 +1890,10 @@
|
||||
<field name="model">account.financial.report.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Report Lines">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="level"/>
|
||||
<field name="green_on_positive"/>
|
||||
<field name="figure_type"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -275,8 +275,10 @@
|
||||
<field name="target">inline</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_account_config" name="Invoicing" parent="base.menu_config"
|
||||
sequence="14" action="action_account_config"/>
|
||||
<menuitem id="base.menu_account_config" name="Invoicing" parent="base.menu_config"
|
||||
sequence="1"/>
|
||||
<menuitem id="base.menu_account_general_settings" name="Settings" parent="base.menu_account_config"
|
||||
sequence="0" action="action_account_config"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -20,4 +20,3 @@
|
||||
##############################################################################
|
||||
|
||||
import account_voucher
|
||||
import report
|
||||
|
||||
@@ -51,7 +51,6 @@ This module manages:
|
||||
'security/ir.model.access.csv',
|
||||
'account_voucher_view.xml',
|
||||
'voucher_sales_purchase_view.xml',
|
||||
'report/account_voucher_sales_receipt_view.xml',
|
||||
'security/account_voucher_security.xml',
|
||||
'account_voucher_data.xml',
|
||||
],
|
||||
|
||||
@@ -100,7 +100,7 @@ class AccountVoucher(models.Model):
|
||||
\n* The \'Pro-forma\' when voucher is in Pro-forma status,voucher does not have an voucher number. \
|
||||
\n* The \'Posted\' status is used when user create voucher,a voucher number is generated and voucher entries are created in account \
|
||||
\n* The \'Cancelled\' status is used when user cancel voucher.')
|
||||
reference = fields.Char('Supplier Reference', readonly=True, states={'draft': [('readonly', False)]},
|
||||
reference = fields.Char('Bill Reference', readonly=True, states={'draft': [('readonly', False)]},
|
||||
help="The partner reference of this document.", copy=False)
|
||||
amount = fields.Monetary(string='Total', store=True, readonly=True, compute='_compute_total')
|
||||
tax_amount = fields.Monetary(readonly=True, store=True, compute='_compute_total')
|
||||
@@ -111,7 +111,7 @@ class AccountVoucher(models.Model):
|
||||
paid = fields.Boolean(compute='_check_paid', help="The Voucher has been totally paid.")
|
||||
pay_now = fields.Selection([
|
||||
('pay_now', 'Pay Directly'),
|
||||
('pay_later', 'Pay Later or Group Funds'),
|
||||
('pay_later', 'Pay Later'),
|
||||
], 'Payment', select=True, readonly=True, states={'draft': [('readonly', False)]}, default='pay_now')
|
||||
date_due = fields.Date('Due Date', readonly=True, select=True, states={'draft': [('readonly', False)]})
|
||||
audit = fields.Boolean('To Review', related="move_id.to_check", help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.')
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import account_voucher_sales_receipt
|
||||
@@ -1,114 +0,0 @@
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import tools
|
||||
from openerp import models, fields
|
||||
|
||||
class sale_receipt_report(models.Model):
|
||||
_name = "sale.receipt.report"
|
||||
_description = "Sales Receipt Statistics"
|
||||
_auto = False
|
||||
_rec_name = 'date'
|
||||
date = fields.Date(readonly=True)
|
||||
currency_id = fields.Many2one('res.currency', string='Currency', readonly=True)
|
||||
journal_id = fields.Many2one('account.journal', string='Journal', readonly=True)
|
||||
partner_id = fields.Many2one('res.partner', string='Partner', readonly=True)
|
||||
company_id = fields.Many2one('res.company', string='Company', readonly=True)
|
||||
user_id = fields.Many2one('res.users', string='Salesperson', readonly=True)
|
||||
price_total = fields.Float(string='Total Without Tax', readonly=True)
|
||||
price_total_tax = fields.Float(string='Total With Tax', readonly=True)
|
||||
nbr = fields.Integer(string='# of Voucher Lines', readonly=True)
|
||||
type = fields.Selection([
|
||||
('sale', 'Sale'),
|
||||
('purchase', 'Purchase'),
|
||||
], readonly=True)
|
||||
state = fields.Selection([
|
||||
('draft', 'Draft'),
|
||||
('proforma', 'Pro-forma'),
|
||||
('posted', 'Posted'),
|
||||
('cancel', 'Cancelled')
|
||||
], string='Voucher Status', readonly=True)
|
||||
pay_now = fields.Selection([
|
||||
('pay_now', 'Pay Directly'),
|
||||
('pay_later', 'Pay Later or Group Funds'),
|
||||
], string='Payment', readonly=True)
|
||||
date_due = fields.Date(string='Due Date', readonly=True)
|
||||
account_id = fields.Many2one('account.account', string='Account', readonly=True, domain=[('deprecated', '=', False)])
|
||||
delay_to_pay = fields.Float(string='Avg. Delay To Pay', readonly=True, group_operator="avg")
|
||||
due_delay = fields.Float(string='Avg. Due Delay', readonly=True, group_operator="avg")
|
||||
|
||||
_order = 'date desc'
|
||||
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'sale_receipt_report')
|
||||
cr.execute("""
|
||||
create or replace view sale_receipt_report as (
|
||||
select min(avl.id) as id,
|
||||
av.date as date,
|
||||
av.partner_id as partner_id,
|
||||
aj.currency_id as currency_id,
|
||||
av.journal_id as journal_id,
|
||||
rp.user_id as user_id,
|
||||
av.company_id as company_id,
|
||||
count(avl.*) as nbr,
|
||||
av.voucher_type as type,
|
||||
av.state,
|
||||
av.pay_now,
|
||||
av.date_due as date_due,
|
||||
av.account_id as account_id,
|
||||
sum(av.amount-av.tax_amount)/(select count(l.id) from account_voucher_line as l
|
||||
left join account_voucher as a ON (a.id=l.voucher_id)
|
||||
where a.id=av.id) as price_total,
|
||||
sum(av.amount)/(select count(l.id) from account_voucher_line as l
|
||||
left join account_voucher as a ON (a.id=l.voucher_id)
|
||||
where a.id=av.id) as price_total_tax,
|
||||
sum((select extract(epoch from avg(date_trunc('day',aml.date)-date_trunc('day',l.create_date)))/(24*60*60)::decimal(16,2)
|
||||
from account_move_line as aml
|
||||
left join account_voucher as a ON (a.move_id=aml.move_id)
|
||||
left join account_voucher_line as l ON (a.id=l.voucher_id)
|
||||
where a.id=av.id)) as delay_to_pay,
|
||||
sum((select extract(epoch from avg(date_trunc('day',a.date_due)-date_trunc('day',a.date)))/(24*60*60)::decimal(16,2)
|
||||
from account_move_line as aml
|
||||
left join account_voucher as a ON (a.move_id=aml.move_id)
|
||||
left join account_voucher_line as l ON (a.id=l.voucher_id)
|
||||
where a.id=av.id)) as due_delay
|
||||
from account_voucher_line as avl
|
||||
left join account_voucher as av on (av.id=avl.voucher_id)
|
||||
left join res_partner as rp ON (rp.id=av.partner_id)
|
||||
left join account_journal as aj ON (aj.id=av.journal_id)
|
||||
where av.voucher_type='sale' and aj.type='sale'
|
||||
group by
|
||||
av.date,
|
||||
av.id,
|
||||
av.partner_id,
|
||||
aj.currency_id,
|
||||
av.journal_id,
|
||||
rp.user_id,
|
||||
av.company_id,
|
||||
av.voucher_type,
|
||||
av.state,
|
||||
av.date_due,
|
||||
av.account_id,
|
||||
av.tax_amount,
|
||||
av.amount,
|
||||
av.tax_amount,
|
||||
av.pay_now
|
||||
)
|
||||
""")
|
||||
@@ -1,78 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_sale_receipt_report_pivot" model="ir.ui.view">
|
||||
<field name="name">sale.receipt.report.pivot</field>
|
||||
<field name="model">sale.receipt.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<pivot string="Sales Receipts Analysis" disable_linking="True">
|
||||
<field name="partner_id" type="row"/>
|
||||
<field name="date_due" type="col"/>
|
||||
<field name="price_total" type="measure"/>
|
||||
</pivot>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sale_receipt_report_graph" model="ir.ui.view">
|
||||
<field name="name">sale.receipt.report.graph</field>
|
||||
<field name="model">sale.receipt.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Sales Receipts Analysis">
|
||||
<field name="partner_id"/>
|
||||
<field name="date_due"/>
|
||||
<field name="price_total" type="measure"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sale_receipt_report_search" model="ir.ui.view">
|
||||
<field name="name">sale.receipt.report.search</field>
|
||||
<field name="model">sale.receipt.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Sales Receipts Analysis">
|
||||
<field name="date"/>
|
||||
<field name="date_due"/>
|
||||
<filter string="Draft" domain="[('state','=','draft')]" help = "Draft Vouchers"/>
|
||||
<filter string="Posted" name="current" domain="[('state','not in', ('draft','cancel'))]" help = "Validated Vouchers"/>
|
||||
<field name="partner_id"/>
|
||||
<group expand="0" string="Extended Filters...">
|
||||
<field name="journal_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="pay_now"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<group expand="1" string="Group By">
|
||||
<filter string="Partner" name="partner" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Status" context="{'group_by':'state'}"/>
|
||||
<filter string="Type" context="{'group_by':'type'}"/>
|
||||
<filter string="Journal" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator/>
|
||||
<filter string="Due Month" context="{'group_by':'date_due:month'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sale_receipt_report_all" model="ir.actions.act_window">
|
||||
<field name="name">Sales Receipts Analysis</field>
|
||||
<field name="res_model">sale.receipt.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">pivot,graph</field>
|
||||
<field name="context">{'search_default_year':1,'search_default_month':1,'search_default_partner':1, 'search_default_customer':1}</field>
|
||||
<field name="search_view_id" ref="view_sale_receipt_report_search"/>
|
||||
<field name="help" type="html">
|
||||
<p>
|
||||
From this report, you can have an overview of the amount invoiced
|
||||
to your customer as well as payment delays. The tool search can
|
||||
also be used to personalise your Invoices reports and so, match
|
||||
this analysis to your needs.
|
||||
</p>
|
||||
</field>
|
||||
|
||||
</record>
|
||||
|
||||
<menuitem action="action_sale_receipt_report_all" id="menu_action_sale_receipt_report_all" parent="account.menu_finance_reports" sequence="3"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -2,6 +2,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_account_voucher_manager,account.voucher,model_account_voucher,account.group_account_manager,1,0,0,0
|
||||
access_account_voucher_line_manager,account.voucher.line,model_account_voucher_line,account.group_account_manager,1,0,0,0
|
||||
access_account_voucher_invoice,account.voucher invoice,model_account_voucher,account.group_account_invoice,1,1,1,1
|
||||
access_account_voucher_line_invoice,account.voucher.line invoice,model_account_voucher_line,account.group_account_invoice,1,1,1,1
|
||||
access_sale_receipt_report_manager,account.sale.receipt.report,model_sale_receipt_report,account.group_account_manager,1,1,1,1
|
||||
access_sale_receipt_report_user,account.sale.receipt.report,model_sale_receipt_report,account.group_account_user,1,0,0,0
|
||||
access_account_voucher_line_invoice,account.voucher.line invoice,model_account_voucher_line,account.group_account_invoice,1,1,1,1
|
||||
|
@@ -63,15 +63,15 @@
|
||||
<field name="currency_id" invisible="True"/>
|
||||
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
|
||||
<field name="partner_id" domain="[('customer','=',True)]" string="Customer" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
|
||||
<field name="pay_now" required="1"/>
|
||||
<field name="account_id"
|
||||
domain="[('internal_type','in', ['liquidity', 'receivable'])]"/>
|
||||
<field name="pay_now" required="1"/>
|
||||
<field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="journal_id" domain="[('type','=','sale')]" widget="selection" groups="account.group_account_user"/>
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="name" attrs="{'invisible': [('pay_now', '=', 'pay_later')]}"/>
|
||||
<field name="paid" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -103,8 +103,10 @@
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
|
||||
<field name="move_id" readonly="1"/>
|
||||
<page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}" groups="base.group_no_one">
|
||||
<group>
|
||||
<field name="move_id" readonly="1"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
@@ -169,19 +171,19 @@
|
||||
<sheet string="Supplier Voucher">
|
||||
<h1><label for="number" string="Purchase Receipt"/> <field name="number" class="oe_inline" readonly="1"/></h1>
|
||||
|
||||
<field name="pay_now" invisible="1"/>
|
||||
<field name="voucher_type" invisible="True"/>
|
||||
<group>
|
||||
<group>
|
||||
<field name="partner_id" domain="[('supplier','=',True)]" string="Supplier" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" />
|
||||
<field name="pay_now" required="1"/>
|
||||
<field name="account_id" domain="[('internal_type', 'in', ['liquidity', 'payable'])]"/>
|
||||
<field name="name" colspan="2"/>
|
||||
<field name="name" colspan="2" attrs="{'invisible': [('pay_now', '=', 'pay_later')]}"/>
|
||||
<field name="reference"/>
|
||||
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date" string="Bill Date"/>
|
||||
<field name="date_due"/>
|
||||
<field name="date_due" attrs="{'invisible': [('pay_now', '=', 'pay_later')]}"/>
|
||||
<field name="paid" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="journal_id"
|
||||
@@ -219,11 +221,13 @@
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
|
||||
<page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}" groups="base.group_no_one">
|
||||
<group col="4">
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<field name="move_id" readonly="1"/>
|
||||
<group>
|
||||
<field name="move_id" readonly="1"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
|
||||
@@ -230,6 +230,16 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_expenses_tree"/>
|
||||
<field name="domain">[('state','=','accepted')]</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to register new expenses.
|
||||
</p><p>
|
||||
Odoo will ensure the whole process is followed; the expense
|
||||
sheet is validated by manager(s), the employee is reimbursed
|
||||
from his expenses, some expenses must be re-invoiced to the
|
||||
customers.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_request_approve_expense" model="ir.actions.act_window">
|
||||
|
||||
Reference in New Issue
Block a user