Improvements in invoice supplier
Description of the sale_journal module bzr revid: fp@tinyerp.com-c0398aac7b242bc50c1424d79d4cee39d1d0c650
This commit is contained in:
parent
2302e4492c
commit
9f68a8b886
|
@ -126,29 +126,31 @@
|
|||
<form string="Supplier invoice">
|
||||
<notebook>
|
||||
<page string="Invoice">
|
||||
<field name="name" select="1"/>
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="type" select="1"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(type,partner_id)" select="1"/>
|
||||
<field name="address_invoice_id" domain="[('partner_id','=',partner_id)]"/>
|
||||
<field name="account_id" domain="[('type','<>','view'), ('company_id', '=', company_id),('journal_id','=',journal_id)]" />
|
||||
<field name="date_due" select="1"/>
|
||||
|
||||
<field name="journal_id" select="1"/>
|
||||
<field name="number" select="1"/>
|
||||
|
||||
<field name="check_total"/>
|
||||
<field name="currency_id" on_change="onchange_currency_id(currency_id)" select="1"/>
|
||||
|
||||
<field name="name" select="1"/>
|
||||
<field name="number" select="1"/>
|
||||
|
||||
<field name="invoice_line" nolabel="1" colspan="4">
|
||||
<tree string="Invoice lines" editable="bottom">
|
||||
<field name="name"/>
|
||||
|
||||
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id)"/>
|
||||
<field name="account_id" on_change="onchange_account_id(parent.partner_id,account_id)" domain="[('company_id', '=', parent.company_id),('journal_id','=',parent.journal_id)]"/>
|
||||
<field name="invoice_line_tax_id"/>
|
||||
<field name="invoice_line_tax_id" view_mode="2"/>
|
||||
<field name="account_analytic_id" domain="[('type','<>','view'), ('company_id', '=', parent.company_id)]" />
|
||||
<field name="quantity"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="price_unit"/> <!-- Removed if subtotal is set -->
|
||||
<field name="price_subtotal"/>
|
||||
<field name="name"/>
|
||||
<field name="uos_id" invisible="True"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group col="2" colspan="2">
|
||||
|
@ -165,8 +167,8 @@
|
|||
</group>
|
||||
<group col="4" colspan="2">
|
||||
<field name="amount_untaxed"/>
|
||||
<field name="amount_total"/>
|
||||
<field name="amount_tax"/>
|
||||
<field name="amount_total"/>
|
||||
<button name="button_compute" string="Compute taxes" states="draft" type="object" colspan="2"/>
|
||||
<field name="state" select="1" colspan="3"/>
|
||||
<newline/>
|
||||
|
@ -282,7 +284,7 @@
|
|||
<menuitem name="Financial Management/Invoices/Customers Invoices" id="menu_action_invoice_tree1" action="action_invoice_tree1"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_invoice_tree2">
|
||||
<field name="name">account.invoice</field>
|
||||
<field name="name">account.invoice.supplier</field>
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
|
|
|
@ -83,7 +83,7 @@ class account_invoice(osv.osv):
|
|||
_description = 'Invoice'
|
||||
_order = "number"
|
||||
_columns = {
|
||||
'name': fields.char('Invoice Description', size=64, required=True, select=True,readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'name': fields.char('Description', size=64, select=True,readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'origin': fields.char('Origin', size=64),
|
||||
'type': fields.selection([
|
||||
('out_invoice','Customer Invoice'),
|
||||
|
@ -104,7 +104,6 @@ class account_invoice(osv.osv):
|
|||
('cancel','Canceled')
|
||||
],'State', select=True, readonly=True),
|
||||
|
||||
'check_total': fields.float('Total', digits=(16,2)),
|
||||
'date_invoice': fields.date('Date Invoiced', required=True, states={'open':[('readonly',True)],'close':[('readonly',True)]}),
|
||||
'date_due': fields.date('Due Date', states={'open':[('readonly',True)],'close':[('readonly',True)]}),
|
||||
|
||||
|
@ -131,6 +130,8 @@ class account_invoice(osv.osv):
|
|||
'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True, relate=True,readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
|
||||
'check_total': fields.float('Total', digits=(16,2)),
|
||||
}
|
||||
_defaults = {
|
||||
'type': lambda *a: 'out_invoice',
|
||||
|
@ -262,7 +263,6 @@ class account_invoice(osv.osv):
|
|||
for inv in self.browse(cr, uid, ids):
|
||||
if inv.move_id:
|
||||
continue
|
||||
print inv.check_amount, inv.amount_total
|
||||
if inv.check_total <> inv.amount_total:
|
||||
raise osv.except_osv('Bad total !', 'Please verify the price of the invoice !\nThe real total does not match the computed total.')
|
||||
|
||||
|
@ -315,7 +315,7 @@ class account_invoice(osv.osv):
|
|||
total_currency -= i['amount_currency'] or i['price']
|
||||
acc_id = inv.account_id.id
|
||||
|
||||
name = inv['name']
|
||||
name = inv['name'] or '/'
|
||||
if inv.payment_term:
|
||||
totlines = self.pool.get('account.payment.term').compute(cr, uid, inv.payment_term.id, total)
|
||||
res_amount_currency = total_currency
|
||||
|
@ -727,9 +727,3 @@ class account_invoice_tax(osv.osv):
|
|||
return res
|
||||
account_invoice_tax()
|
||||
|
||||
class account_invoice_supplier(osv.osv):
|
||||
_inherit = 'account.invoice'
|
||||
_columns = {
|
||||
}
|
||||
account_invoice_supplier()
|
||||
|
||||
|
|
|
@ -11,6 +11,29 @@
|
|||
"demo_xml" : ['sale_journal_demo.xml'],
|
||||
"init_xml" : ['sale_journal_data.xml'],
|
||||
"update_xml" : ["sale_journal_view.xml","picking_journal_view.xml","picking_journal_view_report.xml"],
|
||||
"description" : """
|
||||
The sale journal modules allows you to categorize your
|
||||
sales and deliveries (pickings) between different journals.
|
||||
This module is very helpfull for bigger companies that
|
||||
works by departments.
|
||||
|
||||
You can use journal for different purposes, some examples:
|
||||
* isolate sales of different departments
|
||||
* journals for deliveries by truck or by UPS
|
||||
|
||||
Journals have a responsible and evolves between different status:
|
||||
* draft, open, cancel, done.
|
||||
|
||||
Batch operations can be processed on the different journals to
|
||||
confirm all sales at once, to validate or invoice pickings, ...
|
||||
|
||||
It also supports batch invoicing methods that can be configured by
|
||||
partners and sales orders, examples:
|
||||
* daily invoicing,
|
||||
* monthly invoicing, ...
|
||||
|
||||
Some statistics by journals are provided.
|
||||
"""
|
||||
"active": False,
|
||||
"installable": True
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue