[IMP] Account : changed terms as suggested in account module
bzr revid: rpr@tinyerp.com-20121219065645-1cffyp8i4lqi083o
This commit is contained in:
parent
56248183fc
commit
c9f803ff74
|
@ -56,9 +56,9 @@ def check_cycle(self, cr, uid, ids, context=None):
|
||||||
|
|
||||||
class account_payment_term(osv.osv):
|
class account_payment_term(osv.osv):
|
||||||
_name = "account.payment.term"
|
_name = "account.payment.term"
|
||||||
_description = "Payment Term"
|
_description = "Payment Terms"
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Payment Term', size=64, translate=True, required=True),
|
'name': fields.char('Payment Terms', size=64, translate=True, required=True),
|
||||||
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the payment term without removing it."),
|
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the payment term without removing it."),
|
||||||
'note': fields.text('Description', translate=True),
|
'note': fields.text('Description', translate=True),
|
||||||
'line_ids': fields.one2many('account.payment.term.line', 'payment_id', 'Terms'),
|
'line_ids': fields.one2many('account.payment.term.line', 'payment_id', 'Terms'),
|
||||||
|
@ -101,7 +101,7 @@ class account_payment_term(osv.osv):
|
||||||
|
|
||||||
class account_payment_term_line(osv.osv):
|
class account_payment_term_line(osv.osv):
|
||||||
_name = "account.payment.term.line"
|
_name = "account.payment.term.line"
|
||||||
_description = "Payment Term Line"
|
_description = "Payment Terms Line"
|
||||||
_columns = {
|
_columns = {
|
||||||
'value': fields.selection([('procent', 'Percent'),
|
'value': fields.selection([('procent', 'Percent'),
|
||||||
('balance', 'Balance'),
|
('balance', 'Balance'),
|
||||||
|
@ -112,7 +112,7 @@ class account_payment_term_line(osv.osv):
|
||||||
'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \
|
'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \
|
||||||
"If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."),
|
"If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."),
|
||||||
'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."),
|
'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."),
|
||||||
'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True, ondelete='cascade'),
|
'payment_id': fields.many2one('account.payment.term', 'Payment Terms', required=True, select=True, ondelete='cascade'),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'value': 'balance',
|
'value': 'balance',
|
||||||
|
@ -128,7 +128,7 @@ class account_payment_term_line(osv.osv):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
_constraints = [
|
_constraints = [
|
||||||
(_check_percent, 'Percentages for Payment Term Line must be between 0 and 1, Example: 0.02 for 2%.', ['value_amount']),
|
(_check_percent, 'Percentages for Payment Terms Line must be between 0 and 1, Example: 0.02 for 2%.', ['value_amount']),
|
||||||
]
|
]
|
||||||
|
|
||||||
account_payment_term_line()
|
account_payment_term_line()
|
||||||
|
|
|
@ -222,7 +222,7 @@ class account_invoice(osv.osv):
|
||||||
help="If you use payment terms, the due date will be computed automatically at the generation "\
|
help="If you use payment terms, the due date will be computed automatically at the generation "\
|
||||||
"of accounting entries. The payment term may compute several due dates, for example 50% now and 50% in one month, but if you want to force a due date, make sure that the payment term is not set on the invoice. If you keep the payment term and the due date empty, it means direct payment."),
|
"of accounting entries. The payment term may compute several due dates, for example 50% now and 50% in one month, but if you want to force a due date, make sure that the payment term is not set on the invoice. If you keep the payment term and the due date empty, it means direct payment."),
|
||||||
'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}),
|
'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}),
|
||||||
'payment_term': fields.many2one('account.payment.term', 'Payment Term',readonly=True, states={'draft':[('readonly',False)]},
|
'payment_term': fields.many2one('account.payment.term', 'Payment Terms',readonly=True, states={'draft':[('readonly',False)]},
|
||||||
help="If you use payment terms, the due date will be computed automatically at the generation "\
|
help="If you use payment terms, the due date will be computed automatically at the generation "\
|
||||||
"of accounting entries. If you keep the payment term and the due date empty, it means direct payment. "\
|
"of accounting entries. If you keep the payment term and the due date empty, it means direct payment. "\
|
||||||
"The payment term may compute several due dates, for example 50% now, 50% in one month."),
|
"The payment term may compute several due dates, for example 50% now, 50% in one month."),
|
||||||
|
@ -233,7 +233,7 @@ class account_invoice(osv.osv):
|
||||||
'tax_line': fields.one2many('account.invoice.tax', 'invoice_id', 'Tax Lines', readonly=True, states={'draft':[('readonly',False)]}),
|
'tax_line': fields.one2many('account.invoice.tax', 'invoice_id', 'Tax Lines', readonly=True, states={'draft':[('readonly',False)]}),
|
||||||
|
|
||||||
'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, ondelete='restrict', help="Link to the automatically generated Journal Items."),
|
'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, ondelete='restrict', help="Link to the automatically generated Journal Items."),
|
||||||
'amount_untaxed': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Untaxed',
|
'amount_untaxed': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Subtotal',
|
||||||
store={
|
store={
|
||||||
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),
|
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),
|
||||||
'account.invoice.tax': (_get_invoice_tax, None, 20),
|
'account.invoice.tax': (_get_invoice_tax, None, 20),
|
||||||
|
@ -1415,7 +1415,7 @@ class account_invoice_line(osv.osv):
|
||||||
'product_id': fields.many2one('product.product', 'Product', ondelete='set null', select=True),
|
'product_id': fields.many2one('product.product', 'Product', ondelete='set null', select=True),
|
||||||
'account_id': fields.many2one('account.account', 'Account', required=True, domain=[('type','<>','view'), ('type', '<>', 'closed')], help="The income or expense account related to the selected product."),
|
'account_id': fields.many2one('account.account', 'Account', required=True, domain=[('type','<>','view'), ('type', '<>', 'closed')], help="The income or expense account related to the selected product."),
|
||||||
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price')),
|
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price')),
|
||||||
'price_subtotal': fields.function(_amount_line, string='Subtotal', type="float",
|
'price_subtotal': fields.function(_amount_line, string='Amount', type="float",
|
||||||
digits_compute= dp.get_precision('Account'), store=True),
|
digits_compute= dp.get_precision('Account'), store=True),
|
||||||
'quantity': fields.float('Quantity', digits_compute= dp.get_precision('Product Unit of Measure'), required=True),
|
'quantity': fields.float('Quantity', digits_compute= dp.get_precision('Product Unit of Measure'), required=True),
|
||||||
'discount': fields.float('Discount (%)', digits_compute= dp.get_precision('Discount')),
|
'discount': fields.float('Discount (%)', digits_compute= dp.get_precision('Discount')),
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<menuitem id="menu_finance_payables" name="Suppliers" parent="menu_finance" sequence="3"/>
|
<menuitem id="menu_finance_payables" name="Suppliers" parent="menu_finance" sequence="3"/>
|
||||||
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="4"
|
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="4"
|
||||||
groups="group_account_user,group_account_manager"/>
|
groups="group_account_user,group_account_manager"/>
|
||||||
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="menu_finance" sequence="13" groups="group_account_user,group_account_manager"/>
|
<menuitem id="menu_finance_periodical_processing" name="Periodic Processing" parent="menu_finance" sequence="13" groups="group_account_user,group_account_manager"/>
|
||||||
<!-- This menu is used in account_code module -->
|
<!-- This menu is used in account_code module -->
|
||||||
<menuitem id="menu_account_pp_statements" name="Statements" parent="menu_finance_periodical_processing" sequence="12"/>
|
<menuitem id="menu_account_pp_statements" name="Statements" parent="menu_finance_periodical_processing" sequence="12"/>
|
||||||
<menuitem id="periodical_processing_journal_entries_validation" name="Draft Entries" parent="menu_finance_periodical_processing"/>
|
<menuitem id="periodical_processing_journal_entries_validation" name="Draft Entries" parent="menu_finance_periodical_processing"/>
|
||||||
|
|
|
@ -1548,7 +1548,7 @@
|
||||||
<field name="name">account.payment.term.line.tree</field>
|
<field name="name">account.payment.term.line.tree</field>
|
||||||
<field name="model">account.payment.term.line</field>
|
<field name="model">account.payment.term.line</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Payment Term">
|
<tree string="Payment Terms">
|
||||||
<field name="value"/>
|
<field name="value"/>
|
||||||
<field name="value_amount" attrs="{'readonly':[('value','=','balance')]}"/>
|
<field name="value_amount" attrs="{'readonly':[('value','=','balance')]}"/>
|
||||||
<field name="days"/>
|
<field name="days"/>
|
||||||
|
@ -1560,7 +1560,7 @@
|
||||||
<field name="name">account.payment.term.line.form</field>
|
<field name="name">account.payment.term.line.form</field>
|
||||||
<field name="model">account.payment.term.line</field>
|
<field name="model">account.payment.term.line</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Payment Term" version="7.0">
|
<form string="Payment Terms" version="7.0">
|
||||||
<group>
|
<group>
|
||||||
<group string="Amount Computation">
|
<group string="Amount Computation">
|
||||||
<field name="value"/>
|
<field name="value"/>
|
||||||
|
@ -1582,8 +1582,8 @@
|
||||||
<field name="name">account.payment.term.search</field>
|
<field name="name">account.payment.term.search</field>
|
||||||
<field name="model">account.payment.term</field>
|
<field name="model">account.payment.term</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="Payment Term">
|
<search string="Payment Terms">
|
||||||
<field name="name" string="Payment Term"/>
|
<field name="name" string="Payment Terms"/>
|
||||||
<field name="active"/>
|
<field name="active"/>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
|
@ -1592,7 +1592,7 @@
|
||||||
<field name="name">account.payment.term.form</field>
|
<field name="name">account.payment.term.form</field>
|
||||||
<field name="model">account.payment.term</field>
|
<field name="model">account.payment.term</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Payment Term" version="7.0">
|
<form string="Payment Terms" version="7.0">
|
||||||
<group col="4">
|
<group col="4">
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="active"/>
|
<field name="active"/>
|
||||||
|
@ -2296,17 +2296,17 @@
|
||||||
<tree string="Opening Cashbox Lines" editable="bottom">
|
<tree string="Opening Cashbox Lines" editable="bottom">
|
||||||
<field name="pieces"/>
|
<field name="pieces"/>
|
||||||
<field name="number_opening" string="Opening Unit Numbers" on_change="on_change_sub_opening(pieces, number_opening, parent.balance_end)"/>
|
<field name="number_opening" string="Opening Unit Numbers" on_change="on_change_sub_opening(pieces, number_opening, parent.balance_end)"/>
|
||||||
<field name="subtotal_opening" string="Opening Subtotal"/>
|
<field name="subtotal_opening" string="Opening Amount"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
<field name="closing_details_ids" nolabel="1" colspan="4" attrs="{'invisible' : [('state', '=', 'draft')]}">
|
<field name="closing_details_ids" nolabel="1" colspan="4" attrs="{'invisible' : [('state', '=', 'draft')]}">
|
||||||
<tree string="Closing Cashbox Lines" editable="bottom">
|
<tree string="Closing Cashbox Lines" editable="bottom">
|
||||||
<field name="pieces" readonly="1" />
|
<field name="pieces" readonly="1" />
|
||||||
<field name="number_opening" string="Opening Unit Numbers" readonly="1" />
|
<field name="number_opening" string="Opening Unit Numbers" readonly="1" />
|
||||||
<field name="subtotal_opening" string="Opening Subtotal" readonly="1" />
|
<field name="subtotal_opening" string="Opening Amount" readonly="1" />
|
||||||
|
|
||||||
<field name="number_closing" string="Closing Unit Numbers" on_change="on_change_sub_closing(pieces, number_closing, parent.balance_end)"/>
|
<field name="number_closing" string="Closing Unit Numbers" on_change="on_change_sub_closing(pieces, number_closing, parent.balance_end)"/>
|
||||||
<field name="subtotal_closing" string="Closing Subtotal"/>
|
<field name="subtotal_closing" string="Closing Amount"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record forcecreate="True" id="decimal_payment" model="decimal.precision">
|
<record forcecreate="True" id="decimal_payment" model="decimal.precision">
|
||||||
<field name="name">Payment Term</field>
|
<field name="name">Payment Terms</field>
|
||||||
<field name="digits">6</field>
|
<field name="digits">6</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
<field name="company_id" ref="base.main_company"/>
|
<field name="company_id" ref="base.main_company"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- Payment Term -->
|
<!-- Payment Terms -->
|
||||||
|
|
||||||
<record id="account_payment_term" model="account.payment.term">
|
<record id="account_payment_term" model="account.payment.term">
|
||||||
<field name="name">30 Days End of Month</field>
|
<field name="name">30 Days End of Month</field>
|
||||||
|
|
|
@ -221,14 +221,14 @@ class res_partner(osv.osv):
|
||||||
'account.payment.term',
|
'account.payment.term',
|
||||||
type='many2one',
|
type='many2one',
|
||||||
relation='account.payment.term',
|
relation='account.payment.term',
|
||||||
string ='Customer Payment Term',
|
string ='Customer Payment Terms',
|
||||||
view_load=True,
|
view_load=True,
|
||||||
help="This payment term will be used instead of the default one for sale orders and customer invoices"),
|
help="This payment term will be used instead of the default one for sale orders and customer invoices"),
|
||||||
'property_supplier_payment_term': fields.property(
|
'property_supplier_payment_term': fields.property(
|
||||||
'account.payment.term',
|
'account.payment.term',
|
||||||
type='many2one',
|
type='many2one',
|
||||||
relation='account.payment.term',
|
relation='account.payment.term',
|
||||||
string ='Supplier Payment Term',
|
string ='Supplier Payment Terms',
|
||||||
view_load=True,
|
view_load=True,
|
||||||
help="This payment term will be used instead of the default one for purchase orders and supplier invoices"),
|
help="This payment term will be used instead of the default one for purchase orders and supplier invoices"),
|
||||||
'ref_companies': fields.one2many('res.company', 'partner_id',
|
'ref_companies': fields.one2many('res.company', 'partner_id',
|
||||||
|
|
|
@ -63,7 +63,7 @@ class account_invoice_report(osv.osv):
|
||||||
'product_id': fields.many2one('product.product', 'Product', readonly=True),
|
'product_id': fields.many2one('product.product', 'Product', readonly=True),
|
||||||
'product_qty':fields.float('Qty', readonly=True),
|
'product_qty':fields.float('Qty', readonly=True),
|
||||||
'uom_name': fields.char('Reference Unit of Measure', size=128, readonly=True),
|
'uom_name': fields.char('Reference Unit of Measure', size=128, readonly=True),
|
||||||
'payment_term': fields.many2one('account.payment.term', 'Payment Term', readonly=True),
|
'payment_term': fields.many2one('account.payment.term', 'Payment Terms', readonly=True),
|
||||||
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], readonly=True),
|
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], readonly=True),
|
||||||
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True),
|
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True),
|
||||||
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
|
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
|
||||||
|
|
|
@ -164,7 +164,7 @@ class report_invoice_created(osv.osv):
|
||||||
],'Type', readonly=True),
|
],'Type', readonly=True),
|
||||||
'number': fields.char('Invoice Number', size=32, readonly=True),
|
'number': fields.char('Invoice Number', size=32, readonly=True),
|
||||||
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
|
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
|
||||||
'amount_untaxed': fields.float('Untaxed', readonly=True),
|
'amount_untaxed': fields.float('Subtotal', readonly=True),
|
||||||
'amount_total': fields.float('Total', readonly=True),
|
'amount_total': fields.float('Total', readonly=True),
|
||||||
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
|
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
|
||||||
'date_invoice': fields.date('Invoice Date', readonly=True),
|
'date_invoice': fields.date('Invoice Date', readonly=True),
|
||||||
|
|
Loading…
Reference in New Issue