Merge pull request #276 from odoo-dev/master-account-fixes-csn
Various cosmetics and traceback fixes
This commit is contained in:
@@ -87,6 +87,13 @@ class AccountAccount(models.Model):
|
||||
# if res[account.id]:
|
||||
# account.has_unreconciled_entries = True
|
||||
|
||||
@api.multi
|
||||
@api.constrains('internal_type', 'reconcile')
|
||||
def _check_reconcile(self):
|
||||
for account in self:
|
||||
if account.internal_type in ('receivable', 'payable') and account.reconcile == False:
|
||||
raise ValueError(_('You cannot have a receivable/payable account that is not reconciliable. (account code: %s)') % account.code)
|
||||
|
||||
name = fields.Char(required=True, index=True)
|
||||
currency_id = fields.Many2one('res.currency', string='Secondary Currency',
|
||||
help="Forces all moves for this account to have this secondary currency.")
|
||||
@@ -124,6 +131,11 @@ class AccountAccount(models.Model):
|
||||
accounts = self.search(domain + args, limit=limit)
|
||||
return accounts.name_get()
|
||||
|
||||
@api.onchange('internal_type')
|
||||
def onchange_internal_type(self):
|
||||
if self.internal_type in ('receivable', 'payable'):
|
||||
self.reconcile = True
|
||||
|
||||
@api.multi
|
||||
@api.depends('name', 'code')
|
||||
def name_get(self):
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -53,6 +53,7 @@ class AccountConfigSettings(models.TransientModel):
|
||||
sale_tax_rate = fields.Float(string='Sales tax (%)')
|
||||
purchase_tax_rate = fields.Float(string='Purchase tax (%)')
|
||||
bank_account_code_char = fields.Char(string='Bank Accounts Code', related='company_id.bank_account_code_char', help='Define the code for the bank account')
|
||||
template_transfer_account_id = fields.Many2one('account.account.template', help="Intermediary account used when moving money from a liquidity account to another")
|
||||
transfer_account_id = fields.Many2one('account.account',
|
||||
related='company_id.transfer_account_id',
|
||||
domain=lambda self: [('reconcile', '=', True), ('user_type.id', '=', self.env.ref('account.data_account_type_current_assets').id)],
|
||||
@@ -212,7 +213,7 @@ class AccountConfigSettings(models.TransientModel):
|
||||
if self.chart_template_id.code_digits:
|
||||
self.code_digits = self.chart_template_id.code_digits
|
||||
if self.chart_template_id.transfer_account_id:
|
||||
self.transfer_account_id = self.chart_template_id.transfer_account_id.id
|
||||
self.template_transfer_account_id = self.chart_template_id.transfer_account_id.id
|
||||
if self.chart_template_id.bank_account_code_char:
|
||||
self.bank_account_code_char = self.chart_template_id.bank_account_code_char
|
||||
return {}
|
||||
@@ -246,6 +247,11 @@ class AccountConfigSettings(models.TransientModel):
|
||||
'view_mode': 'form',
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def set_transfer_account(self):
|
||||
if self.transfer_account_id and self.transfer_account_id != self.company_id.transfer_account_id:
|
||||
self.company_id.write({'transfer_account_id': self.transfer_account_id.id})
|
||||
|
||||
@api.multi
|
||||
def set_product_taxes(self):
|
||||
""" Set the product taxes if they have changed """
|
||||
@@ -264,7 +270,7 @@ class AccountConfigSettings(models.TransientModel):
|
||||
wizard = self.env['wizard.multi.charts.accounts'].create({
|
||||
'company_id': self.company_id.id,
|
||||
'chart_template_id': self.chart_template_id.id,
|
||||
'transfer_account_id': self.transfer_account_id.id,
|
||||
'transfer_account_id': self.template_transfer_account_id.id,
|
||||
'code_digits': self.code_digits or 6,
|
||||
'sale_tax': self.sale_tax.id,
|
||||
'purchase_tax': self.purchase_tax.id,
|
||||
|
||||
@@ -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;">
|
||||
|
||||
@@ -15,18 +15,21 @@ class TestSearch(AccountTestUsers):
|
||||
name="Tax Received",
|
||||
code="X121",
|
||||
user_type=ac_ids.id,
|
||||
reconcile=True,
|
||||
)).id, "X121 Tax Received"
|
||||
|
||||
self.apurchase = self.account_model.create(dict(
|
||||
name="Purchased Stocks",
|
||||
code="X1101",
|
||||
user_type=ac_ids.id,
|
||||
reconcile=True,
|
||||
)).id, "X1101 Purchased Stocks"
|
||||
|
||||
self.asale = self.account_model.create(dict(
|
||||
name="Product Sales",
|
||||
code="XX200",
|
||||
user_type=ac_ids.id,
|
||||
reconcile=True,
|
||||
)).id, "XX200 Product Sales"
|
||||
|
||||
self.all_ids = [self.atax[0], self.apurchase[0], self.asale[0]]
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -83,6 +83,10 @@
|
||||
<label for="purchase_tax_rate"/>
|
||||
<field name="purchase_tax_rate" />
|
||||
</div>
|
||||
<div attrs="{'invisible': ['|', ('chart_template_id','=',False), ('has_chart_of_accounts','!=',False)]}">
|
||||
<label for="template_transfer_account_id"/>
|
||||
<field name="template_transfer_account_id" class="oe_inline"/>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<group string="Fiscal Year">
|
||||
@@ -231,9 +235,9 @@
|
||||
class="oe_inline oe_link"/>
|
||||
<field name="company_footer"/>
|
||||
</div>
|
||||
<div>
|
||||
<div attrs="{'invisible': [('has_chart_of_accounts','=',False)]}">
|
||||
<label for="transfer_account_id"/>
|
||||
<field name="transfer_account_id" class="oe_inline" attrs="{'required': [('chart_template_id','!=',False)]}"/>
|
||||
<field name="transfer_account_id" class="oe_inline" attrs="{'required': [('has_chart_of_accounts','!=',False)]}"/>
|
||||
</div>
|
||||
<div name='payment_acquirer'>
|
||||
<label for="paypal_account"/>
|
||||
@@ -275,8 +279,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>
|
||||
|
||||
@@ -243,16 +243,14 @@ class account_asset_asset(osv.osv):
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'note': fields.text('Note'),
|
||||
'category_id': fields.many2one('account.asset.category', 'Asset Category', required=True, change_default=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'parent_id': fields.many2one('account.asset.asset', 'Parent Asset', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'child_ids': fields.one2many('account.asset.asset', 'parent_id', 'Children Assets', copy=True),
|
||||
'purchase_date': fields.date('Purchase Date', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'state': fields.selection([('draft','Draft'),('open','Running'),('close','Close')], 'Status', required=True, copy=False,
|
||||
help="When an asset is created, the status is 'Draft'.\n" \
|
||||
"If the asset is confirmed, the status goes in 'Running' and the depreciation lines can be posted in the accounting.\n" \
|
||||
"You can manually close an asset when the depreciation is over. If the last line of depreciation is posted, the asset automatically goes in that status."),
|
||||
'active': fields.boolean('Active'),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'method': fields.selection([('linear','Linear: Computed on basis of Gross Value / Number of Depreciations'),('degressive','Degressive: Computed on basis of Residual Value * Degressive Factor')], 'Computation Method', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose the method to use to compute the amount of depreciation lines.\n"\
|
||||
'partner_id': fields.many2one('res.partner', 'Supplier', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose the method to use to compute the amount of depreciation lines.\n"\
|
||||
" * Linear: Calculated on basis of: Gross Value / Number of Depreciations\n" \
|
||||
" * Degressive: Calculated on basis of: Residual Value * Degressive Factor"),
|
||||
'method_number': fields.integer('Number of Depreciations', readonly=True, states={'draft':[('readonly',False)]}, help="The number of depreciations needed to depreciate your asset"),
|
||||
@@ -293,7 +291,6 @@ class account_asset_asset(osv.osv):
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_recursion, 'Error ! You cannot create recursive assets.', ['parent_id']),
|
||||
(_check_prorata, 'Prorata temporis can be applied only for time method "number of depreciations".', ['prorata']),
|
||||
]
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
'name': 'V6 Engine and 10 inches tires',
|
||||
'purchase_value': 2800.0,
|
||||
'category_id': ref('account_asset_category_fixedassets0'),
|
||||
'parent_id': ref('account_asset_asset_vehicles0'),
|
||||
}
|
||||
self._update(cr, uid, 'account.asset.asset', 'account_asset', vals, 'account_asset_asset_cab0')
|
||||
vals = {
|
||||
|
||||
@@ -98,7 +98,6 @@
|
||||
<group>
|
||||
<field name="category_id" on_change="onchange_category_id(category_id)"/>
|
||||
<field name="code"/>
|
||||
<field name="parent_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="purchase_date"/>
|
||||
@@ -179,7 +178,6 @@
|
||||
<record model="ir.ui.view" id="view_account_asset_asset_tree">
|
||||
<field name="name">account.asset.asset.tree</field>
|
||||
<field name="model">account.asset.asset</field>
|
||||
<field name="field_parent">child_ids</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Assets" colors="blue:(state == 'draft');grey:(state == 'close')">
|
||||
<field name="name"/>
|
||||
@@ -198,7 +196,6 @@
|
||||
<record model="ir.ui.view" id="view_account_asset_asset_hierarchy_tree">
|
||||
<field name="name">account.asset.asset.hierarchy</field>
|
||||
<field name="model">account.asset.asset</field>
|
||||
<field name="field_parent">child_ids</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Assets">
|
||||
<field name="name"/>
|
||||
@@ -277,7 +274,7 @@
|
||||
<field name="name">Asset Hierarchy</field>
|
||||
<field name="res_model">account.asset.asset</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field name="domain">[('parent_id','=',False)]</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="view_id" ref="view_account_asset_asset_hierarchy_tree"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
<field name="name">V6 Engine and 10 inches tires</field>
|
||||
<field eval="2800.0" name="purchase_value"/>
|
||||
<field name="category_id" ref="account_asset_category_fixedassets_test0"/>
|
||||
<field name="parent_id" ref="account_asset_asset_vehicles_test0"/>
|
||||
</record>
|
||||
|
||||
<record id="account_asset_asset_office_test0" model="account.asset.asset">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -334,18 +334,21 @@
|
||||
<field name="code">404</field>
|
||||
<field name="user_type" ref="account.data_account_type_receivable"/>
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field eval="True" name="reconcile"/>
|
||||
</record>
|
||||
<record id="a406" model="account.account.template">
|
||||
<field name="name">Acomptes versés</field>
|
||||
<field name="code">406</field>
|
||||
<field name="user_type" ref="account.data_account_type_receivable"/>
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field eval="True" name="reconcile"/>
|
||||
</record>
|
||||
<record id="a407" model="account.account.template">
|
||||
<field name="name">Créances douteuses</field>
|
||||
<field name="code">407</field>
|
||||
<field name="user_type" ref="account.data_account_type_receivable"/>
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field eval="True" name="reconcile"/>
|
||||
</record>
|
||||
<record id="a411059" model="account.account.template">
|
||||
<field name="name">T.V.A Déductible</field>
|
||||
@@ -510,18 +513,21 @@
|
||||
<field name="code">444</field>
|
||||
<field name="user_type" ref="account.data_account_type_payable"/>
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field eval="True" name="reconcile"/>
|
||||
</record>
|
||||
<record id="a446" model="account.account.template">
|
||||
<field name="name">Acomptes reçus</field>
|
||||
<field name="code">446</field>
|
||||
<field name="user_type" ref="account.data_account_type_payable"/>
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field eval="True" name="reconcile"/>
|
||||
</record>
|
||||
<record id="a448" model="account.account.template">
|
||||
<field name="name">Compensations fournisseurs</field>
|
||||
<field name="code">448</field>
|
||||
<field name="user_type" ref="account.data_account_type_payable"/>
|
||||
<field name="chart_template_id" ref="l10nbe_chart_template"/>
|
||||
<field eval="True" name="reconcile"/>
|
||||
</record>
|
||||
<record id="a4500" model="account.account.template">
|
||||
<field name="name">Dettes fiscales estimées</field>
|
||||
|
||||
@@ -228,6 +228,25 @@
|
||||
<field name="expense_currency_exchange_account_id" ref="exchange_fx_expense"/>
|
||||
</record>
|
||||
|
||||
<!-- Tax template for sale and purchase -->
|
||||
<record id="sale_tax_template" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="configurable_chart_template"/>
|
||||
<field name="name">Tax 15%</field>
|
||||
<field name="amount">15</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_id" ref="conf_iva"/>
|
||||
<field name="refund_account_id" ref="conf_iva"/>
|
||||
</record>
|
||||
|
||||
<record id="purchase_tax_template" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="configurable_chart_template"/>
|
||||
<field name="name">Purchase Tax 15%</field>
|
||||
<field name="amount">15</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_id" ref="conf_ova"/>
|
||||
<field name="refund_account_id" ref="conf_ova"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
<record id="otaxs" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="configurable_chart_template"/>
|
||||
|
||||
@@ -14,9 +14,9 @@ class TestPurchase(common.TransactionCase):
|
||||
|
||||
# Useful accounts
|
||||
user_type_id = self.ref('account.data_account_type_expenses')
|
||||
account_exp_id = self.env['account.account'].create({'code': 'X2020', 'name': 'Purchase - Test Expense Account', 'user_type': user_type_id})
|
||||
account_exp_id = self.env['account.account'].create({'code': 'X2020', 'name': 'Purchase - Test Expense Account', 'user_type': user_type_id, 'reconcile': True})
|
||||
user_type_id = self.ref('account.data_account_type_payable')
|
||||
account_pay_id = self.env['account.account'].create({'code': 'X1012', 'name': 'Purchase - Test Payable Account', 'user_type': user_type_id})
|
||||
account_pay_id = self.env['account.account'].create({'code': 'X1012', 'name': 'Purchase - Test Payable Account', 'user_type': user_type_id, 'reconcile': True})
|
||||
|
||||
self.env['product.product'].browse(product_id).product_tmpl_id.write({'property_account_expense': account_exp_id})
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
!python {model: sale.advance.payment.inv}: |
|
||||
ctx = context.copy()
|
||||
ctx.update({"active_model": 'sale.order', "active_ids": [ref("sale_order_8")], "active_id":ref("sale_order_8")})
|
||||
pay_id = self.create(cr, uid, {'advance_payment_method': 'fixed', 'amount': 5})
|
||||
pay_id = self.create(cr, uid, {'advance_payment_method': 'fixed', 'amount': 5, 'product_id': ref("sale_order_line_21")})
|
||||
self.create_invoices(cr, uid, [pay_id], context=ctx)
|
||||
invoice_ids = self.pool.get('sale.order').browse(cr, uid, ref("sale_order_8")).invoice_ids
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@ class TestSale(TestMail):
|
||||
|
||||
# Usefull accounts
|
||||
user_type_id = IrModelData.xmlid_to_res_id('account.data_account_type_revenue')
|
||||
account_rev_id = account_obj.create({'code': 'X2020', 'name': 'Sales - Test Sales Account', 'user_type': user_type_id})
|
||||
account_rev_id = account_obj.create({'code': 'X2020', 'name': 'Sales - Test Sales Account', 'user_type': user_type_id, 'reconcile': True})
|
||||
user_type_id = IrModelData.xmlid_to_res_id('account.data_account_type_receivable')
|
||||
account_recv_id = account_obj.create({'code': 'X1012', 'name': 'Sales - Test Reicv Account', 'user_type': user_type_id})
|
||||
account_recv_id = account_obj.create({'code': 'X1012', 'name': 'Sales - Test Reicv Account', 'user_type': user_type_id, 'reconcile': True})
|
||||
|
||||
# Add account to product
|
||||
product_template_id = self.env.ref('sale.advance_product_0').product_tmpl_id
|
||||
|
||||
@@ -31,9 +31,9 @@ class TestCreateInvoice(TransactionCase):
|
||||
self.env['account.journal'].create({'name': 'Purchase Journal - Test', 'code': 'DSTPJ', 'type': 'purchase', 'company_id': self.env.ref('base.main_company').id})
|
||||
|
||||
user_type_id = self.env.ref('account.data_account_type_payable')
|
||||
account_pay_id = self.env['account.account'].create({'code': 'X1012', 'name': 'Purchase - Test Payable Account', 'user_type': user_type_id.id})
|
||||
account_pay_id = self.env['account.account'].create({'code': 'X1012', 'name': 'Purchase - Test Payable Account', 'user_type': user_type_id.id, 'reconcile': True})
|
||||
user_type_id = self.env.ref('account.data_account_type_expenses')
|
||||
account_exp_id = self.env['account.account'].create({'code': 'X1013', 'name': 'Purchase - Test Expense Account', 'user_type': user_type_id.id})
|
||||
account_exp_id = self.env['account.account'].create({'code': 'X1013', 'name': 'Purchase - Test Expense Account', 'user_type': user_type_id.id, 'reconcile': True})
|
||||
|
||||
self.customer.write({'property_account_payable': account_pay_id.id})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user