[MERGE] Merge with lp:openobect-addons

bzr revid: sbh@tinyerp.com-20100708105531-5tiavwywh5an1a0y
This commit is contained in:
sbh (Open ERP)
2010-07-08 16:25:31 +05:30
486 changed files with 10475 additions and 8789 deletions
+1 -2
View File
@@ -21,7 +21,6 @@
{
"name" : "Accounting and Financial Management",
"version" : "1.1",
"depends" : ["product", "analytic", "process","board"],
"author" : "Tiny",
"category": 'Generic Modules/Accounting',
"description": """Financial and accounting module that covers:
@@ -42,6 +41,7 @@ The processes like maintaining of general ledger is done through the defined fin
grouping is maintained through journal) for a particular financial year and for preparation of vouchers there is a
module named account_vouchers
""",
"depends" : ["product", "analytic", "process","board"],
'website': 'http://www.openerp.com',
'init_xml': [],
'update_xml': [
@@ -119,7 +119,6 @@ module named account_vouchers
"wizard/account_bs_report_view.xml"
],
'demo_xml': [
#'demo/price_accuracy00.yml',
'account_demo.xml',
'project/project_demo.xml',
'project/analytic_account_demo.xml',
+51 -44
View File
@@ -136,7 +136,6 @@ class account_account_type(osv.osv):
'name': fields.char('Acc. Type Name', size=64, required=True, translate=True),
'code': fields.char('Code', size=32, required=True),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of account types."),
'partner_account': fields.boolean('Partner account'),
'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True),
'sign': fields.selection([(-1, 'Negative'), (1, 'Positive')], 'Sign on Reports', required=True, help='Allows you to change the sign of the balance amount displayed in the reports, so that you can see positive figures instead of negative ones in expenses accounts.'),
'report_type':fields.selection([
@@ -366,11 +365,11 @@ class account_account(osv.osv):
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."),
'code': fields.char('Code', size=64, required=True),
'type': fields.selection([
('view', 'View'),
('other', 'Regular'),
('receivable', 'Receivable'),
('payable', 'Payable'),
('view', 'View'),
('consolidation', 'Consolidation'),
('other', 'Others'),
('closed', 'Closed'),
], 'Internal Type', required=True, help="This type is used to differentiate types with "\
"special effects in Open ERP: view can not have entries, consolidation are accounts that "\
@@ -1143,7 +1142,7 @@ class account_move(osv.osv):
return amount
def _centralise(self, cr, uid, move, mode, context=None):
assert(mode in ('debit', 'credit'), 'Invalid Mode') #to prevent sql injection
assert mode in ('debit', 'credit'), 'Invalid Mode' #to prevent sql injection
if context is None:
context = {}
@@ -1199,12 +1198,15 @@ class account_move(osv.osv):
#
# Validate a balanced move. If it is a centralised journal, create a move.
#
def validate(self, cr, uid, ids, context={}):
if context and ('__last_update' in context):
del context['__last_update']
ok = True
valid_moves = [] #Maintains a list of moves which can be responsible to create analytic entries
for move in self.browse(cr, uid, ids, context):
#unlink analytic lines on move_lines
# Unlink old analytic lines on move_lines
for obj_line in move.line_id:
for obj in obj_line.analytic_lines:
self.pool.get('account.analytic.line').unlink(cr,uid,obj.id)
@@ -1213,7 +1215,7 @@ class account_move(osv.osv):
amount = 0
line_ids = []
line_draft_ids = []
company_id=None
company_id = None
for line in move.line_id:
amount += line.debit - line.credit
line_ids.append(line.id)
@@ -1229,52 +1231,60 @@ class account_move(osv.osv):
if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id or line.currency_id):
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name)))
# Check that the move balances, the tolerance for debit/credit must
# be smaller than the smallest value according to price accuracy
# (hence the +1 below)
# Example:
# difference == 0.01 is OK iff price_accuracy <= 1!
# difference == 0.0001 is OK iff price_accuracy <= 3!
if abs(amount) < 10 ** -(int(config['price_accuracy'])+1):
if abs(amount) < 10 ** -4:
# If the move is balanced
# Add to the list of valid moves
# (analytic lines will be created later for valid moves)
valid_moves.append(move)
# Check whether the move lines are confirmed
if not len(line_draft_ids):
continue
# Update the move lines (set them as valid)
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {
'journal_id': move.journal_id.id,
'period_id': move.period_id.id,
'state': 'valid'
}, context, check=False)
todo = []
account = {}
account2 = {}
if journal.type not in ('purchase','sale'):
continue
if journal.type in ('purchase','sale'):
for line in move.line_id:
code = amount = 0
key = (line.account_id.id, line.tax_code_id.id)
if key in account2:
code = account2[key][0]
amount = account2[key][1] * (line.debit + line.credit)
elif line.account_id.id in account:
code = account[line.account_id.id][0]
amount = account[line.account_id.id][1] * (line.debit + line.credit)
if (code or amount) and not (line.tax_code_id or line.tax_amount):
self.pool.get('account.move.line').write(cr, uid, [line.id], {
'tax_code_id': code,
'tax_amount': amount
}, context, check=False)
elif journal.centralisation:
# If the move is not balanced, it must be centralised...
# Add to the list of valid moves
# (analytic lines will be created later for valid moves)
valid_moves.append(move)
for line in move.line_id:
code = amount = 0
key = (line.account_id.id, line.tax_code_id.id)
if key in account2:
code = account2[key][0]
amount = account2[key][1] * (line.debit + line.credit)
elif line.account_id.id in account:
code = account[line.account_id.id][0]
amount = account[line.account_id.id][1] * (line.debit + line.credit)
if (code or amount) and not (line.tax_code_id or line.tax_amount):
self.pool.get('account.move.line').write(cr, uid, [line.id], {
'tax_code_id': code,
'tax_amount': amount
}, context, check=False)
#
# Compute VAT
# Update the move lines (set them as valid)
#
continue
if journal.centralisation:
self._centralise(cr, uid, move, 'debit', context=context)
self._centralise(cr, uid, move, 'credit', context=context)
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {
'state': 'valid'
}, context, check=False)
continue
else:
# We can't validate it (it's unbalanced)
# Setting the lines as draft
self.pool.get('account.move.line').write(cr, uid, line_ids, {
'journal_id': move.journal_id.id,
'period_id': move.period_id.id,
@@ -1282,13 +1292,12 @@ class account_move(osv.osv):
#'tax_amount': False,
'state': 'draft'
}, context, check=False)
ok = False
if ok:
list_ids = []
for tmp in move.line_id:
list_ids.append(tmp.id)
self.pool.get('account.move.line').create_analytic_lines(cr, uid, list_ids, context)
return ok
# Create analytic lines for the valid moves
for record in valid_moves:
self.pool.get('account.move.line').create_analytic_lines(cr, uid, [line.id for line in record.line_id], context)
return len(valid_moves) > 0
account_move()
class account_move_reconcile(osv.osv):
@@ -2056,7 +2065,6 @@ class account_add_tmpl_wizard(osv.osv_memory):
def _get_def_cparent(self, cr, uid, context):
acc_obj=self.pool.get('account.account')
tmpl_obj=self.pool.get('account.account.template')
#print "Searching for ",context
tids=tmpl_obj.read(cr, uid, [context['tmpl_ids']], ['parent_id'])
if not tids or not tids[0]['parent_id']:
return False
@@ -2098,7 +2106,6 @@ class account_add_tmpl_wizard(osv.osv_memory):
# 'tax_ids': [(6,0,tax_ids)], todo!!
'company_id': company_id,
}
# print "Creating:", vals
new_account = acc_obj.create(cr, uid, vals)
return {'type':'state', 'state': 'end' }
+1 -1
View File
@@ -205,7 +205,7 @@
<button name="invoice_open" states="draft,proforma2" string="Validate" icon="terp-camera_test"/>
<button name="%(action_account_invoice_pay)d" type='action' string='Pay Invoice' states='open' icon="gtk-ok"/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="terp-gtk-stop"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="stock_effects-object-colorize"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
<button name="%(action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert"/>
<button name="%(action_account_invoice_refund)d" type='action' string='Credit Note' states='paid' icon="terp-dolar"/>
</group>
+47 -65
View File
@@ -3,8 +3,8 @@
<data>
<!--
Fiscal Year
-->
Fiscal Year
-->
<record id="view_account_fiscalyear_form" model="ir.ui.view">
<field name="name">account.fiscalyear.form</field>
@@ -12,7 +12,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Fiscalyear">
<group>
<group>
<field name="name"/>
<field name="code"/>
<field name="date_start"/>
@@ -32,7 +32,7 @@
</field>
<separator colspan="4" string="States"/>
<group>
<field name="state" select="1" readonly="1"/>
<field name="state" select="1" readonly="1"/>
<button name="create_period" states="draft" string="Create Monthly Periods" type="object" icon="gtk-dnd"/>
<button name="create_period3" states="draft" string="Create 3 Months Periods" type="object" icon="gtk-dnd"/>
</group>
@@ -57,17 +57,17 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Fiscalyear">
<group>
<filter string="Done" domain="[('state','=','done')]" icon="terp-dolar_ok!"/>
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
<field name="state"/>
<group>
<filter string="Done" domain="[('state','=','done')]" icon="terp-dolar_ok!"/>
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
<field name="state"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
</group>
</search>
</field>
@@ -133,9 +133,8 @@
<!--
Accounts
-->
Accounts
-->
<record id="view_account_form" model="ir.ui.view">
<field name="name">account.account.form</field>
<field name="model">account.account</field>
@@ -143,21 +142,21 @@
<field name="arch" type="xml">
<form string="Account">
<group col="6" colspan="4">
<field name="name" select="1" colspan="4"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="parent_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="parent_id"/>
<field name="type" select="1"/>
<field name="user_type" select="1"/>
</group>
<notebook colspan="4">
<page string="General Information">
<newline/>
<field name="currency_id"/>
<field name="active"/>
<field name="currency_mode"/>
<field name="reconcile"/>
<field name="active"/>
<field name="check_history"/>
<field name="type" select="1"/>
<newline/>
<separator string="Default Taxes" colspan="4"/>
<field colspan="4" name="tax_ids" nolabel="1" domain="[('parent_id','=',False)]"/>
@@ -178,21 +177,21 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Accounts">
<group col="10" colspan="4">
<group col="10" colspan="4">
<filter icon="terp-sale" string="Receivable Accounts" domain="[('type','=','receivable')]"/>
<filter icon="terp-purchase" string="Purchase Accounts" domain="[('type','=','purchase')]"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
<field name="user_type"/>
<field name="type"/>
<field name="code"/>
<field name="name"/>
<field name="user_type"/>
<field name="type"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Parent Account" icon="terp-folder-orange" domain="" context="{'group_by':'parent_id'}"/>
<separator orientation="vertical"/>
<filter string="User Type" icon="terp-folder-blue" domain="" context="{'group_by':'user_type'}"/>
<filter string="Internal Type" icon="terp-folder-yellow" domain="" context="{'group_by':'type'}"/>
<filter string="Parent Account" icon="terp-folder-orange" domain="" context="{'group_by':'parent_id'}"/>
<separator orientation="vertical"/>
<filter string="User Type" icon="terp-folder-blue" domain="" context="{'group_by':'user_type'}"/>
<filter string="Internal Type" icon="terp-folder-yellow" domain="" context="{'group_by':'type'}"/>
</group>
</search>
</field>
@@ -308,11 +307,11 @@
<field name="type">search</field>
<field name="arch" type="xml">
<tree string="Search Account Journal">
<group>
<filter domain="[('type', '=', 'sale')]" string="Sale Journals" icon="terp-sale"/>
<filter domain="[('type', '=', 'purchase')]" string="Purchase Journals" icon="terp-purchase"/>
<filter domain="[('centralisation', '=', 'True')]" string="Centralized Journals" icon="terp-stock"/>
<separator orientation="vertical"/>
<group>
<filter domain="[('type', '=', 'sale')]" string="Sale Journals" icon="terp-sale"/>
<filter domain="[('type', '=', 'purchase')]" string="Purchase Journals" icon="terp-purchase"/>
<filter domain="[('centralisation', '=', 'True')]" string="Centralized Journals" icon="terp-stock"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
</group>
@@ -376,7 +375,7 @@
<separator string="Other Configuration" colspan="4"/>
<field name="centralisation" groups="base.group_extended"/>
<field name="entry_posted"/>
<field name="update_posted"/>
<!-- <field name="update_posted"/> -->
</group>
</group>
</page>
@@ -443,19 +442,19 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Bank Statements">
<group>
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<filter string="Confirm" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
<separator orientation="vertical"/>
<field name="date"/>
<field name="name"/>
<field name="journal_id"/>
<group>
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<filter string="Confirm" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
<separator orientation="vertical"/>
<field name="date"/>
<field name="name"/>
<field name="journal_id"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Journal" context="{'group_by': 'journal_id'}" icon="terp-folder-orange"/>
<filter string="Period" context="{'group_by': 'period_id'}" icon="terp-go-month"/>
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
<filter string="Journal" context="{'group_by': 'journal_id'}" icon="terp-folder-orange"/>
<filter string="Period" context="{'group_by': 'period_id'}" icon="terp-go-month"/>
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
</group>
</search>
</field>
@@ -596,11 +595,10 @@
<field name="arch" type="xml">
<form string="Account Type">
<group col="6" colspan="4">
<field name="name" select="1" colspan="4"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="sequence"/>
<field name="parent_id"/>
<field name="partner_account"/>
</group>
<group col="2" colspan="2">
<separator string="Reporting Configuration" colspan="4"/>
@@ -1196,7 +1194,7 @@
<!-- <menuitem id="next_id_29" name="Search Entries" parent="account.menu_finance_entries" sequence="40"/>-->
<!-- <menuitem action="action_move_line_form" id="menu_action_move_line_form" parent="next_id_29"/>-->
<record id="action_move_line_form_encode_by_move" model="ir.actions.act_window">
<!-- <record id="action_move_line_form_encode_by_move" model="ir.actions.act_window">
<field name="name">Journal Entries</field>
<field name="res_model">account.move</field>
<field name="view_type">form</field>
@@ -1205,7 +1203,7 @@
<field name="search_view_id" ref="view_account_move_filter"/>
</record>
<menuitem action="action_move_line_form_encode_by_move" id="menu_encode_entries_by_move" parent="menu_finance_entries"/>
<menuitem action="action_move_line_form_encode_by_move" id="menu_encode_entries_by_move" parent="menu_finance_entries"/>-->
<record id="action_account_moves_sale" model="ir.actions.act_window">
<field name="name">Journal Items</field>
@@ -2239,22 +2237,6 @@
id="menu_action_account_fiscal_position_form_template"
parent="account_template_folder" sequence="20"/>
<record id="action_move_journal_line" model="ir.actions.act_window">
<field name="name">Journal Entries</field>
<field name="res_model">account.move</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_move_tree"/>
<field name="search_view_id" ref="view_account_move_filter"/>
</record>
<menuitem
icon="STOCK_JUSTIFY_FILL"
action="action_move_journal_line"
id="menu_action_move_journal_line_form"
parent="account.menu_finance_entries"
sequence="5"/>
<record id="action_account_moves_all" model="ir.actions.act_window">
<field name="name">Journal Items</field>
<field name="res_model">account.move.line</field>
+3 -5
View File
@@ -48,10 +48,8 @@
<field name="usage">menu</field>
<field name="view_id" ref="board_account_form"/>
</record>
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem id="next_id_68" name="Accounting" parent="base.dashboard"
groups="account.group_account_manager"/>
<menuitem action="open_board_account" icon="terp-graph" id="menu_board_account" parent="next_id_68" sequence="1"/>
<menuitem icon="terp-graph" id="menu_dashboard_acc" name="Dashboard" sequence="2" parent="account.menu_finance_reporting"/>
<menuitem action="open_board_account" icon="terp-graph" id="menu_board_account" parent="menu_dashboard_acc" sequence="1"/>
</data>
</openerp>
+1 -1
View File
@@ -28,7 +28,7 @@ class res_company(osv.osv):
}
_defaults = {
'overdue_msg': lambda *a: 'Would your payment have been carried \
'overdue_msg': 'Would your payment have been carried \
out after this mail was sent, please consider the present one as \
void. Do not hesitate to contact our accounting department'
}
+10 -8
View File
@@ -18,42 +18,42 @@
<field name="close_method">balance</field>
</record>
<record id="account_type_receivable" model="account.account.type">
<field name="name">Receivable</field>
<field name="name">Receivable</field>
<field name="code">receivable</field>
<field name="report_type">asset</field>
<field name="close_method">unreconciled</field>
</record>
<record id="account_type_liability" model="account.account.type">
<field name="name">Liability</field>
<field name="name">Liability</field>
<field name="code">liability</field>
<field name="report_type">liability</field>
<field name="close_method">balance</field>
</record>
<record id="account_type_payable" model="account.account.type">
<field name="name">Payable</field>
<field name="name">Payable</field>
<field name="code">payable</field>
<field name="report_type">liability</field>
<field name="close_method">unreconciled</field>
</record>
<record id="account_type_income" model="account.account.type">
<field name="name">Income</field>
<field name="name">Income</field>
<field name="code">income</field>
<field name="report_type">income</field>
<field name="close_method">none</field>
</record>
<record id="account_type_expense" model="account.account.type">
<field name="name">Expense</field>
<field name="name">Expense</field>
<field name="code">expense</field>
<field name="report_type">expense</field>
<field name="close_method">none</field>
</record>
<record id="account_type_cash_equity" model="account.account.type">
<field name="name">Equity</field>
<field name="name">Equity</field>
<field name="code">equity</field>
<field name="close_method">balance</field>
</record>
<record id="account_type_cash_moves" model="account.account.type">
<field name="name">Cash</field>
<field name="name">Cash</field>
<field name="code">cash</field>
<field name="report_type">asset</field>
<field name="close_method">balance</field>
@@ -179,6 +179,7 @@ your own chart of account.
<field name="type">sale</field>
<field name="view_id" ref="account_journal_view"/>
<field name="sequence_id" ref="sequence_sale_journal"/>
<field name="invoice_sequence_id" ref="seq_type_out_invoice"/>
<field model="account.account" name="default_credit_account_id" ref="a_sale"/>
<field model="account.account" name="default_debit_account_id" ref="a_sale"/>
<field name="user_id" ref="base.user_root"/>
@@ -201,6 +202,7 @@ your own chart of account.
<field name="type">purchase</field>
<field name="view_id" ref="account_journal_view"/>
<field name="sequence_id" ref="sequence_purchase_journal"/>
<field name="invoice_sequence_id" ref="seq_type_in_invoice"/>
<field model="account.account" name="default_debit_account_id" ref="a_expense"/>
<field model="account.account" name="default_credit_account_id" ref="a_expense"/>
<field name="user_id" ref="base.user_root"/>
@@ -241,7 +243,7 @@ your own chart of account.
<!--
Product income and expense accounts, default parameters
-->
<record id="property_account_expense_prd" model="ir.property">
<field name="name">property_account_expense</field>
<field name="fields_id" search="[('model','=','product.template'),('name','=','property_account_expense')]"/>
+486 -270
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-30 03:34+0000\n"
"X-Launchpad-Export-Date: 2010-07-01 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
+496 -298
View File
File diff suppressed because it is too large Load Diff
+472 -255
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+26 -20
View File
@@ -45,11 +45,11 @@ class account_invoice(osv.osv):
res[invoice.id]['amount_total'] = res[invoice.id]['amount_tax'] + res[invoice.id]['amount_untaxed']
return res
def _get_journal(self, cr, uid, context):
def _get_journal(self, cr, uid, context=None):
if context is None:
context = {}
type_inv = context.get('type', 'out_invoice')
user = self.pool.get('res.users').browse(cr, uid, uid)
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
company_id = context.get('company_id', user.company_id.id)
type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale_refund', 'in_refund': 'purchase_refund'}
refund_journal = {'out_invoice': False, 'in_invoice': False, 'out_refund': True, 'in_refund': True}
@@ -63,7 +63,7 @@ class account_invoice(osv.osv):
else:
return False
def _get_currency(self, cr, uid, context):
def _get_currency(self, cr, uid, context=None):
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid])[0]
if user.company_id:
return user.company_id.currency_id.id
@@ -81,10 +81,9 @@ class account_invoice(osv.osv):
def _get_type(self, cr, uid, context=None):
if context is None:
context = {}
type = context.get('type', 'out_invoice')
return type
return context.get('type', 'out_invoice')
def _reconciled(self, cr, uid, ids, name, args, context):
def _reconciled(self, cr, uid, ids, name, args, context=None):
res = {}
for id in ids:
res[id] = self.test_paid(cr, uid, [id])
@@ -95,8 +94,11 @@ class account_invoice(osv.osv):
def _amount_residual(self, cr, uid, ids, name, args, context=None):
res = {}
data_inv = self.browse(cr, uid, ids)
cur_obj = self.pool.get('res.currency')
data_inv = self.browse(cr, uid, ids)
if context is None:
context = {}
for inv in data_inv:
debit = credit = 0.0
context.update({'date':inv.date_invoice})
@@ -188,7 +190,7 @@ class account_invoice(osv.osv):
result[invoice.id] = lines
return result
def _get_invoice_from_line(self, cr, uid, ids, context={}):
def _get_invoice_from_line(self, cr, uid, ids, context=None):
move = {}
for line in self.pool.get('account.move.line').browse(cr, uid, ids):
if line.reconcile_partial_id:
@@ -202,7 +204,7 @@ class account_invoice(osv.osv):
invoice_ids = self.pool.get('account.invoice').search(cr, uid, [('move_id','in',move.keys())], context=context)
return invoice_ids
def _get_invoice_from_reconcile(self, cr, uid, ids, context={}):
def _get_invoice_from_reconcile(self, cr, uid, ids, context=None):
move = {}
for r in self.pool.get('account.move.reconcile').browse(cr, uid, ids):
for line in r.line_partial_ids:
@@ -317,12 +319,12 @@ class account_invoice(osv.osv):
_defaults = {
'type': _get_type,
#'date_invoice': lambda *a: time.strftime('%Y-%m-%d'),
'state': lambda *a: 'draft',
'state': 'draft',
'journal_id': _get_journal,
'currency_id': _get_currency,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.invoice', context=c),
'reference_type': lambda *a: 'none',
'check_total': lambda *a: 0.0,
'reference_type': 'none',
'check_total': 0.0,
'user_id': lambda s, cr, u, c: u,
}
@@ -339,16 +341,15 @@ class account_invoice(osv.osv):
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.form')])[0]
return super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
def create(self, cr, uid, vals, context={}):
def create(self, cr, uid, vals, context=None):
try:
res = super(account_invoice, self).create(cr, uid, vals, context)
return res
except Exception,e:
except Exception, e:
if '"journal_id" viol' in e.args[0]:
raise orm.except_orm(_('Configuration Error!'),
_('There is no Accounting Journal of type Sale/Purchase defined!'))
else:
raise
raise orm.except_orm(_('UnknownError'), str(e))
def confirm_paid(self, cr, uid, ids, context=None):
@@ -767,6 +768,8 @@ class account_invoice(osv.osv):
cur_obj = self.pool.get('res.currency')
context = {}
for inv in self.browse(cr, uid, ids):
if not inv.journal_id.invoice_sequence_id:
raise osv.except_osv(_('Error !'), _('Please define invoice sequence on invoice journal'))
if not inv.invoice_line:
raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.'))
if inv.move_id:
@@ -790,7 +793,7 @@ class account_invoice(osv.osv):
# one move line per tax line
iml += ait_obj.move_line_get(cr, uid, inv.id)
entry_type=''
if inv.type in ('in_invoice', 'in_refund'):
ref = inv.reference
@@ -922,7 +925,7 @@ class account_invoice(osv.osv):
if not number:
if obj_inv.journal_id.invoice_sequence_id:
sid = obj_inv.journal_id.invoice_sequence_id.id
number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id=%s', {'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id})
number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id', {'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id})
else:
number = self.pool.get('ir.sequence').get(cr, uid,
'account.invoice.' + invtype)
@@ -1028,7 +1031,7 @@ class account_invoice(osv.osv):
def refund(self, cr, uid, ids, date=None, period_id=None, description=None):
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'address_invoice_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id'])
new_ids = []
for invoice in invoices:
del invoice['id']
@@ -1224,8 +1227,8 @@ class account_invoice_line(osv.osv):
'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True)
}
_defaults = {
'quantity': lambda *a: 1,
'discount': lambda *a: 0.0,
'quantity': 1,
'discount': 0.0,
'price_unit': _price_unit_default,
}
@@ -1568,4 +1571,7 @@ class res_partner(osv.osv):
_columns = {
'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices', readonly=True),
}
res_partner()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1 -4
View File
@@ -191,7 +191,4 @@ class res_partner(osv.osv):
}
res_partner()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-2
View File
@@ -207,7 +207,6 @@
<field name="date" select="1"/>
<field name="user_id" widget="selection"/>
</group>
<separator orientation="vertical"/>
<newline/>
<group string="Group By..." expand="0">
<filter string="General Account" context="{'group_by':'general_account_id'}"/>
@@ -342,7 +341,6 @@
<field name="res_model">account.analytic.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('journal_id','=',active_id)]</field>
</record>
<menuitem action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_entries"/>
<!-- <record id="action_account_analytic_journal_open_form" model="ir.actions.act_window">
@@ -54,7 +54,7 @@
</field>
</group>
<newline/>
<group expand="0" string="Group By...">
<group expand="1" string="Group By...">
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Currency" icon="terp-dolar" context="{'group_by':'currency_id'}"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
+5 -5
View File
@@ -217,11 +217,11 @@
<td><para style="P10">Balance</para></td>
</tr>
<tr>
<td><para style="P14">[[ repeatIn(lines(data['form']), 'a') ]]<font>[[ a['level']&gt;2 and setTag('para','para',{'fontName':"Helvetica"}) ]]</font><i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
<td><para style="P14"><font>[[ a['level']&gt;2 and setTag('para','para',{'fontName':"Helvetica"}) ]]</font><font color="white">[[ '..'*(a['level']-1) ]]</font><font>[[ a['name'] ]]</font></para></td>
<td><para style="P3"><font>[[ a['level']&gt;2 and setTag('para','para',{'fontName':"Helvetica"}) ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]]</font></para></td>
<td><para style="P3"><font>[[ a['level']&gt;2 and setTag('para','para',{'fontName':"Helvetica"}) ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]]</font></para></td>
<td><para style="P3"><font>[[ a['level']&gt;2 and setTag('para','para',{'fontName':"Helvetica"}) ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance']) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[ formatLang(a['balance']) ]]</font></para></td>
<td><para style="P14">[[ repeatIn(lines(data['form']), 'a') ]]<font>[[ (a['level']&gt;2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
<td><para style="P14"><font>[[ (a['level']&gt;2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font color="white">[[ '..'*(a['level']-1) ]]</font><font>[[ a['name'] ]]</font></para></td>
<td><para style="P3"><font>[[ (a['level']&gt;2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]]</font></para></td>
<td><para style="P3"><font>[[ (a['level']&gt;2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font')]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]]</font></para></td>
<td><para style="P3"><font>[[ (a['level']&gt;2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance']) ]]</font><font>[[ a['type']&lt;&gt;'view' and removeParentNode('font') ]] [[ formatLang(a['balance']) ]]</font></para></td>
</tr>
</blockTable>
</story>
@@ -50,36 +50,42 @@
<field name="arch" type="xml">
<search string="Entries Analysis">
<group colspan="10" col="12">
<filter string="Income" name="profit" icon="terp-document-new" domain="[('user_type.report_type','=','income')]"/>
<filter string="Expense" name="loss" icon="terp-document-new" domain="[('user_type.report_type','=','expense')]"/>
<separator orientation="vertical"/>
<filter string="Asset" name="asset" icon="terp-document-new" domain="[('user_type.report_type','=','asset')]"/>
<filter string="Liability" name="liability" icon="terp-document-new" domain="[('user_type.report_type','=','liability')]"/>
<filter string="Receivable" name="asset" icon="terp-document-new" domain="[('type','=','receivable')]"/>
<filter string="Payable" name="asset" icon="terp-document-new" domain="[('type','=','payable')]"/>
<filter icon="terp-go-year" string="This Year"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Tasks performed in this year"/>
<filter icon="terp-go-month" string="This Month"
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Tasks performed in this month"/>
<filter icon="terp-go-week"
string="7 Days"
separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Tasks during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help = "Draft entries"/>
<filter string="Posted" icon="terp-camera_test" domain="[('state','=','posted')]" help = "Posted entries"/>
<separator orientation="vertical"/>
<field name="journal_id"/>
<field name="period_id"/>
<field name="account_id"/>
<field name="analytic_account_id"/>
</group>
<newline/>
<group expand="1" string="Group By...">
<filter string="Journal" name="group_journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<filter string="Account" name="group_account" icon="terp-folder-orange" context="{'group_by':'account_id'}"/>
<filter string="Fiscal Year" icon="terp-go-month" context="{'group_by':'fiscalyear_id'}"/>
<filter string="Period" icon="terp-go-month" name="group_period" context="{'group_by':'period_id'}"/>
<filter string="Journal" name="group_journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<separator orientation="vertical"/>
<filter string="Analytic" name="analytic_account" icon="terp-folder-orange" context="{'group_by':'analytic_account_id'}"/>
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'user_type'}"/>
<filter string="Int.Type" icon="terp-stock_symbol-selection" context="{'group_by':'type'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Analytic" name="analytic_account" icon="terp-folder-orange" context="{'group_by':'analytic_account_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Period" icon="terp-go-month" name="group_period" context="{'group_by':'period_id'}"/>
<filter string="Fiscal Year" icon="terp-go-month" context="{'group_by':'fiscalyear_id'}"/>
<separator orientation="vertical"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'date'}"/>
@@ -88,12 +94,20 @@
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<field name="journal_id"/>
<field name="fiscalyear_id"/>
<field name="period_id"/>
<separator orientation="vertical"/>
<field name="analytic_account_id"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="partner_id"/>
<separator orientation="vertical"/>
<field name="company_id" groups="base.group_multi_company"/>
<newline/>
<field name="date"/>
<field name="date_created"/>
<field name="date_maturity"/>
<separator orientation="vertical"/>
<field name="product_id" />
<field name="partner_id" />
</group>
</search>
</field>
@@ -103,7 +117,7 @@
<field name="res_model">account.entries.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_profit': 1,'search_default_group_journal':1,'search_default_group_period': 1, 'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_profit': 1,'search_default_group_account':1,'search_default_group_month': 1, 'group_by_no_leaf':1,'group_by':[]}</field>
</record>
<menuitem action="action_account_entries_report_all" id="menu_action_account_entries_report_all" parent="account.menu_finance_statistic_report_statement" sequence="2"/>
</data>
+77 -78
View File
@@ -77,84 +77,83 @@ class account_invoice_report(osv.osv):
tools.drop_view_if_exists(cr, 'account_invoice_report')
cr.execute("""
create or replace view account_invoice_report as (
select
min(l.id) as id,
s.date_invoice as date,
to_char(s.date_invoice, 'YYYY') as year,
to_char(s.date_invoice, 'MM') as month,
to_char(s.date_invoice, 'YYYY-MM-DD') as day,
l.product_id as product_id,
sum(case when s.type in ('out_refund','in_invoice') then
l.quantity * u.factor * -1
else
l.quantity * u.factor
end) as product_qty,
s.partner_id as partner_id,
s.reconciled::integer,
s.payment_term as payment_term,
s.period_id as period_id,
u.name as uom_name,
s.currency_id as currency_id,
s.journal_id as journal_id,
s.fiscal_position as fiscal_position,
s.user_id as user_id,
s.company_id as company_id,
sum(case when s.type in ('out_refund','in_invoice') then
l.quantity*l.price_unit * -1
else
l.quantity*l.price_unit
end) as price_total,
sum(case when s.type in ('out_refund','in_invoice') then
l.quantity*l.price_unit * -1
else
l.quantity*l.price_unit
end) / sum(l.quantity * u.factor)::decimal(16,2) as price_average,
count(*) as nbr,
s.type as type,
s.state,
pt.categ_id,
s.date_due as date_due,
s.address_contact_id as address_contact_id,
s.address_invoice_id as address_invoice_id,
s.account_id as account_id,
s.partner_bank as partner_bank,
sum(case when s.type in ('out_refund','in_invoice') then
s.residual * -1
else
s.residual
end) as residual,
case when s.state != 'paid' then null else
extract(epoch from avg(am.date_created-l.create_date))/(24*60*60)::decimal(16,2)
end as delay_to_pay
from account_invoice_line l
left join account_invoice s on (s.id=l.invoice_id)
left join product_template pt on (pt.id=l.product_id)
left join product_uom u on (u.id=l.uos_id),
account_move_line am left join account_invoice i on (i.move_id=am.move_id)
where am.account_id=i.account_id
group by
s.type,
s.date_invoice,
s.partner_id,
l.product_id,
u.name,
l.uos_id,
s.reconciled,
s.user_id,
s.state,
s.residual,
pt.categ_id,
s.company_id,
s.payment_term,
s.period_id,
s.fiscal_position,
s.currency_id,
s.journal_id,
s.date_due,
s.address_contact_id,
s.address_invoice_id,
s.account_id,
s.partner_bank
select min(ail.id) as id,
ai.date_invoice as date,
to_char(ai.date_invoice, 'YYYY') as year,
to_char(ai.date_invoice, 'MM') as month,
to_char(ai.date_invoice, 'YYYY-MM-DD') as day,
ail.product_id,
ai.partner_id as partner_id,
ai.reconciled::integer,
ai.payment_term as payment_term,
ai.period_id as period_id,
u.name as uom_name,
ai.currency_id as currency_id,
ai.journal_id as journal_id,
ai.fiscal_position as fiscal_position,
ai.user_id as user_id,
ai.company_id as company_id,
count(ail.*) as nbr,
ai.type as type,
ai.state,
pt.categ_id,
ai.date_due as date_due,
ai.address_contact_id as address_contact_id,
ai.address_invoice_id as address_invoice_id,
ai.account_id as account_id,
ai.partner_bank as partner_bank,
sum(case when ai.type in ('out_refund','in_invoice') then
ail.quantity * u.factor * -1
else
ail.quantity * u.factor
end) as product_qty,
sum(case when ai.type in ('out_refund','in_invoice') then
ail.quantity*ail.price_unit * -1
else
ail.quantity*ail.price_unit
end) as price_total,
sum(case when ai.type in ('out_refund','in_invoice') then
ail.quantity*ail.price_unit * -1
else
ail.quantity*ail.price_unit
end) / sum(ail.quantity * u.factor)*count(ail.product_id)::decimal(16,2) as price_average,
sum((select extract(epoch from avg(aml.date_created-l.create_date))/(24*60*60)::decimal(16,2)
from account_move_line as aml
left join account_invoice as a ON (a.move_id=aml.move_id)
left join account_invoice_line as l ON (a.id=l.invoice_id)
where a.id=ai.id)) as delay_to_pay,
sum(case when ai.type in ('out_refund','in_invoice') then
ai.residual * -1
else
ai.residual
end) as residual
from account_invoice_line as ail
left join account_invoice as ai ON (ai.id=ail.invoice_id)
left join product_template pt on (pt.id=ail.product_id)
left join product_uom u on (u.id=ail.uos_id)
group by ail.product_id,
ai.date_invoice,
to_char(ai.date_invoice, 'YYYY'),
to_char(ai.date_invoice, 'MM'),
to_char(ai.date_invoice, 'YYYY-MM-DD'),
ai.partner_id,
ai.reconciled,
ai.payment_term,
ai.period_id,
u.name,
ai.currency_id,
ai.journal_id,
ai.fiscal_position,
ai.user_id,
ai.company_id,
ai.type,
ai.state,
pt.categ_id,
ai.date_due,
ai.address_contact_id,
ai.address_invoice_id,
ai.account_id,
ai.partner_bank
)
""")
account_invoice_report()
@@ -74,20 +74,17 @@
icon="terp-check"
domain="[('state','in',('draft','open'))]"
help = "Draft and Open Invoices"/>
<filter string="Pro-forma"
icon="terp-check"
domain="[('state','=','proforma'),('state','=','proforma2')]"
help = "Pro-forma Invoices"/>
<filter string="Current"
domain="[('state', '=' ,'open')]"
help = "open Invoices"/>
<filter string="Pro-forma"
icon="terp-check"
domain="[('state','=','proforma'),('state','=','proforma2')]"
help = "Pro-forma Invoices"/>
<filter string="Done"
icon="terp-dialog-close"
domain="[('state','=','paid')]"
help = "Done Invoices"/>
<separator orientation="vertical"/>
<field name="partner_id"/>
<field name="user_id" widget="selection">
<field name="user_id" >
<filter icon="terp-dolar"
string="My Invoices"
help="My Invoices"
@@ -95,7 +92,7 @@
</field>
</group>
<newline/>
<group expand="0" string="Group By...">
<group expand="1" string="Group By...">
<filter string="Salesman" name='user' icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id','set_visible':True}"/>
@@ -110,7 +107,7 @@
<filter string="Force Period" icon="terp-go-month" context="{'group_by':'period_id'}"/>
<separator orientation="vertical"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<newline/>
<separator orientation="vertical"/>
<filter string="Day" name="day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year'}"/>
+5 -5
View File
@@ -26,7 +26,7 @@
<lineMode width="0.7"/>
<lines>1cm 27.7cm 20cm 27.7cm</lines>
<lines>0.88cm 27.7cm 20.12cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</pageTemplate>
@@ -105,7 +105,7 @@
</blockTable>
<section>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<blockTable rowHeights="0.65cm" colWidths="66.0,124.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_content">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<blockTable colWidths="66.0,124.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_content">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
<tr>
<td>
<blockTable colWidths="280.0,100.0,52.5,52.5,52.5" style="Table5">
@@ -141,7 +141,7 @@
<blockTable colWidths="72.0,93.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<blockTable colWidths="72.0,93.0,65.0,40.0,89.0,49.0,49.0,49.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<tr>
<td><para style="date">Date</para></td>
<td><para style="P3">Partner</para></td>
@@ -156,10 +156,10 @@
</blockTable>
<section>
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
<blockTable rowHeights="0.65cm" colWidths="72.0,93.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_content">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<blockTable colWidths="72.0,93.0,65.0,40.0,89.0,49.0,49.0,49.0,40.0" style="tbl_content">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
<tr>
<td>
<blockTable colWidths="264.00,100.0,50.0,50.0,49.0,40.00" style="Table5">
<blockTable colWidths="260.00,93.0,49.0,49.0,48.0,40.00" style="Table5">
<tr>
<td><para style="Standard">[[ o.code or '' ]] [[ o.name or '' ]]</para></td>
<td><para style="Standard"></para></td>
+7 -183
View File
@@ -107,182 +107,6 @@
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="11" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<blockTableStyle id="TrLevel8">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel7">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel6">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel5">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel4">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel3">
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="1,0"/>
<blockLeftPadding length="0" start="0,3" stop="1,3"/>
</blockTableStyle>
<blockTableStyle id="TrLevel2">
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="-1,0"/>
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel1">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel0">
<lineStyle kind="LINEBELOW" colorName="#777777" start="0,2" stop="1,2"/>
<lineStyle kind="LINEBELOW" colorName="#ffffff" start="2,2" stop="-1,2"/>
</blockTableStyle>
<blockTableStyle id="LineLevel1">
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Line1">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="Line2">
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
</blockTableStyle>
<paraStyle
name="Level8"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level7"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level6"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level5"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level4"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level3"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle name="Level2"
fontSize="8.0"
fontName="Helvetica-Bold"
/>
<paraStyle name="Level1"
fontSize="8.0"
fontName="Helvetica-Bold"
/>
<paraStyle
name="Amt_Level8"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level7"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level6"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level5"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level4"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level3"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Amt_Level2"
fontSize="8.0"
fontName="Helvetica-Bold" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
<paraStyle name="Amt_Level1"
fontSize="8.0"
fontName="Helvetica-Bold" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
<paraStyle
name="Det_Level8"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level7"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level6"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level5"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level4"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level3"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle name="Det_Level2"
fontSize="8.0" leading="5"
fontName="Times-Italic"
/>
<paraStyle name="Det_Level1"
fontSize="8.0" leading="5"
fontName="Times-Italic"
/>
<paraStyle
name="Det_Amt_Level8"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level7"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level6"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level5"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level4"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level3"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Det_Amt_Level2"
fontSize="8.0"
fontName="Times-Italic" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
<paraStyle name="Det_Amt_Level1"
fontSize="8.0"
fontName="Times-Italic" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
</stylesheet>
<story>
<para style="P12a"></para>
@@ -305,19 +129,19 @@
</tr>
<tr>
<td><para style="P7">Balance</para></td>
<td><para style="P8"></para></td>
<td><para style="P8"></para></td>
<td><para style="P8">[[ formatLang(solde_debit(data)) ]]</para></td>
<td><para style="P8">[[ formatLang(solde_credit(data)) ]]</para></td>
<td><para style="P8"></para></td>
<td><para style="P8"></para></td>
</tr>
<tr>
<td><para style="P3">[[ repeatIn(lines(data), 'a') ]]<font>[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]</font></para></td>
<td><para style="P3">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ a['name'] ]]</para></td>
<td><para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['debit']) ]]</para></td>
<td><para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['credit']) ]]</para></td>
<td><para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['balance']) ]]</para></td>
<td><para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['enlitige'] or 0.00) ]]</para></td>
<td><para style="P3">[[ repeatIn(lines(data), 'a') ]]<font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]</font></para></td>
<td><para style="P3"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ a['name'] ]]</para></td>
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['debit']) ]]</para></td>
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['credit']) ]]</para></td>
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['balance']) ]]</para></td>
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['enlitige'] or 0.00) ]]</para></td>
</tr>
</blockTable>
</story>
-7
View File
@@ -41,7 +41,6 @@ class rml_parse(report_sxw.rml_parse):
})
def comma_me(self,amount):
#print "#" + str(amount) + "#"
if not amount:
amount = 0.0
if type(amount) is float :
@@ -98,7 +97,6 @@ class rml_parse(report_sxw.rml_parse):
try:
Stringer = str.encode("utf-16")
except UnicodeDecodeError:
print "UTF_16 Error"
Stringer = str
else:
return Stringer
@@ -120,14 +118,12 @@ class rml_parse(report_sxw.rml_parse):
UnicodeAst = []
_previouslyfound = False
i = 0
#print str(ast)
while i < len(ast):
elem = ast[i]
try:
Stringer = elem.encode("utf-8")
except UnicodeDecodeError:
to_reencode = elem + ast[i+1]
print str(to_reencode)
Good_char = to_reencode.decode('utf-8')
UnicodeAst.append(Good_char)
i += i +2
@@ -139,14 +135,11 @@ class rml_parse(report_sxw.rml_parse):
return "".join(UnicodeAst)
def ReencodeAscii(self,str):
print sys.stdin.encoding
try:
Stringer = str.decode("ascii")
except UnicodeEncodeError:
print "REENCODING ERROR"
return str.encode("ascii")
except UnicodeDecodeError:
print "DECODING ERROR"
return str.encode("ascii")
else:
@@ -88,3 +88,6 @@
"access_report_account_type_sales","report.account_type.sales","model_report_account_type_sales","account.group_account_manager",1,0,0,0
"access_report_account_sales","report.account.sales","model_report_account_sales","account.group_account_manager",1,0,0,0
"access_account_invoice_report","account.invoice.report","model_account_invoice_report","account.group_account_manager",1,0,0,0
"access_account_account_report_manager","account.account.report","model_account_account_report","account.group_account_manager",1,0,0,0
"access_account_entries_report_manager","account.entries.report","model_account_entries_report","account.group_account_manager",1,0,0,0
"access_analytic_entries_report_manager","analytic.entries.report","model_analytic_entries_report","account.group_account_manager",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
88 access_report_account_type_sales report.account_type.sales model_report_account_type_sales account.group_account_manager 1 0 0 0
89 access_report_account_sales report.account.sales model_report_account_sales account.group_account_manager 1 0 0 0
90 access_account_invoice_report account.invoice.report model_account_invoice_report account.group_account_manager 1 0 0 0
91 access_account_account_report_manager account.account.report model_account_account_report account.group_account_manager 1 0 0 0
92 access_account_entries_report_manager account.entries.report model_account_entries_report account.group_account_manager 1 0 0 0
93 access_analytic_entries_report_manager analytic.entries.report model_analytic_entries_report account.group_account_manager 1 0 0 0
@@ -8,7 +8,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Journal Select">
<label string="Are you sure you want to open Journal Entries!" colspan="4"/>
<label string="Are you sure you want to open Journal Entries?" colspan="4"/>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<button icon="terp-gtk-stop" special="cancel" string="Cancel"/>
@@ -58,14 +58,19 @@ class account_statement_from_invoice_lines(osv.osv_memory):
# else:
ctx['date'] = line_date
amount = 0.0
if line.debit > 0:
amount = line.debit
elif line.credit > 0:
amount = -line.credit
if line.amount_currency:
amount = currency_obj.compute(cr, uid, line.currency_id.id,
amount = currency_obj.compute(cursor, user, line.currency_id.id,
statement.currency.id, line.amount_currency, context=ctx)
else:
if line.debit > 0:
amount=line.debit
elif line.credit > 0:
amount=-line.credit
elif (line.invoice and line.invoice.currency_id.id <> statement.currency.id):
amount = currency_obj.compute(cursor, user, line.invoice.currency_id.id,
statement.currency.id, amount, context=ctx)
reconcile_id = statement_reconcile_obj.create(cr, uid, {
'line_ids': [(6, 0, [line.id])]
}, context=context)
+20 -22
View File
@@ -21,32 +21,30 @@
{
'name': 'report_account_analytic',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'name' : 'report_account_analytic',
'version' : '1.1',
'category' : 'Generic Modules/Accounting',
'description': """
This module is for modifying account analytic view to show
important data to project manager of services companies.
Adds menu to show relevant information to each manager..
This module is for modifying account analytic view to show
important data to project manager of services companies.
Adds menu to show relevant information to each manager..
You can also view the report of account analytic summary
user-wise as well as month wise.
You can also view the report of account analytic summary
user-wise as well as month wise.
""",
"version" : "1.1",
"author" : "Camptocamp",
"category" : "Generic Modules/Accounting",
"module": "",
"website": "http://www.camptocamp.com/",
"depends" : ["account","hr_timesheet","hr_timesheet_invoice","project"],
"init_xml" : [],
"update_xml" : [
"security/ir.model.access.csv",
"account_analytic_analysis_view.xml",
"account_analytic_analysis_menu.xml",
],
'demo_xml': [],
"author" : "Camptocamp",
"website" : "http://www.camptocamp.com/",
"depends" : ["hr_timesheet_invoice"],
"init_xml" : [],
"update_xml": [
"security/ir.model.access.csv",
"account_analytic_analysis_view.xml",
"account_analytic_analysis_menu.xml",
],
'demo_xml' : [],
'installable': True,
'active': False,
'active' : False,
'certificate': '0042927202589',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,18 +19,16 @@
#
##############################################################################
import operator
from osv import osv, fields
from osv.orm import intersect
import tools.sql
from tools.translate import _
class account_analytic_account(osv.osv):
_name = "account.analytic.account"
_inherit = "account.analytic.account"
def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context={}):
def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -46,7 +44,7 @@ class account_analytic_account(osv.osv):
return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context)
def _ca_to_invoice_calc(self, cr, uid, ids, name, arg, context={}):
def _ca_to_invoice_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
res2 = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
@@ -92,7 +90,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2)
return res
def _hours_qtt_non_invoiced_calc (self, cr, uid, ids, name, arg, context={}):
def _hours_qtt_non_invoiced_calc (self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -117,7 +115,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _hours_quantity_calc(self, cr, uid, ids, name, arg, context={}):
def _hours_quantity_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -141,7 +139,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _total_cost_calc(self, cr, uid, ids, name, arg, context={}):
def _total_cost_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -158,7 +156,7 @@ class account_analytic_account(osv.osv):
return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context)
# TODO Take care of pricelist and purchase !
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}):
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
res2 = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
@@ -202,7 +200,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2)
return res
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context={}):
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -223,7 +221,7 @@ class account_analytic_account(osv.osv):
res[id] = res.get(id, '')
return res
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context={}):
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -247,7 +245,7 @@ class account_analytic_account(osv.osv):
res[id] = res.get(id, '')
return res
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context={}):
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@@ -268,7 +266,7 @@ class account_analytic_account(osv.osv):
res[id] = res.get(id, '')
return res
def _remaining_hours_calc(self, cr, uid, ids, name, arg, context={}):
def _remaining_hours_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.quantity_max != 0:
@@ -279,7 +277,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _hours_qtt_invoiced_calc(self, cr, uid, ids, name, arg, context={}):
def _hours_qtt_invoiced_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
res[account.id] = account.hours_quantity - account.hours_qtt_non_invoiced
@@ -289,7 +287,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _revenue_per_hour_calc(self, cr, uid, ids, name, arg, context={}):
def _revenue_per_hour_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.hours_qtt_invoiced == 0:
@@ -300,7 +298,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _real_margin_rate_calc(self, cr, uid, ids, name, arg, context={}):
def _real_margin_rate_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.ca_invoiced == 0:
@@ -313,7 +311,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _remaining_ca_calc(self, cr, uid, ids, name, arg, context={}):
def _remaining_ca_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.amount_max != 0:
@@ -324,7 +322,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _real_margin_calc(self, cr, uid, ids, name, arg, context={}):
def _real_margin_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
res[account.id] = account.ca_invoiced + account.total_cost
@@ -332,7 +330,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _theorical_margin_calc(self, cr, uid, ids, name, arg, context={}):
def _theorical_margin_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
res[account.id] = account.ca_theorical + account.total_cost
@@ -386,6 +384,7 @@ class account_analytic_account(osv.osv):
'month_ids': fields.function(_month, method=True, type='many2many', relation='account_analytic_analysis.summary.month', string='Month'),
'user_ids': fields.function(_user, method=True, type="many2many", relation='account_analytic_analysis.summary.user', string='User'),
}
account_analytic_account()
class account_analytic_account_summary_user(osv.osv):
@@ -426,6 +425,7 @@ class account_analytic_account_summary_user(osv.osv):
string='Total Time'),
'user' : fields.many2one('res.users', 'User'),
}
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_user')
cr.execute('CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS (' \
@@ -508,11 +508,11 @@ class account_analytic_account_summary_user(osv.osv):
res.extend(cr.dictfetchall())
else:
res = map(lambda x: {'id': x}, ids)
res_trans_obj = self.pool.get('ir.translation')
for f in fields_pre:
if self._columns[f].translate:
ids = map(lambda x: x['id'], res)
res_trans = self.pool.get('ir.translation')._get_ids(cr, user, self._name+','+f, 'model', context.get('lang', False) or 'en_US', ids)
res_trans = res_trans_obj._get_ids(cr, user, self._name+','+f, 'model', context.get('lang', False) or 'en_US', ids)
for r in res:
r[f] = res_trans.get(r['id'], False) or r[f]
@@ -684,11 +684,12 @@ class account_analytic_account_summary_month(osv.osv):
res.extend(cr.dictfetchall())
else:
res = map(lambda x: {'id': x}, ids)
res_trans_obj = self.pool.get('ir.translation')
for f in fields_pre:
if self._columns[f].translate:
ids = map(lambda x: x['id'], res)
res_trans = self.pool.get('ir.translation')._get_ids(cr, user, self._name+','+f, 'model', context.get('lang', False) or 'en_US', ids)
res_trans = res_trans_obj._get_ids(cr, user, self._name+','+f, 'model', context.get('lang', False) or 'en_US', ids)
for r in res:
r[f] = res_trans.get(r['id'], False) or r[f]
@@ -731,6 +732,5 @@ class account_analytic_account_summary_month(osv.osv):
account_analytic_account_summary_month()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,7 +1,6 @@
<openerp>
<data>
<menuitem icon="terp-project" id="base.menu_main_pm" name="Project" sequence="10"/>
<!-- <menuitem id="next_id_71" name="Financial Project Management" parent="base.menu_main_pm" groups="account.group_account_invoice" sequence="20"/>-->
<menuitem id="menu_invoicing" name="Billing" parent="base.menu_main_pm" sequence="4"/>
<record id="action_hr_tree_invoiced_all" model="ir.actions.act_window">
@@ -14,17 +13,6 @@
</record>
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="menu_invoicing"/>
<record id="action_account_analytic_all" model="ir.actions.act_window">
<field name="name">All Analytic Accounts</field>
<field name="res_model">account.analytic.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="account.view_account_analytic_account_list"/>
<field name="search_view_id" ref="account.view_account_analytic_account_search"/>
<field name="domain">[]</field>
</record>
<!-- <menuitem name="Analytic Accounts" action="action_account_analytic_all" id="menu_action_account_analytic_all" parent="next_id_71"/>-->
<record id="action_account_analytic_managed_overpassed" model="ir.actions.act_window">
<field name="name">Overpassed Accounts</field>
<field name="res_model">account.analytic.account</field>
@@ -24,7 +24,6 @@
<field name="ca_invoiced"/>
<field name="ca_theorical"/>
<newline/>
<!-- <field name="old"/> -->
<field name="hours_quantity"/>
<field name="hours_qtt_invoiced"/>
<field name="remaining_hours"/>
@@ -38,13 +37,12 @@
<separator colspan="4" string="Key dates"/>
<field name="last_invoice_date"/>
<field name="last_worked_invoiced_date"/>
<field name="last_worked_date"/>
<separator colspan="4" string="To be invoiced"/>
<field name="hours_qtt_non_invoiced"/>
<field name="ca_to_invoice"/>
</page>
<page string="Stats by month">
<field colspan="4" name="month_ids" nolabel="1">
@@ -81,20 +79,18 @@
</field>
</field>
</record>
<record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
<field name="name">account.analytic.account.tree</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="account.view_account_analytic_account_list"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="date" position="before">
<field name="last_invoice_date"/>
<field name="ca_to_invoice"/>
</field>
</field>
</record>
<record id="view_account_analytic_simplified" model="ir.ui.view">
@@ -110,7 +106,6 @@
<field name="remaining_hours"/>
<field name="ca_to_invoice"/>
<field name="last_invoice_date"/>
</tree>
</field>
</record>
+11 -11
View File
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-11-17 06:50+0000\n"
"Last-Translator: Tor Syversen <sol-moe@online.no>\n"
"PO-Revision-Date: 2010-07-03 18:41+0000\n"
"Last-Translator: Mathias Bøhn Grytemark <Unknown>\n"
"Language-Team: Norwegian Bokmal <nb@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-22 04:10+0000\n"
"X-Launchpad-Export-Date: 2010-07-07 03:39+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_analysis
@@ -32,7 +32,7 @@ msgstr "Timer, summert pr. bruker"
#. module: account_analytic_analysis
#: field:account.analytic.account,last_invoice_date:0
msgid "Last Invoice Date"
msgstr ""
msgstr "Forrige fakturadato"
#. module: account_analytic_analysis
#: help:account.analytic.account,remaining_ca:0
@@ -58,7 +58,7 @@ msgstr "Mine nåværende konti"
#. module: account_analytic_analysis
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
msgstr "Ugyldig XML for visningsarkitektur!"
#. module: account_analytic_analysis
#: help:account.analytic.account,last_invoice_date:0
@@ -84,7 +84,7 @@ msgstr ""
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
msgstr "Objektets navn må starte med x_ og ikke inneholde spesialkarakterer!"
#. module: account_analytic_analysis
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_new
@@ -123,7 +123,7 @@ msgstr ""
#. module: account_analytic_analysis
#: model:ir.ui.menu,name:account_analytic_analysis.menu_invoicing
msgid "Invoicing"
msgstr ""
msgstr "Fakturering"
#. module: account_analytic_analysis
#: field:account.analytic.account,last_worked_date:0
@@ -145,7 +145,7 @@ msgstr ""
#. module: account_analytic_analysis
#: field:account.analytic.account,remaining_hours:0
msgid "Remaining Hours"
msgstr ""
msgstr "Gjenværende timer"
#. module: account_analytic_analysis
#: help:account.analytic.account,ca_theorical:0
@@ -159,7 +159,7 @@ msgstr ""
#: field:account.analytic.account,user_ids:0
#: field:account_analytic_analysis.summary.user,user:0
msgid "User"
msgstr ""
msgstr "Bruker"
#. module: account_analytic_analysis
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_managed_pending
@@ -182,7 +182,7 @@ msgstr ""
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_managed
#: model:ir.ui.menu,name:account_analytic_analysis.menu_analytic_account_managed
msgid "My Accounts"
msgstr ""
msgstr "Mine kontoer"
#. module: account_analytic_analysis
#: model:ir.module.module,description:account_analytic_analysis.module_meta_information
@@ -195,7 +195,7 @@ msgstr ""
#. module: account_analytic_analysis
#: field:account.analytic.account,hours_qtt_non_invoiced:0
msgid "Uninvoiced Hours"
msgstr ""
msgstr "Ufakturerte timer"
#. module: account_analytic_analysis
#: field:account.analytic.account,hours_quantity:0
@@ -20,4 +20,5 @@
##############################################################################
import account_analytic_default
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,11 +19,10 @@
#
##############################################################################
{
'name': 'Account Analytic Default',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'name' : 'Account Analytic Default',
'version' : '1.0',
'category' : 'Generic Modules/Accounting',
'description': """
Allows to automatically select analytic accounts based on criterions:
* Product
@@ -32,14 +31,15 @@ Allows to automatically select analytic accounts based on criterions:
* Company
* Date
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account', 'sale'],
'init_xml': [],
'author' : 'Tiny',
'website' : 'http://www.openerp.com',
'depends' : ['sale'],
'init_xml' : [],
'update_xml': ['security/ir.model.access.csv', 'account_analytic_default_view.xml'],
'demo_xml': [],
'demo_xml' : [],
'installable': True,
'active': False,
'certificate': '0074229833581',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,10 +19,10 @@
#
##############################################################################
from osv import fields,osv
from osv import orm
import time
from osv import fields,osv
class account_analytic_default(osv.osv):
_name = 'account.analytic.default'
_description = 'Analytic Distribution'
@@ -38,7 +38,8 @@ class account_analytic_default(osv.osv):
'date_start': fields.date('Start Date'),
'date_stop': fields.date('End Date'),
}
def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context={}):
def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context=None):
domain = []
if product_id:
domain += ['|',('product_id','=',product_id)]
@@ -65,20 +66,22 @@ class account_analytic_default(osv.osv):
res = rec
best_index = index
return res
account_analytic_default()
class account_invoice_line(osv.osv):
_inherit = 'account.invoice.line'
_description = 'Invoice Line'
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}):
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, currency_id=currency_id, context=context)
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fiscal_position=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fiscal_position, price_unit, address_invoice_id, currency_id=currency_id, context=context)
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context)
if rec:
res_prod['value'].update({'account_analytic_id':rec.analytic_id.id})
else:
res_prod['value'].update({'account_analytic_id':False})
return res_prod
account_invoice_line()
@@ -101,22 +104,20 @@ class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
# Method overridden to set the analytic account by default on criterion match
def invoice_line_create(self, cr, uid, ids, context={}):
def invoice_line_create(self, cr, uid, ids, context=None):
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
if not ids:
return create_ids
sale_line_obj = self.browse(cr, uid, ids[0], context)
pool_inv_line = self.pool.get('account.invoice.line')
for line in pool_inv_line.browse(cr, uid, create_ids, context):
rec = self.pool.get('account.analytic.default').account_get(cr, uid, line.product_id.id, sale_line_obj.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context)
sale_line = self.browse(cr, uid, ids[0], context)
inv_line_obj = self.pool.get('account.invoice.line')
anal_def_obj = self.pool.get('account.analytic.default')
for line in inv_line_obj.browse(cr, uid, create_ids, context):
rec = anal_def_obj.account_get(cr, uid, line.product_id.id, sale_line.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context)
if rec:
pool_inv_line.write(cr, uid, [line.id], {'account_analytic_id':rec.analytic_id.id}, context=context)
inv_line_obj.write(cr, uid, [line.id], {'account_analytic_id':rec.analytic_id.id}, context=context)
return create_ids
sale_order_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -52,6 +52,7 @@
</search>
</field>
</record>
<record id="action_analytic_default_form" model="ir.actions.act_window">
<field name="name">Analytic Defaults</field>
<field name="res_model">account.analytic.default</field>
@@ -59,10 +60,6 @@
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_account_analytic_default_form_search"/>
</record>
<!-- <menuitem-->
<!-- action="action_analytic_default_form"-->
<!-- id="menu_analytic_defaul_form"-->
<!-- parent="account.menu_analytic_accounting"/>-->
<act_window
name="Entries"
@@ -22,5 +22,6 @@
import account_analytic_plans
import wizard
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+10 -9
View File
@@ -21,9 +21,9 @@
{
'name': 'Multiple-plans management in Analytic Accounting',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'name' : 'Multiple-plans management in Analytic Accounting',
'version' : '1.0',
'category' : 'Generic Modules/Accounting',
'description': """This module allows to use several analytic plans, according to the general journal,
so that multiple analytic lines are created when the invoice or the entries
are confirmed.
@@ -54,10 +54,10 @@ for one account entry.
The analytic plan validates the minimum and maximum percentage at the time of creation
of distribution models.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account', 'account_analytic_default'],
'init_xml': [],
'author' : 'Tiny',
'website' : 'http://www.openerp.com',
'depends' : ['account', 'account_analytic_default'],
'init_xml' : [],
'update_xml': [
'security/ir.model.access.csv',
'account_analytic_plans_view.xml',
@@ -65,9 +65,10 @@ of distribution models.
'wizard/analytic_plan_create_model_view.xml',
'wizard/account_crossovered_analytic_view.xml'
],
'demo_xml': [],
'demo_xml' : [],
'installable': True,
'active': False,
'active' : False,
'certificate': '0036417675373',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,15 +19,9 @@
#
##############################################################################
from lxml import etree
from mx import DateTime
from mx.DateTime import now
import time
import netsvc
from osv import fields, osv,orm
import ir
from osv import fields, osv
import tools
from tools.translate import _
@@ -59,11 +53,13 @@ class account_analytic_plan(osv.osv):
'name': fields.char('Analytic Plan', size=64, required=True, select=True,),
'plan_ids': fields.one2many('account.analytic.plan.line','plan_id','Analytic Plans'),
}
account_analytic_plan()
class account_analytic_plan_line(osv.osv):
_name = "account.analytic.plan.line"
_description = "Analytic Plan Line"
_order = "sequence, id"
_columns = {
'plan_id':fields.many2one('account.analytic.plan','Analytic Plan'),
'name': fields.char('Plan Name', size=64, required=True, select=True),
@@ -73,16 +69,16 @@ class account_analytic_plan_line(osv.osv):
'max_required': fields.float('Maximum Allowed (%)'),
}
_defaults = {
'min_required': lambda *args: 100.0,
'max_required': lambda *args: 100.0,
'min_required': 100.0,
'max_required': 100.0,
}
_order = "sequence,id"
account_analytic_plan_line()
class account_analytic_plan_instance(osv.osv):
_name='account.analytic.plan.instance'
_name = 'account.analytic.plan.instance'
_description = 'Analytic Plan Instance'
_columns={
_columns = {
'name':fields.char('Analytic Distribution', size=64),
'code':fields.char('Distribution Code', size=16),
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal' ),
@@ -116,7 +112,9 @@ class account_analytic_plan_instance(osv.osv):
'account4_ids':False, 'account5_ids':False, 'account6_ids':False})
return super(account_analytic_plan_instance, self).copy(cr, uid, id, default, context)
def _default_journal(self, cr, uid, context={}):
def _default_journal(self, cr, uid, context=None):
if not context:
context = {}
if context.has_key('journal_id') and context['journal_id']:
journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id'])
if journal.analytic_journal_id:
@@ -124,10 +122,10 @@ class account_analytic_plan_instance(osv.osv):
return False
_defaults = {
'plan_id': lambda *args: False,
'plan_id': False,
'journal_id': _default_journal,
}
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
res = []
for inst in self.browse(cr, uid, ids, context):
name = inst.name or '/'
@@ -191,23 +189,25 @@ class account_analytic_plan_instance(osv.osv):
pids = self.pool.get('account.analytic.plan.instance').search(cr, uid, [('name','=',vals['name']),('code','=',vals['code']),('plan_id','<>',False)])
if pids:
raise osv.except_osv(_('Error'), _('A model having this name and code already exists !'))
res = self.pool.get('account.analytic.plan.line').search(cr, uid, [('plan_id','=',journal.plan_id.id)])
acct_anal_acct = self.pool.get('account.analytic.account')
acct_anal_plan_line_obj = self.pool.get('account.analytic.plan.line')
res = acct_anal_plan_line_obj.search(cr, uid, [('plan_id','=',journal.plan_id.id)])
for i in res:
total_per_plan = 0
item = self.pool.get('account.analytic.plan.line').browse(cr, uid, i)
item = acct_anal_plan_line_obj.browse(cr, uid, i)
temp_list=['account1_ids','account2_ids','account3_ids','account4_ids','account5_ids','account6_ids']
for l in temp_list:
if vals.has_key(l):
for tempo in vals[l]:
if self.pool.get('account.analytic.account').search(cr, uid, [('parent_id','child_of',[item.root_analytic_id.id]),('id','=',tempo[2]['analytic_account_id'])]):
if acct_anal_acct.search(cr, uid, [('parent_id','child_of',[item.root_analytic_id.id]),('id','=',tempo[2]['analytic_account_id'])]):
total_per_plan += tempo[2]['rate']
if total_per_plan < item.min_required or total_per_plan > item.max_required:
raise osv.except_osv(_('Value Error') ,_('The Total Should be Between %s and %s') % (str(item.min_required), str(item.max_required)))
return super(account_analytic_plan_instance, self).create(cr, uid, vals, context)
def write(self, cr, uid, ids, vals, context={}, check=True, update_check=True):
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
this = self.browse(cr, uid, ids[0])
if this.plan_id and not vals.has_key('plan_id'):
#this instance is a model, so we have to create a new plan instance instead of modifying it
@@ -237,9 +237,9 @@ class account_analytic_plan_instance_line(osv.osv):
'rate':fields.float('Rate (%)', required=True),
}
_defaults = {
'rate': lambda *args: 100.0
'rate': 100.0
}
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
reads = self.read(cr, uid, ids, ['analytic_account_id'], context)
@@ -256,6 +256,7 @@ class account_journal(osv.osv):
_columns = {
'plan_id':fields.many2one('account.analytic.plan', 'Analytic Plans'),
}
account_journal()
class account_invoice_line(osv.osv):
@@ -281,6 +282,7 @@ class account_invoice_line(osv.osv):
if rec and rec.analytics_id:
res_prod['value'].update({'analytics_id':rec.analytics_id.id})
return res_prod
account_invoice_line()
class account_move_line(osv.osv):
@@ -297,7 +299,7 @@ class account_move_line(osv.osv):
del(data['analytics_id'])
return data
def create_analytic_lines(self, cr, uid, ids, context={}):
def create_analytic_lines(self, cr, uid, ids, context=None):
super(account_move_line, self).create_analytic_lines(cr, uid, ids, context)
analytic_line_obj = self.pool.get('account.analytic.line')
for line in self.browse(cr, uid, ids, context):
@@ -333,7 +335,7 @@ class account_invoice(osv.osv):
_name = "account.invoice"
_inherit="account.invoice"
def line_get_convert(self, cr, uid, x, part, date, context={}):
def line_get_convert(self, cr, uid, x, part, date, context=None):
res=super(account_invoice,self).line_get_convert(cr, uid, x, part, date, context)
res['analytics_id']=x.get('analytics_id',False)
return res
@@ -349,6 +351,7 @@ class account_invoice(osv.osv):
sign = -1
iml = self.pool.get('account.invoice.line').move_line_get(cr, uid, inv.id)
acct_ins_obj = self.pool.get('account.analytic.plan.instance')
for il in iml:
if il['analytics_id']:
@@ -357,14 +360,14 @@ class account_invoice(osv.osv):
ref = inv.reference
else:
ref = self._convert_ref(cr, uid, inv.number)
obj_move_line=self.pool.get('account.analytic.plan.instance').browse(cr, uid, il['analytics_id'])
amount_calc=cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, il['price'], context={'date': inv.date_invoice}) * sign
qty=il['quantity']
obj_move_line = acct_ins_obj.browse(cr, uid, il['analytics_id'])
amount_calc = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, il['price'], context={'date': inv.date_invoice}) * sign
qty = il['quantity']
il['analytic_lines']=[]
for line2 in obj_move_line.account_ids:
amt=amount_calc * (line2.rate/100)
qtty=qty* (line2.rate/100)
al_vals={
amt = amount_calc * (line2.rate/100)
qtty = qty* (line2.rate/100)
al_vals = {
'name': il['name'],
'date': inv['date_invoice'],
'unit_amount':qtty,
@@ -393,23 +396,25 @@ class analytic_default(osv.osv):
_columns = {
'analytics_id': fields.many2one('account.analytic.plan.instance', 'Analytic Distribution'),
}
analytic_default()
class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
# Method overridden to set the analytic account by default on criterion match
def invoice_line_create(self, cr, uid, ids, context={}):
def invoice_line_create(self, cr, uid, ids, context=None):
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
if ids:
sale_line_obj = self.browse(cr, uid, ids[0], context)
pool_inv_line = self.pool.get('account.invoice.line')
for line in pool_inv_line.browse(cr, uid, create_ids, context):
rec = self.pool.get('account.analytic.default').account_get(cr, uid, line.product_id.id, sale_line_obj.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context)
sale_line = self.browse(cr, uid, ids[0], context)
inv_line_obj = self.pool.get('account.invoice.line')
acct_anal_def_obj = self.pool.get('account.analytic.default')
for line in inv_line_obj.browse(cr, uid, create_ids, context):
rec = acct_anal_def_obj.account_get(cr, uid, line.product_id.id, sale_line.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context)
if rec:
pool_inv_line.write(cr, uid, [line.id], {'analytics_id':rec.analytics_id.id}, context=context)
inv_line_obj.write(cr, uid, [line.id], {'analytics_id':rec.analytics_id.id}, context=context)
return create_ids
sale_order_line()
@@ -11,13 +11,6 @@
auto="False"
menu="False"/>
<!--<wizard
id="account_analytic_account_inverted_balance_report"
string="Crossovered Analytic"
model="account.analytic.account"
name="wizard.crossovered.analytic"
keyword="client_print_multi"/>-->
</data>
</openerp>
@@ -89,7 +89,11 @@
<field name="code" select="1"/>
<field name="plan_id" required="True"/>
<field name="journal_id"/>
<field name="account_ids" string="Analytic Distribution" colspan="4">
<field name="account_ids" nolabel="1" colspan="4">
<form string="Analytic Distribution">
<field name="rate"/>
<field name="analytic_account_id"/>
</form>
<tree string="Analytic Distribution" editable="bottom">
<field name="rate"/>
<field name="analytic_account_id"/>
@@ -124,16 +128,11 @@
<act_window name="Distribution Models"
domain="[('plan_id', '=', active_id),('plan_id','&lt;&gt;',False)]"
context="{'plan_id': active_id}"
context="{'plan_id':active_id}"
res_model="account.analytic.plan.instance"
src_model="account.analytic.plan"
id="account_analytic_instance_model_open"/>
<!-- <menuitem-->
<!-- name="Analytic Distribution's models" parent="account.account_def_analytic_journal"-->
<!-- id="menu_account_analytic_plan_instance_action"-->
<!-- action="account_analytic_plan_instance_action"/>-->
<record model="ir.ui.view" id="account_analytic_plan_instance_line_form">
<field name="name">account.analytic.plan.instance.line.form</field>
<field name="model">account.analytic.plan.instance.line</field>
@@ -234,7 +233,7 @@
</field>
</record>
<!-- add property field on product -->
<!-- add property field on default analytic account-->
<record model="ir.ui.view" id="view_default_inherit_form">
<field name="name">account.analytic.default.form.plans</field>
@@ -20,5 +20,6 @@
##############################################################################
import crossovered_analytic
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -19,20 +19,20 @@
#
##############################################################################
import pooler
import time
from report import report_sxw
class crossovered_analytic(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(crossovered_analytic, self).__init__(cr, uid, name, context=context)
super(crossovered_analytic, self).__init__(cr, uid, name, context = context)
self.localcontext.update( {
'time': time,
'lines': self._lines,
'ref_lines' : self._ref_lines,
'find_children':self.find_children,
})
self.base_amount=0.00
self.base_amount = 0.00
def find_children(self,ref_ids):
to_return_ids = []
@@ -153,23 +153,23 @@ class crossovered_analytic(report_sxw.rml_parse):
if not form['empty_line']:
res.append(result)
else:
result={}
res=[]
result['id']=acc_id
result = {}
res = []
result['id'] = acc_id
data_account = acc_pool.browse(self.cr,self.uid,acc_id)
result['acc_name']=data_account.name
result['acc_name'] = data_account.name
result['code'] = data_account.code
result['amt']=result['qty']=result['perc']=0.00
result['amt'] = result['qty'] = result['perc'] = 0.00
if not form['empty_line']:
res.append(result)
for item in res:
obj_acc=acc_pool.name_get(self.cr,self.uid,[item['id']])
item['acc_name']=obj_acc[0][1]
obj_acc = acc_pool.name_get(self.cr,self.uid,[item['id']])
item['acc_name'] = obj_acc[0][1]
final.append(item)
return final
report_sxw.report_sxw('report.account.analytic.account.crossovered.analytic', 'account.analytic.account', 'addons/account_analytic_plans/report/crossovered_analytic.rml',parser=crossovered_analytic, header=False)
report_sxw.report_sxw('report.account.analytic.account.crossovered.analytic', 'account.analytic.account', 'addons/account_analytic_plans/report/crossovered_analytic.rml',parser = crossovered_analytic, header = False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -21,5 +21,6 @@
import analytic_plan_create_model
import account_crossovered_analytic
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -8,17 +8,19 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Crossovered Analytic">
<group col="4" colspan="6">
<field name="date1"/>
<field name="date2"/>
<field name="ref" colspan="4"/>
<field name="journal_ids" colspan="4"/>
<field name="empty_line"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
<button name="print_report" string="Print" colspan="1" type="object" icon="gtk-print"/>
<group height="280" width="300">
<group col="4" colspan="6">
<field name="date1"/>
<field name="date2"/>
<field name="ref" colspan="4"/>
<field name="journal_ids" colspan="4"/>
<field name="empty_line"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
<button name="print_report" string="Print" colspan="1" type="object" icon="gtk-print"/>
</group>
</group>
</form>
</field>
+1
View File
@@ -22,4 +22,5 @@ import product
import stock
import purchase
import invoice
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+11 -9
View File
@@ -17,11 +17,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name" : "Stock Accounting for Anglo Saxon countries",
"version" : "1.2",
"author" : "Tiny, Veritos",
"website" : "http://tinyerp.com - http://veritos.nl",
"name" : "Stock Accounting for Anglo Saxon countries",
"version" : "1.2",
"author" : "Tiny, Veritos",
"website" : "http://tinyerp.com - http://veritos.nl",
"description" : """This module will support the Anglo-Saxons accounting methodology by
changing the accounting logic with stock transactions. The difference between the Anglo-Saxon accounting countries
and the Rhine or also called Continental accounting countries is the moment of taking the Cost of Goods Sold versus Cost of Sales.
@@ -29,12 +30,13 @@
This module will add this functionality by using a interim account, to store the value of shipped goods and will contra book this interim account
when the invoice is created to transfer this amount to the debtor or creditor account.
Secondly, price differences between actual purchase price and fixed product standard price are booked on a seperate account""",
"depends" : ["product", "account", "sale", "purchase", "stock"],
"category" : "Generic Modules/Inventory Control",
"init_xml" : [],
"demo_xml" : [],
"depends" : ["product", "purchase"],
"category" : "Generic Modules/Inventory Control",
"init_xml" : [],
"demo_xml" : [],
"update_xml" : ["product_view.xml",],
"active": False,
"active" : False,
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+2 -8
View File
@@ -5,13 +5,11 @@
<field name="name">product.normal.form.inherit.stock</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="inherit_id" ref="account.product_normal_form_view"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='property_account_expense']" position="after">
<field name="property_account_creditor_price_difference" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
<newline/>
<!-- <field name="property_account_sending_goods" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('sale_ok','=',0)]}" />-->
<!-- <field name="property_account_received_goods" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />-->
</xpath>
</field>
</record>
@@ -20,13 +18,11 @@
<field name="name">product.template.product.form.inherit</field>
<field name="model">product.template</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="inherit_id" ref="account.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='property_account_expense']" position="after">
<field name="property_account_creditor_price_difference" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
<newline/>
<!-- <field name="property_account_sending_goods" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('sale_ok','=',0)]}" />-->
<!-- <field name="property_account_received_goods" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />-->
</xpath>
</field>
</record>
@@ -41,8 +37,6 @@
<group col="2" colspan="2">
<separator string=" Accounting Property" colspan="2"/>
<field name="property_account_creditor_price_difference_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
<!-- <field name="property_account_sending_goods_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('sale_ok','=',0)]}" />-->
<!-- <field name="property_account_received_goods_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />-->
</group>
</form>
</field>
+1
View File
@@ -22,5 +22,6 @@
import crossovered_budget
import report
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -20,14 +20,9 @@
##############################################################################
from osv import osv,fields
import tools
import netsvc
from mx import DateTime
import time
import datetime
from tools.translate import _
def strToDate(dt):
dt_date=datetime.date(int(dt[0:4]),int(dt[5:7]),int(dt[8:10]))
return dt_date
@@ -127,13 +122,6 @@ class crossovered_budget(osv.osv):
'creating_user_id': lambda self,cr,uid,context: uid,
}
# def action_set_to_draft(self, cr, uid, ids, *args):
# self.write(cr, uid, ids, {'state': 'draft'})
# wf_service = netsvc.LocalService('workflow')
# for id in ids:
# wf_service.trg_create(uid, self._name, id, cr)
# return True
def budget_confirm(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {
'state':'confirm'
+3 -3
View File
@@ -19,17 +19,16 @@
#
##############################################################################
{
"name" : "Account Cancel",
"version" : "1.1",
"depends" : ["account"],
"author" : "Tiny",
"category": 'Generic Modules/Accounting',
"description": """
Module Add Allow cancelling entries field on form view of account journal if it set to true it allows user to cancel entries & invoices.
Module adds 'Allow cancelling entries' field on form view of account journal. If set to true it allows user to cancel entries & invoices.
""",
'website': 'http://www.openerp.com',
"depends" : ["account"],
'init_xml': [],
'update_xml': ['account_cancel_view.xml' ],
'demo_xml': [],
@@ -37,4 +36,5 @@
'active': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -7,7 +7,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page[@string='General Information']/group/field[@name='centralisation']" position="after">
<xpath expr="/form/notebook/page[@string='General Information']/group/group/field[@name='centralisation']" position="after">
<field name="update_posted"/>
</xpath>
</field>
+1
View File
@@ -21,5 +21,6 @@
import account_coda
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+12 -11
View File
@@ -20,23 +20,24 @@
##############################################################################
{
"name":"Account CODA - import bank statements from coda file",
"version":"1.0",
"author":"Tiny",
"category":"Account CODA",
"description":"""
"name" : "Account CODA - import bank statements from coda file",
"version" : "1.0",
"author" : "Tiny",
"category" : "Account CODA",
"description": """
Module provides functionality to import
bank statements from coda files.
""",
"depends":["base", "account"],
"demo_xml":["account_coda_demo.xml"],
"init_xml":[],
"update_xml" : ["security/ir.model.access.csv",
"depends" : ["account"],
"demo_xml" : [],
"init_xml" : [],
"update_xml": ["security/ir.model.access.csv",
"wizard/account_coda_import.xml",
"account_coda_view.xml"],
"active":False,
"installable":True,
"active" : False,
"installable" : True,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+8 -7
View File
@@ -26,25 +26,26 @@ class account_coda(osv.osv):
_name = "account.coda"
_description = "coda for an Account"
_columns = {
'name': fields.binary('Coda file', readonly=True ,help="Store the detail of bank statements"),
'statement_ids': fields.one2many('account.bank.statement','coda_id','Generated Bank Statements', readonly=True),
'name': fields.binary('Coda file', readonly=True, help="Store the detail of bank statements"),
'statement_ids': fields.one2many('account.bank.statement', 'coda_id', 'Generated Bank Statements', readonly=True),
'note': fields.text('Import log', readonly=True),
'journal_id': fields.many2one('account.journal','Journal', readonly=True, select=True,help="Bank Journal"),
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True, select=True, help="Bank Journal"),
'date': fields.date('Date', readonly=True, select=True, help="Import Date"),
'user_id': fields.many2one('res.users','User', readonly=True, select=True),
'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
}
_defaults = {
'date': time.strftime('%Y-%m-%d'),
'user_id': lambda self,cr,uid,context: uid,
}
account_coda()
class account_bank_statement(osv.osv):
_inherit = "account.bank.statement"
_columns = {
'coda_id':fields.many2one('account.coda','Coda'),
'coda_id':fields.many2one('account.coda', 'Coda'),
}
account_bank_statement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -21,7 +21,6 @@
##############################################################################
import time
from mx import DateTime
import base64
from osv import fields
@@ -54,7 +53,8 @@ class account_coda_import(osv.osv_memory):
'coda': fields.binary('Coda File', required=True),
'note':fields.text('Log'),
}
def coda_parsing(self, cr, uid, ids, context):
def coda_parsing(self, cr, uid, ids, context=None):
journal_obj=self.pool.get('account.journal')
account_period_obj = self.pool.get('account.period')
@@ -65,10 +65,12 @@ class account_coda_import(osv.osv_memory):
statement_reconcile_obj = self.pool.get('account.bank.statement.reconcile')
account_coda_obj = self.pool.get('account.coda')
mod_obj = self.pool.get('ir.model.data')
if not context:
context = {}
data = self.read(cr, uid, ids)[0]
codafile = data['coda']
journal_code = journal_obj.browse(cr, uid, data['journal_id'], context).code
@@ -265,6 +267,7 @@ class account_coda_import(osv.osv_memory):
context.update({ 'statment_ids':bkst_list})
model_data_ids = mod_obj.search(cr, uid, [('model', '=', 'ir.ui.view'), ('name', '=', 'account_coda_note_view')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
'name': _('Result'),
'res_id': ids[0],
@@ -277,7 +280,10 @@ class account_coda_import(osv.osv_memory):
'context': context,
'type': 'ir.actions.act_window',
}
def action_open_window(self, cr, uid, data, context):
def action_open_window(self, cr, uid, data, context=None):
if not context:
cotext = {}
return {
'domain':"[('id','in',%s)]"%(context.get('statment_ids', False)),
'name': 'Statement',
@@ -287,6 +293,7 @@ class account_coda_import(osv.osv_memory):
'view_id': False,
'type': 'ir.actions.act_window',
}
account_coda_import()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+5 -6
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,14 +15,13 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import followup
import followup_report
import account_followup
import account_followup_report
import wizard
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+7 -8
View File
@@ -19,7 +19,6 @@
#
##############################################################################
{
'name': 'Accounting follow-ups management',
'version': '1.0',
@@ -36,11 +35,10 @@
It will generate a PDF with all the letters according the the
different levels of recall defined. You can define different policies
for different companies.
for different companies. You can send also mail to the customer.
Note that if you want to change the followup level for a given partner/account entry, you can do it in the menu:
Financial Management/Reporting/Follow-Ups/All receivable entries
Accounting/Reporting/Follow-Ups/All receivable entries
""",
'author': 'Tiny',
@@ -50,13 +48,14 @@
'update_xml': [
'security/ir.model.access.csv',
'wizard/account_followup_print_view.xml',
'followup_report_view.xml',
'followup_view.xml',
'followup_data.xml'
'account_followup_report.xml',
'account_followup_view.xml',
'account_followup_data.xml'
],
'demo_xml': ['followup_demo.xml'],
'demo_xml': ['account_followup_demo.xml'],
'installable': True,
'active': False,
'certificate': '0072481076453',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -23,13 +23,17 @@ from osv import fields, osv
class followup(osv.osv):
_name = 'account_followup.followup'
_description = 'Follow-Up'
_description = 'Account Follow Up'
_columns = {
'name': fields.char('Name', size=64, required=True),
'description': fields.text('Description'),
'followup_line': fields.one2many('account_followup.followup.line', 'followup_id', 'Follow-Up'),
'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account_followup.followup', context=c),
}
followup()
class followup_line(osv.osv):
@@ -42,26 +46,27 @@ class followup_line(osv.osv):
'start': fields.selection([('days','Net Days'),('end_of_month','End of Month')], 'Type of Term', size=64, required=True),
'followup_id': fields.many2one('account_followup.followup', 'Follow Ups', required=True, ondelete="cascade"),
'description': fields.text('Printed Message', translate=True),
}
}
followup_line()
class account_move_line(osv.osv):
_name = 'account.move.line'
_inherit = 'account.move.line'
_columns = {
'followup_line_id': fields.many2one('account_followup.followup.line', 'Follow-up Level'),
'followup_date': fields.date('Latest Follow-up'),
}
}
account_move_line()
class res_company(osv.osv):
_inherit = "res.company"
_columns = {
'follow_up_msg' : fields.text('Follow-up Message', translate=True),
}
}
_defaults = {
'overdue_msg': lambda *a: '''
'overdue_msg': '''
Date : %(date)s
Dear %(partner_name)s,
@@ -75,8 +80,8 @@ Thanks,
%(user_signature)s
%(company_name)s
'''
}
}
res_company()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_followup_followup_line_tree" model="ir.ui.view">
<field name="name">account_followup.followup.line.tree</field>
<field name="model">account_followup.followup.line</field>
@@ -15,40 +15,39 @@
</tree>
</field>
</record>
<record id="view_account_followup_followup_line_form" model="ir.ui.view">
<field name="name">account_followup.followup.line.form</field>
<field name="model">account_followup.followup.line</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Follow-Up Lines">
<field name="sequence" select="1"/>
<field name="name" select="1"/>
<field name="delay" select="1"/>
<field name="start" select="1"/>
<field name="sequence"/>
<field name="name" />
<field name="delay" />
<field name="start" />
<newline/>
<field colspan="4" name="description" select="1"/>
<field colspan="4" name="description" />
<separator string="Legend" colspan="4"/>
<label string="%%(partner_name)s: Partner name" colspan="2"/>
<label string="%%(partner_name)s: Partner Name" colspan="2"/>
<label string="%%(date)s: Current Date" colspan="2"/>
<label string="%%(user_signature)s: User name" colspan="2"/>
<label string="%%(company_name)s: User's Company name" colspan="2"/>
<label string="%%(user_signature)s: User Name" colspan="2"/>
<label string="%%(company_name)s: User's Company Name" colspan="2"/>
</form>
</field>
</record>
<record id="view_account_followup_followup_form" model="ir.ui.view">
<field name="name">account_followup.followup.form</field>
<field name="model">account_followup.followup</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Follow-Up">
<field name="name" select="1"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="name" />
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<separator colspan="4" string="Description"/>
<field colspan="4" name="description" nolabel="1" select="1"/>
<separator colspan="4" string="Lines"/>
<field colspan="4" name="description" nolabel="1" />
<separator colspan="4" string="Followup Lines"/>
<field colspan="4" name="followup_line" nolabel="1"/>
</form>
</field>
@@ -66,17 +65,30 @@
</field>
</record>
<record id="view_account_followup_filter" model="ir.ui.view">
<field name="name">account.followup.select</field>
<field name="model">account_followup.followup</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Followup">
<group col="10" colspan="4">
<field name="name"/>
</group>
</search>
</field>
</record>
<record id="action_account_followup_definition_form" model="ir.actions.act_window">
<field name="name">Follow-Ups</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account_followup.followup</field>
<field name="search_view_id" ref="view_account_followup_filter"/>
<field name="view_type">form</field>
</record>
<menuitem action="action_account_followup_definition_form" id="account_followup_menu" parent="account.menu_finance_configuration"/>
<report auto="False" id="account_followup_followup_report" menu="False" model="account_followup.followup" name="account_followup.followup.print" rml="account_followup/report/rappel.rml" string="Followup Report"/>
<record id="account_move_line_partner_tree" model="ir.ui.view">
<field name="name">account.move.line.partner.tree</field>
<field name="model">account.move.line</field>
@@ -99,7 +111,7 @@
</tree>
</field>
</record>
<record id="view_move_line_form" model="ir.ui.view">
<field name="name">account.move.line.form.followup</field>
<field name="model">account.move.line</field>
@@ -111,7 +123,7 @@
</field>
</field>
</record>
<record id="view_move_line_tree" model="ir.ui.view">
<field name="name">account.move.line.tree.followup</field>
<field name="model">account.move.line</field>
@@ -123,17 +135,17 @@
</field>
</field>
</record>
<act_window domain="[('partner_id', '=', active_id),('reconcile_id','=',False),('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="account.act_account_partner_account_move_unreconciled" name="Receivables &amp; Payables" res_model="account.move.line" view="account_move_line_partner_tree"/>
<act_window domain="[('reconcile_id', '=', False),('account_id.type','=','receivable')]" id="act_account_partner_account_move_all" name="All receivable entries" res_model="account.move.line" src_model="" view="account_move_line_partner_tree"/>
<menuitem action="act_account_partner_account_move_all" id="menu_account_move_open_unreconcile" parent="account_followup.menu_action_followup_stat"/>
<act_window domain="[('reconcile_id', '=', False), ('account_id.type','=','payable')]" id="act_account_partner_account_move_payable_all" name="All payable entries" res_model="account.move.line" src_model="" view="account_move_line_partner_tree"/>
<menuitem action="act_account_partner_account_move_payable_all" id="menu_account_move_open_unreconcile_payable" parent="account_followup.menu_action_followup_stat"/>
<record model="ir.ui.view" id="view_company_inherit_followup_form">
<field name="name">res.company.followup.form.inherit</field>
<field name="inherit_id" ref="account.view_company_inherit_form"/>
@@ -146,5 +158,6 @@
</field>
</field>
</record>
</data>
</openerp>
+10 -10
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-11-17 09:32+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-07-07 09:15+0000\n"
"Last-Translator: Bojan Markovic <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-22 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-07-08 03:50+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_followup
@@ -29,7 +29,7 @@ msgstr "Partneri"
#. module: account_followup
#: rml:account_followup.followup.print:0
msgid "Customer Ref :"
msgstr ""
msgstr "Refernca kupca:"
#. module: account_followup
#: model:ir.actions.act_window,name:account_followup.act_account_partner_account_move_payable_all
@@ -102,7 +102,7 @@ msgstr ""
#. module: account_followup
#: wizard_view:account_followup.followup.print.all,next:0
msgid "%(followup_amount)s: Total Amount Due"
msgstr ""
msgstr "%(followup_amount): Ukupan dospjeli iznos"
#. module: account_followup
#: view:account_followup.followup.line:0
@@ -280,12 +280,12 @@ msgstr "Linije"
#: model:ir.actions.wizard,name:account_followup.action_account_followup_all_wizard
#: model:ir.ui.menu,name:account_followup.account_followup_wizard_menu
msgid "Send followups"
msgstr ""
msgstr "Pošaljite napomene"
#. module: account_followup
#: field:account.move.line,followup_line_id:0
msgid "Follow-up Level"
msgstr ""
msgstr "Stupanj napomene"
#. module: account_followup
#: field:account_followup.stat,credit:0
@@ -331,7 +331,7 @@ msgstr ""
#. module: account_followup
#: wizard_view:account_followup.followup.print.all,next:0
msgid "%(company_currency)s: User's Company Currency"
msgstr ""
msgstr "%(company_currency): Valuta poduzeća korisnika"
#. module: account_followup
#: field:account_followup.stat,balance:0
@@ -412,7 +412,7 @@ msgstr "Dospijeće"
#. module: account_followup
#: model:ir.actions.report.xml,name:account_followup.account_followup_followup_report
msgid "Followup Report"
msgstr ""
msgstr "Izvještaj o napomenama"
#. module: account_followup
#: model:account_followup.followup.line,description:account_followup.demo_followup_line3
@@ -454,7 +454,7 @@ msgstr "Sekvenca"
#. module: account_followup
#: wizard_view:account_followup.followup.print.all,next:0
msgid "%(heading)s: Move line header"
msgstr ""
msgstr "%(heading)s: Zaglavlje retka izmjena"
#. module: account_followup
#: view:account_followup.followup.line:0
@@ -30,12 +30,12 @@ class report_rappel(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(report_rappel, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'time' : time,
'time': time,
'ids_to_objects': self._ids_to_objects,
'adr_get' : self._adr_get,
'getLines' : self._lines_get,
'get_text' : self._get_text
})
'adr_get': self._adr_get,
'getLines': self._lines_get,
'get_text': self._get_text
})
def _ids_to_objects(self, partners_ids):
pool = pooler.get_pool(self.cr.dbname)
@@ -91,10 +91,8 @@ class report_rappel(report_sxw.rml_parse):
return text
report_sxw.report_sxw('report.account_followup.followup.print',
'res.partner', 'addons/account_followup/report/rappel.rml',
parser=report_rappel)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -34,25 +34,32 @@ class account_followup_print(osv.osv_memory):
}
def _get_followup(self, cr, uid, context=None):
if context is None:
context = {}
if context.get('active_model', 'ir.ui.menu') == 'account_followup.followup':
return context.get('active_id', False)
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
tmp = self.pool.get('account_followup.followup').search(cr, uid, [('company_id', '=', company_id)])
return tmp and tmp[0] or False
followp_id = self.pool.get('account_followup.followup').search(cr, uid, [('company_id', '=', company_id)], context=context)
return followp_id and followp_id[0] or False
def do_continue(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
data = self.read(cr, uid, ids, [])[0]
model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
context.update({'followup_id': data['followup_id'], 'date':data['date']})
return {
'name': _('Select partners'),
'view_type': 'form',
'context': context,
'view_mode': 'tree,form',
'res_model': 'account.followup.print.all',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
'name': _('Select Partners'),
'view_type': 'form',
'context': context,
'view_mode': 'tree,form',
'res_model': 'account.followup.print.all',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
_defaults = {
@@ -74,10 +81,12 @@ class account_followup_print_all(osv.osv_memory):
'summary': fields.text('Summary', required=True, readonly=True)
}
def _get_summary(self, cr, uid, context=None):
if context is None:
context = {}
return context.get('summary', '')
def _get_partners(self, cr, uid, context=None):
return self._get_partners_followp(cr, uid, [], context)['partner_ids']
return self._get_partners_followp(cr, uid, [], context=context)['partner_ids']
def _get_msg(self, cr, uid, context=None):
return self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.follow_up_msg
@@ -168,6 +177,9 @@ class account_followup_print_all(osv.osv_memory):
move_obj = self.pool.get('account.move.line')
user_obj = self.pool.get('res.users')
line_obj = self.pool.get('account_followup.stat')
if context is None:
context = {}
data = self.read(cr, uid, ids, [])[0]
model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all_msg')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
@@ -252,8 +264,9 @@ class account_followup_print_all(osv.osv_memory):
context.update({'summary': summary})
else:
context.update({'summary': '\n\n\nE-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard.'})
return {
'name': _('Summary'),
'name': _('Follwoup Summary'),
'view_type': 'form',
'context': context,
'view_mode': 'tree,form',
@@ -265,6 +278,8 @@ class account_followup_print_all(osv.osv_memory):
}
def do_print(self, cr, uid, ids, context=None):
if context is None:
context = {}
data = self.read(cr, uid, ids, [])[0]
res = self._get_partners_followp(cr, uid, ids, context)['to_update']
to_update = res
@@ -284,6 +299,7 @@ class account_followup_print_all(osv.osv_memory):
'model': 'account_followup.followup',
'form': data
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'account_followup.followup.print',
@@ -2,17 +2,6 @@
<openerp>
<data noupdate="0">
<!--<wizard string="Send followups"
name="account_followup.followup.print.all"
id="action_account_followup_all_wizard"
model="account_followup.followup" />
<menuitem action="action_account_followup_all_wizard"
id="account_followup_wizard_menu"
parent="account.menu_finance_periodical_processing"
type="wizard" />-->
<record id="view_account_followup_print" model="ir.ui.view">
<field name="name">account.followup.print.form</field>
<field name="model">account.followup.print</field>
+57 -56
View File
@@ -7,172 +7,173 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-02-03 06:45+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-07-07 09:53+0000\n"
"Last-Translator: Bojan Markovic <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-22 04:10+0000\n"
"X-Launchpad-Export-Date: 2010-07-08 03:50+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
msgid "Sub Total"
msgstr ""
msgstr "Suma"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Invoice Date:"
msgstr ""
msgstr "Datum Fakture:"
#. module: account_invoice_layout
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
"Naziv objekta mora počinjati sa x_ i ne smije sadržavati specijalne znakove!"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Cancelled Invoice"
msgstr ""
msgstr "Poništena faktura"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
#: field:notify.message,name:0
msgid "Title"
msgstr ""
msgstr "Naslov"
#. module: account_invoice_layout
#: model:ir.actions.wizard,name:account_invoice_layout.wizard_notify_message
msgid "Invoices with Layout and Message"
msgstr ""
msgstr "Fakture sa izgledom i porukom"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Disc. (%)"
msgstr ""
msgstr "Rab. (%)"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "(Incl. taxes):"
msgstr ""
msgstr "(Uklj. porez):"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
msgid "Note"
msgstr ""
msgstr "Bilješka"
#. module: account_invoice_layout
#: wizard_button:wizard.notify_message,init,print:0
msgid "Print"
msgstr ""
msgstr "Ispis"
#. module: account_invoice_layout
#: help:notify.message,msg:0
msgid ""
"This notification will appear at the bottom of the Invoices when printed."
msgstr ""
msgstr "Ova napomena će se pojaviti na dnu fakture prilikom ispisa."
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Unit Price"
msgstr ""
msgstr "Jedinična cijena"
#. module: account_invoice_layout
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Neispravan naziv modela u definiciji zadatka."
#. module: account_invoice_layout
#: model:ir.model,name:account_invoice_layout.model_notify_message
msgid "Notify By Messages"
msgstr ""
msgstr "Napomeni po porukama"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "PRO-FORMA"
msgstr ""
msgstr "PRO-FORMA"
#. module: account_invoice_layout
#: field:account.invoice,abstract_line_ids:0
msgid "Invoice Lines"
msgstr ""
msgstr "Stavke fakture"
#. module: account_invoice_layout
#: view:account.invoice.line:0
msgid "Seq."
msgstr ""
msgstr "Sek."
#. module: account_invoice_layout
#: model:ir.ui.menu,name:account_invoice_layout.menu_finan_config_notify_message
msgid "Notification Message"
msgstr ""
msgstr "Poruka napomene"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Customer Ref:"
msgstr ""
msgstr "Referenca kupca"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid ")"
msgstr ""
msgstr ")"
#. module: account_invoice_layout
#: field:account.invoice.line,state:0
msgid "Type"
msgstr ""
msgstr "Vrsta"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Price"
msgstr ""
msgstr "Cijena"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "/ ("
msgstr ""
msgstr "/ ("
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Taxes:"
msgstr ""
msgstr "Porezi:"
#. module: account_invoice_layout
#: field:account.invoice.line,functional_field:0
msgid "Source Account"
msgstr ""
msgstr "Izvorni konto"
#. module: account_invoice_layout
#: model:ir.actions.act_window,name:account_invoice_layout.notify_mesage_tree_form
msgid "Write Messages"
msgstr ""
msgstr "Unesi poruke"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Base"
msgstr ""
msgstr "Osnovica"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Fax :"
msgstr ""
msgstr "Fax :"
#. module: account_invoice_layout
#: field:notify.message,msg:0
msgid "Special Message"
msgstr ""
msgstr "Posebna poruka"
#. module: account_invoice_layout
#: view:notify.message:0
msgid "Write a notification or a wishful message."
msgstr ""
msgstr "Unesi napomenu ili molbu."
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Tel. :"
msgstr ""
msgstr "Tel. :"
#. module: account_invoice_layout
#: constraint:ir.ui.view:0
@@ -187,77 +188,77 @@ msgstr ""
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Document:"
msgstr ""
msgstr "Dokument:"
#. module: account_invoice_layout
#: wizard_view:wizard.notify_message,init:0
msgid "Select Message"
msgstr ""
msgstr "Odaberi poruku"
#. module: account_invoice_layout
#: view:notify.message:0
msgid "Messages"
msgstr ""
msgstr "Poruke"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
msgid "Product"
msgstr ""
msgstr "Proizvod"
#. module: account_invoice_layout
#: model:ir.actions.report.xml,name:account_invoice_layout.account_invoices_1
msgid "Invoices with Layout"
msgstr ""
msgstr "Fakture sa izgledom"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Description / Taxes"
msgstr ""
msgstr "Opis / Porezi"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Amount"
msgstr ""
msgstr "Iznos"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Description/Taxes"
msgstr ""
msgstr "Opis/Porezi"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Draft Invoice"
msgstr ""
msgstr "Predračun"
#. module: account_invoice_layout
#: field:account.invoice.line,sequence:0
msgid "Sequence Number"
msgstr ""
msgstr "Broj sekvence"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Quantity"
msgstr ""
msgstr "Količina"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Refund"
msgstr ""
msgstr "Povrat"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "VAT :"
msgstr ""
msgstr "PDV :"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
msgid "Separator Line"
msgstr ""
msgstr "Linija za razdvajanje"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Supplier Invoice"
msgstr ""
msgstr "Faktura dobavljača"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
@@ -267,7 +268,7 @@ msgstr ""
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Tax"
msgstr ""
msgstr "Porez"
#. module: account_invoice_layout
#: model:ir.module.module,shortdesc:account_invoice_layout.module_meta_information
@@ -277,34 +278,34 @@ msgstr ""
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Total (Excl. taxes):"
msgstr ""
msgstr "Ukupno (bez poreza):"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Invoice"
msgstr ""
msgstr "Faktura"
#. module: account_invoice_layout
#: wizard_button:wizard.notify_message,init,end:0
msgid "Cancel"
msgstr ""
msgstr "Poništi"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Supplier Refund"
msgstr ""
msgstr "Povrat dobavljača"
#. module: account_invoice_layout
#: wizard_field:wizard.notify_message,init,message:0
msgid "Message"
msgstr ""
msgstr "Poruka"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Total"
msgstr ""
msgstr "Ukupno"
#. module: account_invoice_layout
#: model:ir.ui.menu,name:account_invoice_layout.menu_notify_mesage_tree_form
msgid "All Notification Messages"
msgstr ""
msgstr "Sve napomene"
@@ -299,8 +299,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account.view_bank_statement_form"/>
<field name="arch" type="xml">
<group colspan="2" col="3" position="inside">
<button name="%(action_account_populate_statement_confirm)d" string="Import payment lines" type="action" icon="gtk-open"/>
<group col="6" colspan="4" position="inside">
<button colspan="2" name="%(action_account_populate_statement_confirm)d" string="Import payment lines" type="action" icon="gtk-open"/>
</group>
</field>
</record>
+14 -14
View File
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-02-03 07:29+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-07-07 09:59+0000\n"
"Last-Translator: Bojan Markovic <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-22 03:55+0000\n"
"X-Launchpad-Export-Date: 2010-07-08 03:50+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_report
@@ -41,7 +41,7 @@ msgstr ""
#. module: account_report
#: field:account.report.report,parent_id:0
msgid "Parent"
msgstr ""
msgstr "Sintetika"
#. module: account_report
#: field:account.report.report,disp_graph:0
@@ -56,7 +56,7 @@ msgstr ""
#. module: account_report
#: selection:account.report.report,type:0
msgid "Others"
msgstr ""
msgstr "Ostali"
#. module: account_report
#: view:account.report.report:0
@@ -76,7 +76,7 @@ msgstr ""
#. module: account_report
#: view:account.report.report:0
msgid "= Goodness Indicator Limit:"
msgstr ""
msgstr "= Limit indikatora dobrote:"
#. module: account_report
#: view:account.report.report:0
@@ -87,7 +87,7 @@ msgstr ""
#: field:account.report.history,val:0
#: field:account.report.report,amount:0
msgid "Value"
msgstr ""
msgstr "Vrijednost"
#. module: account_report
#: view:account.report.report:0
@@ -133,12 +133,12 @@ msgstr ""
#. module: account_report
#: view:account.report.report:0
msgid "Report Amount:"
msgstr ""
msgstr "Iznos izvještaja:"
#. module: account_report
#: model:ir.actions.report.xml,name:account_report.fiscal_statements
msgid "Fiscal Statements"
msgstr ""
msgstr "Fiskalni izvod"
#. module: account_report
#: wizard_button:print.indicators,init,next:0
@@ -148,7 +148,7 @@ msgstr ""
#. module: account_report
#: model:ir.module.module,shortdesc:account_report.module_meta_information
msgid "Reporting for accounting"
msgstr ""
msgstr "Izvještavanje za računovodstvo"
#. module: account_report
#: wizard_button:print.indicators,next,print:0
@@ -164,7 +164,7 @@ msgstr ""
#. module: account_report
#: model:ir.actions.report.xml,name:account_report.report_indicator_pdf
msgid "Print Indicators in PDF"
msgstr ""
msgstr "Ispiši indikatore u PDF"
#. module: account_report
#: view:account.report.report:0
@@ -249,7 +249,7 @@ msgstr ""
#. module: account_report
#: selection:account.report.report,status:0
msgid "Normal"
msgstr ""
msgstr "Normalno"
#. module: account_report
#: view:account.report.report:0
@@ -284,7 +284,7 @@ msgstr ""
#. module: account_report
#: rml:print.indicators:0
msgid "Expression :"
msgstr ""
msgstr "Izraz :"
#. module: account_report
#: view:account.report.report:0
@@ -294,7 +294,7 @@ msgstr ""
#. module: account_report
#: field:account.report.report,expression:0
msgid "Expression"
msgstr ""
msgstr "Izraz"
#. module: account_report
#: view:account.report.report:0
@@ -113,7 +113,6 @@ class accounting_report_indicator(report_sxw.rml_parse):
else:
temp_head = [str(x[0:3]) for x in self.header_name]
head_dict = dict(zip(temp_head,temp_head))
print "head_dict",head_dict
return [head_dict]
def getarray(self,data,object,array_header=''):
+11 -11
View File
@@ -7,19 +7,19 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-02-03 08:09+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-07-07 09:23+0000\n"
"Last-Translator: Bojan Markovic <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-22 04:15+0000\n"
"X-Launchpad-Export-Date: 2010-07-08 03:50+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_reporting
#: field:color.rml,code:0
msgid "code"
msgstr ""
msgstr "šifra"
#. module: account_reporting
#: constraint:ir.model:0
@@ -61,7 +61,7 @@ msgstr ""
#. module: account_reporting
#: selection:account.report.bs,font_style:0
msgid "Courier"
msgstr ""
msgstr "Courier"
#. module: account_reporting
#: selection:account.report.bs,font_style:0
@@ -98,7 +98,7 @@ msgstr ""
#. module: account_reporting
#: selection:account.report.bs,report_type:0
msgid "Report Objects With Accounts"
msgstr ""
msgstr "Objekti izvještaja sa kontima"
#. module: account_reporting
#: selection:account.report.bs,font_style:0
@@ -144,12 +144,12 @@ msgstr ""
#. module: account_reporting
#: selection:account.report.bs,font_style:0
msgid "Courier-Bold"
msgstr ""
msgstr "Courier-Bold"
#. module: account_reporting
#: selection:account.report.bs,font_style:0
msgid "Times-Italic"
msgstr ""
msgstr "Times-Italic"
#. module: account_reporting
#: selection:account.report.bs,report_type:0
@@ -184,12 +184,12 @@ msgstr ""
#. module: account_reporting
#: selection:account.report.bs,font_style:0
msgid "Times-Bold"
msgstr ""
msgstr "Times-Bold"
#. module: account_reporting
#: view:account.report.bs:0
msgid "General"
msgstr ""
msgstr "Općenito"
#. module: account_reporting
#: wizard_field:account.account.balancesheet.report,init,fiscalyear:0
@@ -205,7 +205,7 @@ msgstr ""
#. module: account_reporting
#: wizard_field:account.account.balancesheet.report,init,periods:0
msgid "Periods"
msgstr ""
msgstr "Periodi"
#. module: account_reporting
#: field:account.report.bs,color_back:0
@@ -40,4 +40,5 @@ This module implement the modification on the invoice form.
'active': False,
'certificate': '0070514190381',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -21,7 +21,6 @@
import time
from osv import fields, osv
import decimal_precision as dp
class account_invoice(osv.osv):
_inherit = "account.invoice"
@@ -117,7 +116,7 @@ class account_invoice_line(osv.osv):
return super(account_invoice_line, self)._price_unit_default(cr, uid, context)
return 0
def _get_invoice(self, cr, uid, ids, context):
def _get_invoice(self, cr, uid, ids, context=None):
result = {}
for inv in self.pool.get('account.invoice').browse(cr, uid, ids, context=context):
for line in inv.invoice_line:
@@ -126,9 +125,9 @@ class account_invoice_line(osv.osv):
_columns = {
'price_subtotal': fields.function(_amount_line2, method=True, string='Subtotal w/o tax', multi='amount',
store={'account.invoice':(_get_invoice,['price_type'],10), 'account.invoice.line': (lambda self, cr, uid, ids, c={}: ids, None,10)}),
store={'account.invoice':(_get_invoice,['price_type'], 10), 'account.invoice.line': (lambda self, cr, uid, ids, c={}: ids, None,10)}),
'price_subtotal_incl': fields.function(_amount_line2, method=True, string='Subtotal', multi='amount',
store={'account.invoice':(_get_invoice,['price_type'],10), 'account.invoice.line': (lambda self, cr, uid, ids, c={}: ids, None,10)}),
store={'account.invoice':(_get_invoice,['price_type'], 10), 'account.invoice.line': (lambda self, cr, uid, ids, c={}: ids, None,10)}),
}
_defaults = {
+3 -8
View File
@@ -31,15 +31,10 @@
""",
"category" : "Generic Modules/Accounting",
"website" : "http://tinyerp.com",
"depends" : [
"base",
"account"
],
"init_xml" : [
],
"depends" : ["account"],
"init_xml" : [],
"demo_xml" : [
],
"demo_xml" : [],
"update_xml" : [
"security/ir.model.access.csv",
+6 -14
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -41,7 +41,6 @@ class rml_parse(report_sxw.rml_parse):
})
def comma_me(self,amount):
#print "#" + str(amount) + "#"
if not amount:
amount = 0.0
if type(amount) is float :
@@ -56,14 +55,14 @@ class rml_parse(report_sxw.rml_parse):
return new
else:
return self.comma_me(new)
def _ellipsis(self, string, maxlen=100, ellipsis = '...'):
ellipsis = ellipsis or ''
try:
return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen]
except Exception, e:
return False
def _strip_name(self, name, maxlen=50):
return self._ellipsis(name, maxlen, '...')
@@ -100,14 +99,13 @@ class rml_parse(report_sxw.rml_parse):
try:
Stringer = str.encode("utf-16")
except UnicodeDecodeError:
print "UTF_16 Error"
Stringer = str
else:
return Stringer
else:
return Stringer
return Stringer
def explode_this(self,chaine,length):
#chaine = self.repair_string(chaine)
chaine = rstrip(chaine)
@@ -118,20 +116,18 @@ class rml_parse(report_sxw.rml_parse):
i = i + length
chaine = str("".join(ast))
return chaine
def repair_string(self,chaine):
ast = list(chaine)
UnicodeAst = []
_previouslyfound = False
i = 0
#print str(ast)
while i < len(ast):
elem = ast[i]
try:
Stringer = elem.encode("utf-8")
except UnicodeDecodeError:
to_reencode = elem + ast[i+1]
print str(to_reencode)
Good_char = to_reencode.decode('utf-8')
UnicodeAst.append(Good_char)
i += i +2
@@ -141,17 +137,13 @@ class rml_parse(report_sxw.rml_parse):
return "".join(UnicodeAst)
def ReencodeAscii(self,str):
print sys.stdin.encoding
try:
Stringer = str.decode("ascii")
except UnicodeEncodeError:
print "REENCODING ERROR"
return str.encode("ascii")
except UnicodeDecodeError:
print "DECODING ERROR"
return str.encode("ascii")
else:
print Stringer
return Stringer
def _add_header(self, node, header=1):
@@ -1,7 +1,5 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_account_voucher_user","account.voucher","model_account_voucher","account.group_account_user",1,0,0,0
"access_account_voucher_line_user","account.voucher.line","model_account_voucher_line","account.group_account_user",1,0,0,0
"access_account_open_voucher_user","account.open.voucher","model_account_open_voucher","account.group_account_user",1,0,0,0
"access_account_voucher_manager","account.voucher","model_account_voucher","account.group_account_manager",1,1,1,1
"access_account_voucher_line_manager","account.voucher.line","model_account_voucher_line","account.group_account_manager",1,1,1,1
"access_account_open_voucher_manager","account.open.voucher","model_account_open_voucher","account.group_account_manager",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_voucher_user account.voucher model_account_voucher account.group_account_user 1 0 0 0
3 access_account_voucher_line_user account.voucher.line model_account_voucher_line account.group_account_user 1 0 0 0
access_account_open_voucher_user account.open.voucher model_account_open_voucher account.group_account_user 1 0 0 0
4 access_account_voucher_manager account.voucher model_account_voucher account.group_account_manager 1 1 1 1
5 access_account_voucher_line_manager account.voucher.line model_account_voucher_line account.group_account_manager 1 1 1 1
access_account_open_voucher_manager account.open.voucher model_account_open_voucher account.group_account_manager 1 1 1 1
+164 -401
View File
@@ -20,14 +20,17 @@
##############################################################################
import time
import netsvc
from osv import fields
from osv import osv
import ir
import pooler
import mx.DateTime
from mx.DateTime import RelativeDateTime
from tools import config
journal2type = {
'cash':'rec_voucher',
'bank':'bank_rec_voucher',
'cash':'pay_voucher',
'sale':'journal_sale_vou',
'purchase':'journal_pur_voucher',
'general':'journal_voucher'
}
type2journal = {
'rec_voucher': 'cash',
@@ -51,7 +54,7 @@ ir_sequence_type()
class account_journal(osv.osv):
_inherit = "account.journal"
_columns = {
'max_amount': fields.float('Verify Transaction', digits=(16, int(config['price_accuracy'])), help="Validate voucher entry twice before posting it, if transection amount more then entered here"),
'max_amount': fields.float('Verify Transaction', digits=(16, 2), help="Validate voucher entry twice before posting it, if transection amount more then entered here"),
}
account_journal()
@@ -68,8 +71,9 @@ class account_voucher(osv.osv):
return False
def _get_type(self, cr, uid, context={}):
type = context.get('type', 'bank_rec_voucher')
return type
vtype = context.get('type', 'bank')
voucher_type = journal2type.get(vtype)
return voucher_type
def _get_reference_type(self, cursor, user, context=None):
return [('none', 'Free Reference')]
@@ -91,15 +95,15 @@ class account_voucher(osv.osv):
return False
def _get_currency(self, cr, uid, context):
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid)
user = self.pool.get('res.users').browse(cr, uid, uid)
if user.company_id:
return user.company_id.currency_id.id
else:
return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
_name = 'account.voucher'
_description = 'Accounting Voucher'
_order = "number"
_order = "id desc"
_columns = {
'name':fields.char('Name', size=256, required=True, readonly=True, states={'draft':[('readonly',False)]}),
'type': fields.selection([
@@ -107,7 +111,7 @@ class account_voucher(osv.osv):
('bank_pay_voucher','Bank Payment'),
('rec_voucher','Cash Receipt'),
('bank_rec_voucher','Bank Receipt'),
('cont_voucher','Contra'),
# ('cont_voucher','Contra'),
('journal_sale_vou','Journal Sale'),
('journal_pur_voucher','Journal Purchase'),
('journal_voucher','Journal Voucher'),
@@ -117,7 +121,7 @@ class account_voucher(osv.osv):
'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}, domain=[('type','<>','view')]),
'payment_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=False, states={'proforma':[('readonly',True)]}),
'period_id': fields.many2one('account.period', 'Period', required=True, readonly=True, states={'posted':[('readonly',True)]}),
'narration':fields.text('Narration', readonly=True, states={'draft':[('readonly',False)]}, required=True),
'narration':fields.text('Narration', readonly=True, states={'draft':[('readonly',False)]}, required=False),
'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'company_id': fields.many2one('res.company', 'Company', required=True),
'state':fields.selection(
@@ -133,10 +137,10 @@ class account_voucher(osv.osv):
\n* The \'Posted\' state is used when user create voucher,a voucher number is generated and voucher entries are created in account \
\n* The \'Cancelled\' state is used when user cancel voucher.'),
'amount':fields.float('Amount', readonly=True),
'number':fields.char('Number', size=32, readonly=True),
'reference': fields.char('Voucher Reference', size=64),
'reference_type': fields.selection(_get_reference_type, 'Reference Type',
required=True),
'number': fields.related('move_id', 'name', type="char", readonly=True, string='Number'),
'move_id':fields.many2one('account.move', 'Account Entry'),
'move_ids':fields.many2many('account.move.line', 'voucher_id', 'account_id', 'rel_account_move', 'Real Entry'),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True, states={'draft':[('readonly',False)]})
@@ -147,24 +151,17 @@ class account_voucher(osv.osv):
'type': _get_type,
'journal_id':_get_journal,
'currency_id': _get_currency,
'state': lambda *a: 'draft',
'date' : lambda *a: time.strftime('%Y-%m-%d'),
'reference_type': lambda *a: "none",
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.voucher',context=c),
}
# def _get_analityc_lines(self, cr, uid, id):
# inv = self.browse(cr, uid, [id])[0]
# cur_obj = self.pool.get('res.currency')
def onchange_account(self, cr, uid, ids, account_id):
if not account_id:
return {
'value':{'amount':False}
}
account = self.pool.get('account.account').browse(cr, uid, account_id)
balance=account.balance
return {
@@ -176,7 +173,6 @@ class account_voucher(osv.osv):
return {
'value':{'account_id':False}
}
journal = self.pool.get('account.journal')
if journal_id and (type in ('rec_voucher','bank_rec_voucher','journal_pur_voucher','journal_voucher')):
@@ -196,30 +192,45 @@ class account_voucher(osv.osv):
}
def open_voucher(self, cr, uid, ids, context={}):
obj = self.pool.get('account.voucher').browse(cr, uid, ids)
voucher = self.pool.get('account.voucher').browse(cr, uid, ids)[0]
total = 0
for i in obj[0].payment_ids:
total += i.amount
for line in voucher.payment_ids:
total += line.amount
if total != 0:
self.write(cr, uid, ids, {'amount':total, 'state':'proforma'})
res = {
'amount':total,
'state':'proforma'
}
self.write(cr, uid, ids, res)
else:
raise osv.except_osv('Invalid action !', 'You cannot post to Pro-Forma a voucher with Total amount = 0 !')
return True
def proforma_voucher(self, cr, uid, ids, context={}):
self.action_number(cr, uid, ids)
self.action_move_line_create(cr, uid, ids)
self.write(cr, uid, ids, {'state':'posted'})
return True
def cancel_voucher(self, cr, uid, ids, context={}):
self.action_cancel(cr, uid, ids)
self.write(cr, uid, ids, {'state':'cancel'})
return True
def action_cancel_draft(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state':'draft'})
return True
def cancel_voucher(self, cr, uid, ids, context={}):
move_pool = self.pool.get('account.move')
for voucher in self.browse(cr, uid, ids):
if voucher.move_id:
move_pool.button_cancel(cr, uid, [voucher.move_id.id])
move_pool.unlink(cr, uid, [voucher.move_id.id])
res = {
'state':'cancel',
'move_id':False,
'move_ids':[(6, 0,[])]
}
self.write(cr, uid, ids, res)
return True
def unlink(self, cr, uid, ids, context=None):
vouchers = self.read(cr, uid, ids, ['state'])
@@ -231,237 +242,126 @@ class account_voucher(osv.osv):
raise osv.except_osv('Invalid action !', 'Cannot delete Voucher(s) which are already opened or paid !')
return super(account_voucher, self).unlink(cr, uid, unlink_ids, context=context)
def _get_analytic_lines(self, cr, uid, id):
inv = self.browse(cr, uid, [id])[0]
cur_obj = self.pool.get('res.currency')
company_currency = inv.company_id.currency_id.id
if inv.type in ('rec_voucher'):
sign = 1
else:
sign = -1
iml = self.pool.get('account.voucher.line').move_line_get(cr, uid, inv.id)
for il in iml:
if il['account_analytic_id']:
if inv.type in ('pay_voucher', 'rec_voucher','cont_voucher','bank_pay_voucher','bank_rec_voucher','journal_sale_vou','journal_pur_voucher'):
ref = inv.reference
else:
ref = self._convert_ref(cr, uid, inv.number)
il['analytic_lines'] = [(0, 0, {
'name': il['name'],
'date': inv['date'],
'account_id': il['account_analytic_id'],
'amount': inv['amount'] * sign,
'general_account_id': il['account_id'] or False,
'journal_id': self.pool.get('account.voucher').browse(cr, uid, id).journal_id.analytic_journal_id.id or False,
'ref': ref,
})]
return iml
def action_move_line_create(self, cr, uid, ids, *args):
journal_pool = self.pool.get('account.journal')
sequence_pool = self.pool.get('ir.sequence')
move_pool = self.pool.get('account.move')
move_line_pool = self.pool.get('account.move.line')
analytic_pool = self.pool.get('account.analytic.line')
currency_pool = self.pool.get('res.currency')
for inv in self.browse(cr, uid, ids):
if inv.move_id:
continue
company_currency = inv.company_id.currency_id.id
line_ids = self.read(cr, uid, [inv.id], ['payment_ids'])[0]['payment_ids']
ils = self.pool.get('account.voucher.line').read(cr, uid, line_ids)
iml = self._get_analytic_lines(cr, uid, inv.id)
diff_currency_p = inv.currency_id.id <> company_currency
total = 0
if inv.type in ('pay_voucher', 'journal_voucher', 'rec_voucher','cont_voucher','bank_pay_voucher','bank_rec_voucher','journal_sale_vou','journal_pur_voucher'):
ref = inv.reference
else:
ref = self._convert_ref(cr, uid, inv.number)
acc_id = None
date = inv.date
total_currency = 0
acc_id = None
for i in iml:
partner_id=i['partner_id']
acc_id = i['account_id']
if inv.currency_id.id != company_currency:
i['currency_id'] = inv.currency_id.id
i['amount_currency'] = i['amount']
else:
i['amount_currency'] = False
i['currency_id'] = False
if inv.type in ('rec_voucher','bank_rec_voucher','journal_pur_voucher','journal_voucher'):
total += i['amount']
total_currency += i['amount_currency'] or i['amount']
i['amount'] = - i['amount']
else:
total -= i['amount']
total_currency -= i['amount_currency'] or i['amount']
name = inv['name'] or '/'
totlines = False
iml.append({
'type': 'dest',
'name': name,
'amount': total or False,
'account_id': acc_id,
'amount_currency': diff_currency_p \
and total_currency or False,
'currency_id': diff_currency_p \
and inv.currency_id.id or False,
'ref': ref,
'partner_id':partner_id or False,
})
date = inv.date
inv.amount=total
line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x,date, context={})) ,iml)
an_journal_id=inv.journal_id.analytic_journal_id.id
journal_id = inv.journal_id.id
journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
ref = inv.reference
journal = journal_pool.browse(cr, uid, inv.journal_id.id)
if journal.sequence_id:
name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
name = sequence_pool.get_id(cr, uid, journal.sequence_id.id)
move = {
'name' : name,
'journal_id': journal_id,
'journal_id': journal.id,
'type' : inv.type,
'narration' : inv.narration,
'narration' : inv.narration and inv.narration or inv.name,
'date':inv.date
}
if inv.period_id:
move['period_id'] = inv.period_id.id
for i in line:
i[2]['period_id'] = inv.period_id.id
move_id = self.pool.get('account.move').create(cr, uid, move)
ref = move['name']
amount=0.0
#create the first line our self
move.update({
'period_id': inv.period_id.id
})
move_id = move_pool.create(cr, uid, move)
#create the first line manually
move_line = {
'name': inv.name,
'debit': False,
'credit':False,
'account_id': inv.account_id.id or False,
'move_id':move_id ,
'journal_id':journal_id ,
'period_id':inv.period_id.id,
'move_id': move_id ,
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
'partner_id': False,
'ref': ref,
'date': inv.date
}
if diff_currency_p:
amount_currency = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.amount)
inv.amount = amount_currency
move_line.update({
'amount_currency':amount_currency,
'currency_id':inv.currency_id.id
})
if inv.type in ('rec_voucher', 'bank_rec_voucher', 'journal_pur_voucher', 'journal_voucher'):
move_line['debit'] = inv.amount
else:
move_line['credit'] = inv.amount * (-1)
self.pool.get('account.move.line').create(cr, uid, move_line)
move_line['credit'] = inv.amount
line_ids = []
line_ids += [move_line_pool.create(cr, uid, move_line)]
for line in inv.payment_ids:
amount=0.0
move_line = {
'name':line.name,
'debit':False,
'credit':False,
'account_id':line.account_id.id or False,
'move_id':move_id ,
'journal_id':journal_id ,
'period_id':inv.period_id.id,
'partner_id':line.partner_id.id or False,
'ref':ref,
'date':inv.date
}
if line.type == 'dr':
move_line['debit'] = line.amount or False
amount=line.amount
elif line.type == 'cr':
move_line['credit'] = line.amount or False
amount=line.amount * (-1)
move_line['analytic_account_id'] = line.account_analytic_id.id or False
ml_id=self.pool.get('account.move.line').create(cr, uid, move_line)
if inv.narration:
line.name = inv.narration
else:
line.name = line.name
'name': line.name,
'debit': False,
'credit': False,
'account_id': line.account_id.id or False,
'move_id': move_id ,
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
'partner_id': line.partner_id.id or False,
'ref': ref,
'date': inv.date,
'analytic_account_id': False
}
if diff_currency_p:
amount_currency = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, line.amount)
line.amount = amount_currency
move_line.update({
'amount_currency':amount_currency,
'currency_id':inv.currency_id.id
})
if line.account_analytic_id:
an_line = {
'name':line.name,
'date':inv.date,
'amount':amount,
'account_id':line.account_analytic_id.id or False,
'move_id':ml_id,
'journal_id':an_journal_id ,
'general_account_id':line.account_id.id,
'ref':ref
}
self.pool.get('account.analytic.line').create(cr, uid, an_line)
self.write(cr, uid, [inv.id], {'move_id': move_id})
obj=self.pool.get('account.move').browse(cr, uid, move_id)
for line in obj.line_id :
cr.execute('insert into voucher_id (account_id,rel_account_move) values (%d, %d)',(int(ids[0]),int(line.id)))
move_line.update({
'analytic_account_id':line.account_analytic_id.id
})
if line.type == 'dr':
move_line.update({
'debit': line.amount or False
})
amount = line.amount
elif line.type == 'cr':
move_line.update({
'credit': line.amount or False
})
amount = line.amount * (-1)
move_line_id = move_line_pool.create(cr, uid, move_line)
line_ids += [move_line_id]
rec = {
'move_id': move_id,
'move_ids':[(6, 0,line_ids)]
}
self.write(cr, uid, [inv.id], rec)
return True
def line_get_convert(self, cr, uid, x, date, context={}):
return {
'date':date,
'date_maturity': x.get('date_maturity', False),
'partner_id':x.get('partner_id',False),
'name':x['name'][:64],
'debit':x['amount']>0 and x['amount'],
'credit':x['amount']<0 and -x['amount'],
'account_id':x['account_id'],
'analytic_lines':x.get('analytic_lines', []),
'amount_currency':x.get('amount_currency', False),
'currency_id':x.get('currency_id', False),
'tax_code_id': x.get('tax_code_id', False),
'tax_amount': x.get('tax_amount', False),
'ref':x.get('ref',False)
}
def _convert_ref(self, cr, uid, ref):
return (ref or '').replace('/','')
def action_number(self, cr, uid, ids, *args):
cr.execute('SELECT id, type, number, move_id, reference ' \
'FROM account_voucher ' \
'WHERE id IN %s',(tuple(ids),))
for (id, invtype, number, move_id, reference) in cr.fetchall():
if not number:
number = self.pool.get('ir.sequence').get(cr, uid, invtype)
if type in ('pay_voucher', 'journal_voucher', 'rec_voucher','cont_voucher','bank_pay_voucher','bank_rec_voucher','journal_sale_vou','journal_pur_voucher'):
ref = reference
else:
ref = self._convert_ref(cr, uid, number)
cr.execute('UPDATE account_voucher SET number=%s ' \
'WHERE id=%s', (number, id))
cr.execute('UPDATE account_move_line SET ref=%s ' \
'WHERE move_id=%s AND (ref is null OR ref = \'\')',
(ref, move_id))
cr.execute('UPDATE account_analytic_line SET ref=%s ' \
'FROM account_move_line ' \
'WHERE account_move_line.move_id = %s ' \
'AND account_analytic_line.move_id = account_move_line.id',
(ref, move_id))
return True
def name_get(self, cr, uid, ids, context={}):
if not len(ids):
return []
@@ -498,19 +398,6 @@ class account_voucher(osv.osv):
default['date'] = time.strftime('%Y-%m-%d')
return super(account_voucher, self).copy(cr, uid, id, default, context)
def action_cancel(self, cr, uid, ids, *args):
account_move_obj = self.pool.get('account.move')
voucher = self.read(cr, uid, ids, ['move_id'])
for i in voucher:
if i['move_id']:
account_move_obj.button_cancel(cr, uid, [i['move_id'][0]])
# delete the move this invoice was pointing to
# Note that the corresponding move_lines and move_reconciles
# will be automatically deleted too
account_move_obj.unlink(cr, uid, [i['move_id'][0]])
self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})
return True
account_voucher()
class account_voucher_line(osv.osv):
@@ -530,176 +417,52 @@ class account_voucher_line(osv.osv):
'type': lambda *a: 'cr'
}
def move_line_get(self, cr, uid, voucher_id, context={}):
res = []
cur_obj = self.pool.get('res.currency')
inv = self.pool.get('account.voucher').browse(cr, uid, voucher_id)
company_currency = inv.company_id.currency_id.id
cur = inv.currency_id
for line in inv.payment_ids:
res.append(self.move_line_get_item(cr, uid, line, context))
return res
def onchange_partner(self, cr, uid, ids, partner_id, ttype ,type1):
vals = {}
if not partner_id:
return {'value' : {'account_id' : False, 'type' : False ,'amount':False}}
obj = self.pool.get('res.partner')
vals.update({
'account_id': False,
'type': False ,
'amount': False
})
return {
'value' : vals
}
partner_pool = self.pool.get('res.partner')
account_id = False
partner = partner_pool.browse(cr, uid, partner_id)
if type1 in ('rec_voucher','bank_rec_voucher', 'journal_voucher'):
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
balance = obj.browse(cr,uid,partner_id).credit
account_id = partner.property_account_receivable.id
balance = partner.credit
ttype = 'cr'
elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
account_id = obj.browse(cr, uid, partner_id).property_account_payable
balance = obj.browse(cr,uid,partner_id).debit
account_id = partner.property_account_payable.id
balance = partner.debit
ttype = 'dr'
elif type1 in ('journal_sale_vou') :
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
balance = obj.browse(cr,uid,partner_id).credit
account_id = partner.property_account_receivable.id
balance = partner.credit
ttype = 'dr'
elif type1 in ('journal_pur_voucher') :
account_id = obj.browse(cr, uid, partner_id).property_account_payable
balance = obj.browse(cr,uid,partner_id).debit
account_id = partner.property_account_payable.id
balance = partner.debit
ttype = 'cr'
vals.update({
'account_id': account_id,
'type': ttype,
'amount':balance
})
return {
'value' : {'account_id' : account_id.id, 'type' : ttype, 'amount':balance}
'value' : vals
}
def onchange_amount(self, cr, uid, ids, partner_id, amount, type, type1):
if not amount:
return {'value' : {}}
if partner_id:
obj = self.pool.get('res.partner')
if type1 in ('rec_voucher', 'bank_rec_voucher', 'journal_voucher'):
if amount < 0 :
account_id = obj.browse(cr, uid, partner_id).property_account_payable
type = 'dr'
else:
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
type = 'cr'
elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
if amount < 0 :
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
type = 'cr'
else:
account_id = obj.browse(cr, uid, partner_id).property_account_payable
type = 'dr'
elif type1 in ('journal_sale_vou') :
if amount < 0 :
account_id = obj.browse(cr, uid, partner_id).property_account_payable
type = 'cr'
else:
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
type = 'dr'
elif type1 in ('journal_pur_voucher') :
if amount< 0 :
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
type = 'dr'
else:
account_id = obj.browse(cr, uid, partner_id).property_account_payable
type = 'cr'
else:
if type1 in ('rec_voucher', 'bank_rec_voucher', 'journal_voucher'):
if amount < 0 :
type = 'dr'
else:
type = 'cr'
elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
if amount < 0 :
type = 'cr'
else:
type = 'dr'
elif type1 in ('journal_sale_vou') :
if amount < 0 :
type = 'cr'
else:
type = 'dr'
elif type1 in ('journal_pur_voucher') :
if amount< 0 :
type = 'dr'
else:
type = 'cr'
return {
'value' : { 'type' : type , 'amount':amount}
}
def onchange_type(self, cr, uid, ids, partner_id, amount, type, type1):
if partner_id:
obj = self.pool.get('res.partner')
if type1 in ('rec_voucher','bank_rec_voucher', 'journal_voucher'):
if type == 'dr' :
account_id = obj.browse(cr, uid, partner_id).property_account_payable
total=amount*(-1)
else:
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
total=amount*(-1)
elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
if type == 'cr' :
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
total=amount*(-1)
else:
account_id = obj.browse(cr, uid, partner_id).property_account_payable
total=amount*(-1)
elif type1 in ('journal_sale_vou') :
if type == 'cr' :
account_id = obj.browse(cr, uid, partner_id).property_account_payable
total=amount*(-1)
else:
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
total=amount*(-1)
elif type1 in ('journal_pur_voucher') :
if type == 'dr' :
account_id = obj.browse(cr, uid, partner_id).property_account_receivable
total=amount*(-1)
else:
account_id = obj.browse(cr, uid, partner_id).property_account_payable
total=amount*(-1)
else:
if type1 in ('rec_voucher','bank_rec_voucher', 'journal_voucher'):
if type == 'dr' :
total=amount*(-1)
else:
total=amount*(-1)
elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
if type == 'cr' :
total=amount*(-1)
else:
total=amount*(-1)
elif type1 in ('journal_sale_vou') :
if type == 'cr' :
total=amount*(-1)
else:
total=amount*(-1)
elif type1 in ('journal_pur_voucher') :
if type == 'dr' :
total=amount*(-1)
else:
total=amount*(-1)
return {
'value' : {'type' : type , 'amount':total}
}
def move_line_get_item(self, cr, uid, line, context={}):
return {
'type':'src',
'name': line.name[:64],
'amount':line.amount,
'account_id':line.account_id.id,
'partner_id':line.partner_id.id or False ,
'account_analytic_id':line.account_analytic_id.id or False,
'ref' : line.ref
}
account_voucher_line()
+20 -19
View File
@@ -35,32 +35,19 @@
</group>
<notebook colspan="4">
<page string="Journal Entries">
<field name="payment_ids" colspan="4" nolabel="1" height="260">
<field name="payment_ids" colspan="4" nolabel="1" height="250">
<tree string="Voucher Lines" editable="top">
<field name="account_analytic_id"/>
<field name="partner_id" on_change="onchange_partner(partner_id,type,parent.type)"/>
<field name="account_id"/>
<field name="name"/>
<field name="type"/>
<field name="amount"/>
<field name="account_analytic_id"/>
<field name="ref"/>
</tree>
</field>
<separator string="Narration" colspan="4"/>
<field name="narration" colspan="4" nolabel="1" height="50"/>
<group col="6" colspan="6">
<group col="2" colspan="2">
<field name="state"/>
</group>
<group col="8" colspan="4">
<button name="open_voucher" string="Pro-forma" states="draft" icon="terp-check"/>
<button name="proforma_voucher" string="Create" states="proforma" icon="terp-document-new"/>
<button name="recheck_voucher" string="Validate" states="recheck" icon="terp-check"/>
<button name="audit_complete" string="Audit Pass" states="posted" icon="terp-check"/>
<button name="cancel_voucher" string="Cancel" states="proforma,recheck,posted" icon="gtk-cancel"/>
<button name="cancel_to_draft" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
</group>
</group>
</page>
<page string="Other Info">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
@@ -71,6 +58,15 @@
<field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
</page>
</notebook>
<group col="8" colspan="4">
<field name="state"/>
<button name="open_voucher" string="Pro-forma" states="draft" icon="terp-check"/>
<button name="proforma_voucher" string="Create" states="proforma" icon="terp-document-new"/>
<button name="recheck_voucher" string="Validate" states="recheck" icon="terp-check"/>
<button name="audit_complete" string="Audit Pass" states="posted" icon="terp-check"/>
<button name="cancel_voucher" string="Cancel" states="proforma,recheck,posted" icon="gtk-cancel"/>
<button name="cancel_to_draft" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>
</record>
@@ -136,14 +132,15 @@
</field>
</record>
<!-- Receipt Vouchers -->
<!-- Receipt Vouchers -->
<record model="ir.actions.act_window" id="action_receipt_vou_voucher_list">
<field name="name">Customer Vouchers</field>
<field name="name">Receivable Vouchers</field>
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="view_voucher_tree"/>
<field name="domain">[('journal_id.type','=','sale')]</field>
<field name="context">{'type':'sale'}</field>
<field name="search_view_id" ref="view_voucher_filter_new"/>
</record>
<menuitem id="menu_action_receipt_vou_voucher_list"
@@ -151,12 +148,13 @@
<!-- Purchase Vouchers -->
<record model="ir.actions.act_window" id="action_pay_vou_voucher_list">
<field name="name">Vendor Vouchers</field>
<field name="name">Payable Vouchers</field>
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="view_voucher_tree"/>
<field name="domain">[('journal_id.type','=','purchase')]</field>
<field name="context">{'type':'purchase'}</field>
<field name="search_view_id" ref="view_voucher_filter_new"/>
</record>
<menuitem id="menu_action_pay_vou_voucher_list"
@@ -168,6 +166,7 @@
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'type':'general'}</field>
<field name="view_id" eval="view_voucher_tree"/>
<field name="search_view_id" ref="view_voucher_filter"/>
</record>
@@ -179,10 +178,12 @@
<field name="res_model">account.voucher</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('journal_id.type', '=', 'bank')]</field>
<field name="context">{'type':'bank'}</field>
<field name="view_id" ref="view_voucher_tree"/>
<field name="search_view_id" ref="view_voucher_filter_new"/>
<field name="domain">[('journal_id.type', '=', 'bank')]</field>
</record>
<menuitem action="action_cheque_register" id="menu_action_cheque_register" parent="account.menu_finance_bank_and_cash"/>
<record model="ir.ui.view" id="view_account_journal_form_inherit">
+1 -1
View File
@@ -41,7 +41,7 @@
<record id="act_cancel" model="workflow.activity">
<field name="wkf_id" ref="wkf"/>
<field name="name">cancel</field>
<field name="action">write({'state':'cancel'})</field>
<field name="action">cancel_voucher()</field>
<field name="kind">function</field>
</record>
@@ -38,170 +38,127 @@ class account_voucher(osv.osv):
def action_move_line_create(self, cr, uid, ids, *args):
journal_pool = self.pool.get('account.journal')
sequence_pool = self.pool.get('ir.sequence')
move_pool = self.pool.get('account.move')
move_line_pool = self.pool.get('account.move.line')
analytic_pool = self.pool.get('account.analytic.line')
currency_pool = self.pool.get('res.currency')
invoice_pool = self.pool.get('account.invoice')
for inv in self.browse(cr, uid, ids):
if inv.move_id:
continue
company_currency = inv.company_id.currency_id.id
line_ids = self.read(cr, uid, [inv.id], ['payment_ids'])[0]['payment_ids']
ils = self.pool.get('account.voucher.line').read(cr, uid, line_ids)
iml = self._get_analytic_lines(cr, uid, inv.id)
diff_currency_p = inv.currency_id.id <> company_currency
total = 0
if inv.type in ('pay_voucher', 'journal_voucher', 'rec_voucher','cont_voucher','bank_pay_voucher','bank_rec_voucher','journal_sale_voucher','journal_pur_voucher'):
ref = inv.reference
else:
ref = self._convert_ref(cr, uid, inv.number)
date = inv.date
total_currency = 0
for i in iml:
partner_id=i['partner_id']
acc_id = i['account_id']
if inv.currency_id.id != company_currency:
i['currency_id'] = inv.currency_id.id
i['amount_currency'] = i['amount']
else:
i['amount_currency'] = False
i['currency_id'] = False
if inv.type in ('rec_voucher','bank_rec_voucher','journal_pur_voucher','journal_voucher'):
total += i['amount']
total_currency += i['amount_currency'] or i['amount']
i['amount'] = - i['amount']
else:
total -= i['amount']
total_currency -= i['amount_currency'] or i['amount']
name = inv['name'] or '/'
totlines = False
iml.append({
'type': 'dest',
'name': name,
'amount': total or False,
'account_id': acc_id,
'amount_currency': diff_currency_p \
and total_currency or False,
'currency_id': diff_currency_p \
and inv.currency_id.id or False,
'ref': ref,
'partner_id':partner_id or False,
})
date = inv.date
inv.amount=total
line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x,date, context={})) ,iml)
an_journal_id=inv.journal_id.analytic_journal_id.id
journal_id = inv.journal_id.id
journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
ref = inv.reference
journal = journal_pool.browse(cr, uid, inv.journal_id.id)
if journal.sequence_id:
name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
name = sequence_pool.get_id(cr, uid, journal.sequence_id.id)
move = {
'name': name,
'journal_id': journal_id,
'voucher_type':inv.type,
'narration' : inv.narration,
'data':date
'name' : name,
'journal_id': journal.id,
'type' : inv.type,
'narration' : inv.narration and inv.narration or inv.name,
'date':inv.date
}
if inv.period_id:
move['period_id'] = inv.period_id.id
for i in line:
i[2]['period_id'] = inv.period_id.id
move_id = self.pool.get('account.move').create(cr, uid, move)
ref=move['name']
amount=0.0
#create the first line our self
move.update({
'period_id': inv.period_id.id
})
move_id = move_pool.create(cr, uid, move)
#create the first line manually
move_line = {
'name': inv.name,
'voucher_invoice' : iml and iml[0]['invoice'] and iml[0]['invoice'].id or False,
'debit': False,
'credit':False,
'account_id': inv.account_id.id or False,
'move_id':move_id ,
'journal_id':journal_id ,
'period_id':inv.period_id.id,
'move_id': move_id ,
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
'partner_id': False,
'ref': ref,
'date': date
'date': inv.date
}
if diff_currency_p:
amount_currency = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.amount)
inv.amount = amount_currency
move_line.update({
'amount_currency':amount_currency,
'currency_id':inv.currency_id.id
})
if inv.type in ('rec_voucher', 'bank_rec_voucher', 'journal_pur_voucher', 'journal_voucher'):
move_line['debit'] = inv.amount
else:
move_line['credit'] = inv.amount * (-1)
self.pool.get('account.move.line').create(cr, uid, move_line)
id_mapping_dict = {}
mline_ids = []
for line in inv.voucher_line_ids:
move_line['credit'] = inv.amount
line_ids = []
line_ids += [move_line_pool.create(cr, uid, move_line)]
for line in inv.payment_ids:
amount=0.0
move_line = {
'name':line.name,
'voucher_invoice' : iml and iml[0]['invoice'] and iml[0]['invoice'].id or False,
'debit':False,
'credit':False,
'move_id':move_id,
'account_id':line.account_id.id or False,
'journal_id':journal_id ,
'period_id':inv.period_id.id,
'partner_id':line.partner_id.id or False,
'ref':ref,
'date':date
}
if line.type == 'dr':
move_line['debit'] = line.amount or False
amount=line.amount
elif line.type == 'cr':
move_line['credit'] = line.amount or False
amount=line.amount * (-1)
ml_id=self.pool.get('account.move.line').create(cr, uid, move_line)
id_mapping_dict[line.id] = ml_id
total = 0.0
mline = self.pool.get('account.move.line')
if line.invoice_id.id:
invoice = self.pool.get('account.invoice').browse(cr, uid, line.invoice_id.id)
src_account_id = invoice.account_id.id
cr.execute('select id from account_move_line where move_id in ('+str(invoice.move_id.id)+')')
temp_ids = map(lambda x: x[0], cr.fetchall())
temp_ids.append(ml_id)
mlines = mline.browse(cr, uid, temp_ids)
for ml in mlines:
if ml.account_id.id==src_account_id:
mline_ids.append(ml.id)
total += (ml.debit or 0.0) - (ml.credit or 0.0)
#end if line.invoice_id.id:
if inv.narration:
line.name=inv.narration
else:
line.name=line.name
'name': line.name,
'debit': False,
'credit': False,
'account_id': line.account_id.id or False,
'move_id': move_id ,
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
'partner_id': line.partner_id.id or False,
'ref': ref,
'date': inv.date,
'analytic_account_id': False
}
if diff_currency_p:
amount_currency = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, line.amount)
line.amount = amount_currency
move_line.update({
'amount_currency':amount_currency,
'currency_id':inv.currency_id.id
})
if line.account_analytic_id:
an_line = {
'name':line.name,
'date':date,
'amount':amount,
'account_id':line.account_analytic_id.id or False,
'move_id':ml_id,
'journal_id':an_journal_id ,
'general_account_id':line.account_id.id,
'ref':ref
}
self.pool.get('account.analytic.line').create(cr, uid, an_line)
if mline_ids:
self.pool.get('account.move.line').reconcile_partial(cr, uid, mline_ids, 'manual', context={})
self.write(cr, uid, [inv.id], {'move_id': move_id})
obj=self.pool.get('account.move').browse(cr, uid, move_id)
for line in obj.line_id :
cr.execute('insert into voucher_id (account_id,rel_account_move) values (%d, %d)',(int(ids[0]),int(line.id)))
return True
move_line.update({
'analytic_account_id':line.account_analytic_id.id
})
if line.type == 'dr':
move_line.update({
'debit': line.amount or False
})
amount = line.amount
elif line.type == 'cr':
move_line.update({
'credit': line.amount or False
})
amount = line.amount
if line.invoice_id:
move_line.update({
'invoice_id':line.invoice_id.id
})
invoice_pool.pay_and_reconcile(cr, uid, [line.invoice_id.id], amount, inv.account_id.id, inv.period_id.id, inv.journal_id.id, False, False, False)
move_line_id = move_line_pool.create(cr, uid, move_line)
line_ids += [move_line_id]
rec = {
'move_id': move_id,
'move_ids':[(6, 0,line_ids)]
}
self.write(cr, uid, [inv.id], rec)
return True
account_voucher()
@@ -222,18 +179,29 @@ class account_voucher_line(osv.osv):
res['invoice'] = line.invoice_id or False
return res
def onchange_invoice_id(self, cr, uid, ids, invoice_id, context={}):
lines = []
if 'lines' in self.voucher_context:
lines = [x[2] for x in self.voucher_context['lines']]
def onchange_invoice_id(self, cr, uid, ids, invoice_id, currency_id):
currency_pool = self.pool.get('res.currency')
invoice_pool = self.pool.get('account.invoice')
res = {
'amount':0.0
}
if not invoice_id:
return {'value':{}}
return {
'value':res
}
else:
invoice_obj = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context)
residual = invoice_obj.residual
same_invoice_amounts = [x['amount'] for x in lines if x['invoice_id']==invoice_id]
residual -= sum(same_invoice_amounts)
return {'value' : {'amount':residual}}
invoice = invoice_pool.browse(cr, uid, invoice_id)
residual = invoice.residual
if invoice.currency_id.id != currency_id:
residual = currency_pool.compute(cr, uid, invoice.currency_id.id, currency_id, invoice.residual)
res.update({
'amount': residual
})
return {
'value':res
}
def onchange_line_account(self, cr, uid, ids, account_id, type, type1):
if not account_id:
@@ -1,21 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Voucher line extension
-->
<record id="view_voucher_form" model="ir.ui.view">
<field name="name">account.voucher.line.form.inherit</field>
<field name="model">account.voucher.line</field>
<field name="type">form</field>
<field name="inherit_id" ref="account_voucher.view_voucher_form"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="invoice_id" on_change="onchange_invoice_id(invoice_id)" domain="[('partner_id','=',partner_id),('state','=','open')]"/>
</field>
</field>
</record>
<record id="view_voucher_form" model="ir.ui.view">
<field name="name">account.voucher.form.inherit</field>
<field name="model">account.voucher</field>
@@ -23,15 +8,15 @@
<field name="inherit_id" ref="account_voucher.view_voucher_form"/>
<field name="arch" type="xml">
<field name="payment_ids" position="replace">
<field name="voucher_line_ids" default_get="{'lines': voucher_line_ids }" colspan="4" nolabel="1" height="275">
<field name="voucher_line_ids" default_get="{'lines': voucher_line_ids}" colspan="4" nolabel="1" height="275">
<tree string="Voucher Lines" editable="top">
<field name="account_analytic_id"/>
<field name="partner_id" on_change="onchange_partner(partner_id, type, parent.type)"/>
<field name="account_id" on_change="onchange_line_account(account_id, type, parent.type)"/>
<field name="name"/>
<field name="invoice_id" on_change="onchange_invoice_id(invoice_id)" domain="[('partner_id','=',partner_id),('state','=','open'),('residual','&gt;',0.0)]"/>
<field name="invoice_id" on_change="onchange_invoice_id(invoice_id, parent.currency_id)" domain="[('partner_id','=',partner_id),('state','=','open'),('residual','&gt;',0.0)]"/>
<field name="type"/>
<field name="amount"/>
<field name="account_analytic_id"/>
<field name="ref"/>
</tree>
</field>
@@ -1,3 +1 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_account_voucher_unreconcile_user","account.voucher.unreconcile","model_account_voucher_unreconcile","account.group_account_user",1,0,0,0
"access_account_voucher_unreconcile_manager","account.voucher.unreconcile","model_account_voucher_unreconcile","account.group_account_manager",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_account_voucher_unreconcile_user account.voucher.unreconcile model_account_voucher_unreconcile account.group_account_user 1 0 0 0
access_account_voucher_unreconcile_manager account.voucher.unreconcile model_account_voucher_unreconcile account.group_account_manager 1 1 1 1
@@ -27,20 +27,20 @@ class account_voucher_unreconcile(osv.osv_memory):
def trans_unrec(self, cr, uid, ids, context=None):
if context is None:
context = {}
obj_voucher = self.pool.get('account.voucher')
obj_reconcile = self.pool.get('account.move.reconcile')
voucher_pool = self.pool.get('account.voucher')
reconcile_pool = self.pool.get('account.move.reconcile')
if context.get('active_id'):
voucher = obj_voucher.browse(cr, uid, context.get('active_id'), context=context)
recs = []
for line in voucher.move_ids:
if line.reconcile_id:
recs = [line.reconcile_id.id]
for rec in recs:
obj_reconcile.unlink(cr, uid, rec)
return {}
account_voucher_unreconcile()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -2,28 +2,36 @@
<openerp>
<data>
<record id="view_account_voucher_unreconcile" model="ir.ui.view">
<record id="view_account_voucher_unreconcile" model="ir.ui.view">
<field name="name">Account voucher unreconcile</field>
<field name="model">account.voucher.unreconcile</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Unreconciliation">
<separator colspan="4" string="Unreconciliation transactions" />
<label string="If you unreconciliate transactions, you must also verify all the actions that are linked to those transactions because they will not be disable" colspan="2"/>
<separator colspan="4"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="trans_unrec" default_focus="1" string="Unreconcile" type="object" icon="gtk-ok"/>
<separator colspan="4" string="Unreconciliation transactions" />
<label string="If you unreconciliate transactions, you must also verify all the actions that are linked to those transactions because they will not be disable" colspan="2"/>
<separator colspan="4"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="trans_unrec" default_focus="1" string="Unreconcile" type="object" icon="gtk-ok"/>
</form>
</field>
</record>
<act_window name="Unreconcile entries"
res_model="account.voucher.unreconcile"
src_model="account.voucher"
view_mode="form"
target="new"
key2="client_action_multi"
id="action_view_account_voucher_unreconcile"/>
</record>
<record model="ir.actions.act_window" id="action_view_account_voucher_unreconcile">
<field name="name">Unreconcile entries</field>
<field name="res_model">account.voucher.unreconcile</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_account_voucher_unreconcile"/>
<field name="target">new</field>
</record>
<!-- <act_window name="Unreconcile entries" -->
<!-- res_model="account.voucher.unreconcile"-->
<!-- src_model="account.voucher"-->
<!-- view_mode="form"-->
<!-- target="new" -->
<!-- key2="client_action_multi" -->
<!-- id="action_view_account_voucher_unreconcile"/>-->
</data>
</openerp>
</openerp>
+1 -1
View File
@@ -26,7 +26,7 @@
'category': 'Profile',
'description': """This module is to create Profile for Associates""",
'author': 'Tiny',
'depends': ['membership', 'board_association'],
'depends': ['membership', 'event'],
'update_xml': ['security/ir.model.access.csv', 'profile_association.xml'],
'demo_xml': [],
'installable': True,
+1 -4
View File
@@ -22,7 +22,6 @@
from osv import fields, osv
import pooler
class profile_association_config_install_modules_wizard(osv.osv_memory):
_name='profile.association.config.install_modules_wizard'
_inherit = 'res.config.installer'
@@ -30,9 +29,7 @@ class profile_association_config_install_modules_wizard(osv.osv_memory):
_columns = {
'hr_expense':fields.boolean('Expenses Tracking', help="Tracks the personal expenses process, from the employee expense encoding, to the reimbursement of the employee up to the reinvoicing to the final customer."),
'project':fields.boolean('Project Management'),
'board_document':fields.boolean('Document Management', help= "The Document Management System of Open ERP allows you to store, browse, automatically index, search and preview all kind of documents (internal documents, printed reports, calendar system). It opens an FTP access for the users to easily browse association's document."),
'segmentation':fields.boolean('Segmentation'),
'crm_configuration' : fields.boolean('Partner Relation & Calendars'),
'event_project':fields.boolean('Organization and management of events', help="This module allows you to create retro planning for managing your events."),
'project_gtd':fields.boolean('Getting Things Done',
help="GTD is a methodology to efficiently organise yourself and your tasks. This module fully integrates GTD principle with OpenERP's project management."),
'wiki': fields.boolean('Wiki',
+2 -2
View File
@@ -24,10 +24,10 @@
<field name="project"/>
<field name="project_gtd"/>
<field name="wiki"/>
<separator string="Event Management" colspan="4"/>
<field name="event_project"/>
<separator string="Resources Management" colspan="4"/>
<field name="hr_expense"/>
<separator string="Relationship Management" colspan="4"/>
<field name="crm_configuration"/>
</group>
</data>
</field>
@@ -1,2 +1 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_profile_association_wizard_install","profile association wizard install","model_profile_association_config_install_modules_wizard","base.group_system",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_profile_association_wizard_install profile association wizard install model_profile_association_config_install_modules_wizard base.group_system 1 1 1 1
+8 -9
View File
@@ -177,7 +177,7 @@ class Code128(MultiWidthBarcode):
Code 128 can also encode digits at double density (2 per byte)
and has a mandatory checksum. Code 128 is well supported and
commonly used -- for example, by UPS for tracking labels.
Because of these qualities, Code 128 is probably the best choice
for a linear symbology today (assuming you have a choice).
@@ -185,11 +185,11 @@ class Code128(MultiWidthBarcode):
value (int, or numeric string. required.):
The value to encode.
xdim (float, default .0075):
X-Dimension, or width of the smallest element
Minumum is .0075 inch (7.5 mils).
height (float, see default below):
Height of the symbol. Default is the height of the two
bearer bars (if they exist) plus the greater of .25 inch
@@ -197,14 +197,14 @@ class Code128(MultiWidthBarcode):
quiet (bool, default 1):
Wether to include quiet zones in the symbol.
lquiet (float, see default below):
Quiet zone size to left of code, if quiet is true.
Default is the greater of .25 inch, or 10 xdim
rquiet (float, defaults as above):
Quiet zone size to right left of code, if quiet is true.
Sources of Information on Code 128:
http://www.semiconductor.agilent.com/barcode/sg/Misc/code_128.html
@@ -223,7 +223,7 @@ class Code128(MultiWidthBarcode):
if type(value) is type(1):
value = str(value)
for (k, v) in args.items():
setattr(self, k, v)
@@ -288,12 +288,11 @@ class Code128(MultiWidthBarcode):
if l[1] in tos:
l[:2] = ['START_' + l[1][-1]]
# print `l`
# encode into numbers
start, set, shset = setmap[l[0]]
e = [start]
l = l[1:-1]
while l:
c = l[0]
-2
View File
@@ -34,8 +34,6 @@ def run():
story.append(Extended93("L@@K! Code 93 :-)")) #, xdim=0.005 * inch))
story.append(Paragraph('Code 128', styleN))
c=Code128("AB-12345678") #, xdim=0.005 * inch)
#print 'WIDTH =', (c.width / inch), 'XDIM =', (c.xdim / inch)
#print 'LQ =', (c.lquiet / inch), 'RQ =', (c.rquiet / inch)
story.append(c)
story.append(Paragraph('USPS FIM', styleN))
story.append(FIM("A"))
+1 -2
View File
@@ -58,8 +58,7 @@
<field name="usage">menu</field>
<field name="view_id" ref="board_auction_manager_form"/>
</record>
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem name="Auction" id="menu_board_auction" parent="base.dashboard" />
<menuitem icon="terp-graph" name="Dashboard" id="menu_board_auction" parent="auction_report_menu" sequence="0"/>
<menuitem
name="Auction Member"
action="open_board_auction"
+2 -8
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -132,12 +132,6 @@ class report_custom(report_rml):
# file('/tmp/terp.xml','wb+').write(xml)
# end_time = time.clock()
# print "db:", mid_time-start_time
# print "addition:", mid_time2-mid_time
# print "buyer costs:", mid_time3-mid_time2
# print "seller costs:", mid_time4-mid_time3
# print "rest:", end_time-mid_time4
# print "total:", end_time-start_time
return self.post_process_xml_data(cr, uid, xml, context)
report_custom('report.auction.total', 'auction.lots', '', 'addons/auction/report/total.xsl')
@@ -22,4 +22,3 @@
"access_report_object_encoded","report.object.encoded","model_report_object_encoded","base.group_user",1,0,0,0
"access_report_object_encoded_manager","report.object.encoded.manager","model_report_object_encoded_manager","base.group_user",1,0,0,0
"access_report_unclassified_objects","report.unclassified.objects","model_report_unclassified_objects","base.group_user",1,0,0,0
"access_auction_lots_buyer_map_user","auction_lots_buyer_map_user","model_auction_lots_buyer_map","base.group_user",1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
22 access_report_object_encoded report.object.encoded model_report_object_encoded base.group_user 1 0 0 0
23 access_report_object_encoded_manager report.object.encoded.manager model_report_object_encoded_manager base.group_user 1 0 0 0
24 access_report_unclassified_objects report.unclassified.objects model_report_unclassified_objects base.group_user 1 0 0 0
access_auction_lots_buyer_map_user auction_lots_buyer_map_user model_auction_lots_buyer_map base.group_user 1 0 0 0
+4 -4
View File
@@ -29,14 +29,14 @@ class auction_pay_buy(osv.osv_memory):
_description = "Pay buy"
_columns= {
'amount': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy']))),
'amount': fields.float('Amount paid', digits= (16, 2)),
'buyer_id':fields.many2one('res.partner', 'Buyer'),
'statement_id1':fields.many2one('account.bank.statement', 'Statement', required=True),
'amount2': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy']))),
'amount2': fields.float('Amount paid', digits= (16, 2)),
'statement_id2':fields.many2one('account.bank.statement', 'Statement'),
'amount3': fields.float('Amount paid', digits = (16, int(tools.config['price_accuracy']))),
'amount3': fields.float('Amount paid', digits = (16, 2)),
'statement_id3':fields.many2one('account.bank.statement', 'Statement'),
'total': fields.float('Amount paid', digits = (16, int(tools.config['price_accuracy'])), readonly =True),
'total': fields.float('Amount paid', digits = (16, 2), readonly =True),
}
def default_get(self, cr, uid, fields, context):
+1 -1
View File
@@ -27,7 +27,7 @@ class auction_pay_sel(osv.osv_memory):
_description = "Pay Invoice"
_columns= {
'amount': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy'])), required=True),
'amount': fields.float('Amount paid', digits= (16, 2), required=True),
'dest_account_id':fields.many2one('account.account', 'Payment to Account', required=True, domain= [('type', '=', 'cash')]),
'journal_id':fields.many2one('account.journal', 'Journal', required=True),
'period_id':fields.many2one('account.period', 'Period', required=True),
+10 -19
View File
@@ -21,8 +21,6 @@
from datetime import datetime
from osv import fields, osv, orm
from osv.orm import except_orm
from osv.osv import osv_pool
from tools.translate import _
import mx.DateTime
import pooler
@@ -42,17 +40,14 @@ class base_action_rule(osv.osv):
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param context: A standard dictionary for contextual values """
return self.state_get(cr, uid, context=context)
def state_get(self, cr, uid, context={}):
""" Get State
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param context: A standard dictionary for contextual values """
return [('', '')]
def priority_get(self, cr, uid, context={}):
@@ -61,14 +56,13 @@ class base_action_rule(osv.osv):
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param context: A standard dictionary for contextual values """
return [('', '')]
_columns = {
'name': fields.many2one('ir.model', 'Object', required=True),
'max_level': fields.integer('Max Level', help='Specifies maximum level.'),
'create_date': fields.datetime('Create Date', readonly=1),
'active': fields.boolean('Active', help="If the active field is set to true,\
'active': fields.boolean('Active', help="If the active field is set to False,\
it will allow you to hide the rule without removing it."),
'sequence': fields.integer('Sequence', help="Gives the sequence order \
when displaying a list of rules."),
@@ -85,10 +79,7 @@ specifies you can put a negative number. If you need a delay before the \
trigger date, like sending a reminder 15 minutes before a meeting."),
'trg_date_range_type': fields.selection([('minutes', 'Minutes'), ('hour', 'Hours'), \
('day', 'Days'), ('month', 'Months')], 'Delay type'),
'trg_user_id': fields.many2one('res.users', 'Responsible'),
'trg_partner_id': fields.many2one('res.partner', 'Partner'),
'trg_partner_categ_id': fields.many2one('res.partner.category', 'Partner Category'),
'trg_state_from': fields.selection(_state_get, 'State', size=16),
@@ -136,7 +127,9 @@ the rule to mark CC(mail to any other person defined in actions)."),
def pre_action(self, cr, uid, ids, model, context=None):
# Searching for action rules
cr.execute("SELECT model.model, rule.id FROM base_action_rule rule LEFT JOIN ir_model model on (model.id = rule.name)")
cr.execute("SELECT model.model, rule.id FROM base_action_rule rule \
LEFT JOIN ir_model model on (model.id = rule.name) \
where active")
res = cr.fetchall()
# Check if any rule matching with current object
for obj_name, rule_id in res:
@@ -171,10 +164,9 @@ the rule to mark CC(mail to any other person defined in actions)."),
def _register_hook(self, cr, uid, ids, context=None):
if not context:
context = {}
model_pool = self.pool.get('ir.model')
for action_rule in self.browse(cr, uid, ids, context=context):
model = action_rule.name.model
obj_pool = self.pool.get(model)
obj_pool = self.pool.get(model)
obj_pool.__setattr__('create', self._create(obj_pool.create, model, context=context))
obj_pool.__setattr__('write', self._write(obj_pool.write, model, context=context))
return True
@@ -194,7 +186,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
"""
This Function is call by scheduler.
"""
rule_pool= self.pool.get('base.action.rule')
rule_pool = self.pool.get('base.action.rule')
rule_ids = rule_pool.search(cr, uid, [], context=context)
return self._register_hook(cr, uid, rule_ids, context=context)
@@ -202,7 +194,6 @@ the rule to mark CC(mail to any other person defined in actions)."),
def format_body(self, body):
""" Foramat Action rule's body
@param self: The object pointer """
return body and tools.ustr(body) or ''
def format_mail(self, obj, body):
@@ -392,7 +383,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
obj.date_action_next = dt
model_obj.write(cr, uid, [obj.id], {'date_action_next': dt}, context)
else:
ok = action.trg_date_type=='none'
ok = action.trg_date_type == 'none'
if ok:
self.do_action(cr, uid, action, model_obj, obj, context)
@@ -431,7 +422,7 @@ class ir_cron(osv.osv):
def _poolJobs(self, db_name, check=False):
try:
db, pool = pooler.get_db_and_pool(db_name)
db = pooler.get_db(db_name)
except:
return False
cr = db.cursor()
@@ -439,12 +430,12 @@ class ir_cron(osv.osv):
next = datetime.now().strftime('%Y-%m-%d %H:00:00')
# Putting nextcall always less than current time in order to call it every time
cr.execute('UPDATE ir_cron set nextcall = \'%s\' where numbercall<>0 and active and model=\'base.action.rule\' ' % (next))
cr.commit()
res = super(ir_cron, self)._poolJobs(db_name, check=check)
finally:
cr.commit()
cr.close()
super(ir_cron, self)._poolJobs(db_name, check=check)
ir_cron()
@@ -57,22 +57,18 @@
<field name="server_action_id"/>
</page>
<page string="Email Actions">
<!-- <group col="4" colspan="2">-->
<separator colspan="4" string="Email Reminders"/>
<field name="act_remind_partner"/>
<field name="act_remind_attach"/>
<field name="act_remind_user"/>
<group col="2" colspan="2" attrs="{'invisible': [('act_remind_user','=',False)]}">
<field name="act_reply_to" attrs="{'required':[('act_remind_user','=',True)]}"/>
</group>
<separator colspan="4" string="Email Information"/>
<field name="act_mail_to_watchers"/>
<field name="act_mail_to_user"/>
<field colspan="4" name="act_mail_to_email"/>
<!-- </group>-->
<!-- <group col="4" colspan="2">-->
<separator colspan="4" string="Email Reminders"/>
<field name="act_remind_partner"/>
<field name="act_remind_attach"/>
<field name="act_remind_user"/>
<group col="2" colspan="2" attrs="{'invisible': [('act_remind_user','=',False)]}">
<field name="act_reply_to" attrs="{'required':[('act_remind_user','=',True)]}"/>
</group>
<field name="act_mail_to_watchers"/>
<field colspan="4" name="act_email_cc"/>
<!-- </group>-->
<separator colspan="4" string="Email Body"/>
<field colspan="4" name="act_mail_body" height="250"
nolabel="1" attrs="{'required':[('act_remind_user','=',True)]}" />
@@ -1,3 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_base_action_rule","base.action.rule","model_base_action_rule",,1,0,0,0
"access_base_action_rule_config","base.action.rule config","model_base_action_rule",base.group_system,1,0,0,0
"access_base_action_rule_config","base.action.rule config","model_base_action_rule",base.group_system,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_base_action_rule base.action.rule model_base_action_rule 1 0 0 0
3 access_base_action_rule_config base.action.rule config model_base_action_rule base.group_system 1 0 1 0 1 0 1

Some files were not shown because too many files have changed in this diff Show More