[MEREG] merge from trunk addons
bzr revid: mra@tinyerp.com-20110919072834-rn50vqba6peckztd
This commit is contained in:
+42
-25
@@ -439,8 +439,8 @@ class account_account(osv.osv):
|
||||
|
||||
_constraints = [
|
||||
(_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id']),
|
||||
(_check_type, 'Configuration Error! \nYou cannot define children to an account with internal type different of "View"! ', ['type']),
|
||||
(_check_account_type, 'Configuration Error! \nYou cannot select an account type with a deferral method different of "Unreconciled" for accounts with internal type "Payable/Receivable"! ', ['user_type','type']),
|
||||
(_check_type, 'Configuration Error! \nYou can not define children to an account with internal type different of "View"! ', ['type']),
|
||||
(_check_account_type, 'Configuration Error! \nYou can not select an account type with a deferral method different of "Unreconciled" for accounts with internal type "Payable/Receivable"! ', ['user_type','type']),
|
||||
]
|
||||
_sql_constraints = [
|
||||
('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !')
|
||||
@@ -516,14 +516,14 @@ class account_account(osv.osv):
|
||||
|
||||
if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]):
|
||||
if method == 'write':
|
||||
raise osv.except_osv(_('Error !'), _('You cannot deactivate an account that contains account moves.'))
|
||||
raise osv.except_osv(_('Error !'), _('You can not desactivate an account that contains some journal items.'))
|
||||
elif method == 'unlink':
|
||||
raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. '))
|
||||
raise osv.except_osv(_('Error !'), _('You can not remove an account containing journal items!. '))
|
||||
#Checking whether the account is set as a property to any Partner or not
|
||||
value = 'account.account,' + str(ids[0])
|
||||
partner_prop_acc = self.pool.get('ir.property').search(cr, uid, [('value_reference','=',value)], context=context)
|
||||
if partner_prop_acc:
|
||||
raise osv.except_osv(_('Warning !'), _('You cannot remove/deactivate an account which is set as a property to any Partner.'))
|
||||
raise osv.except_osv(_('Warning !'), _('You can not remove/desactivate an account which is set on a customer or supplier.'))
|
||||
return True
|
||||
|
||||
def _check_allow_type_change(self, cr, uid, ids, new_type, context=None):
|
||||
@@ -536,15 +536,20 @@ class account_account(osv.osv):
|
||||
if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]):
|
||||
#Check for 'Closed' type
|
||||
if old_type == 'closed' and new_type !='closed':
|
||||
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type which contains account entries!"))
|
||||
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type which contains journal items!"))
|
||||
#Check for change From group1 to group2 and vice versa
|
||||
if (old_type in group1 and new_type in group2) or (old_type in group2 and new_type in group1):
|
||||
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from '%s' to '%s' type as it contains account entries!") % (old_type,new_type,))
|
||||
raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from '%s' to '%s' type as it contains journal items!") % (old_type,new_type,))
|
||||
return True
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
if not ids:
|
||||
return True
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
|
||||
# Dont allow changing the company_id when account_move_line already exist
|
||||
if 'company_id' in vals:
|
||||
@@ -657,11 +662,13 @@ class account_journal(osv.osv):
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
for journal in self.browse(cr, uid, ids, context=context):
|
||||
if 'company_id' in vals and journal.company_id.id != vals['company_id']:
|
||||
move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)])
|
||||
if move_lines:
|
||||
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines'))
|
||||
raise osv.except_osv(_('Warning !'), _('You can not modify the company of this journal as its related record exist in journal items'))
|
||||
return super(account_journal, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def create_sequence(self, cr, uid, vals, context=None):
|
||||
@@ -807,8 +814,8 @@ class account_fiscalyear(osv.osv):
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_duration, 'Error! The duration of the Fiscal Year is invalid. ', ['date_stop']),
|
||||
(_check_fiscal_year, 'Error! You cannot define overlapping fiscal years',['date_start', 'date_stop'])
|
||||
(_check_duration, 'Error! The start date of the fiscal year must be before his end date.', ['date_start','date_stop']),
|
||||
(_check_fiscal_year, 'Error! You can not define overlapping fiscal years for the same company.',['date_start', 'date_stop'])
|
||||
]
|
||||
|
||||
def create_period3(self, cr, uid, ids, context=None):
|
||||
@@ -886,7 +893,10 @@ class account_period(osv.osv):
|
||||
'state': 'draft',
|
||||
}
|
||||
_order = "date_start, special desc"
|
||||
|
||||
_sql_constraints = [
|
||||
('name_company_uniq', 'unique(name, company_id)', 'The name of the period must be unique per company!'),
|
||||
]
|
||||
|
||||
def _check_duration(self,cr,uid,ids,context=None):
|
||||
obj_period = self.browse(cr, uid, ids[0], context=context)
|
||||
if obj_period.date_stop < obj_period.date_start:
|
||||
@@ -959,7 +969,7 @@ class account_period(osv.osv):
|
||||
if 'company_id' in vals:
|
||||
move_lines = self.pool.get('account.move.line').search(cr, uid, [('period_id', 'in', ids)])
|
||||
if move_lines:
|
||||
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this period as its related record exist in Entry Lines'))
|
||||
raise osv.except_osv(_('Warning !'), _('You can not modify company of this period as some journal items exists.'))
|
||||
return super(account_period, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def build_ctx_periods(self, cr, uid, period_from_id, period_to_id):
|
||||
@@ -1187,10 +1197,10 @@ class account_move(osv.osv):
|
||||
|
||||
_constraints = [
|
||||
(_check_centralisation,
|
||||
'You cannot create more than one move per period on centralized journal',
|
||||
'You can not create more than one move per period on centralized journal',
|
||||
['journal_id']),
|
||||
(_check_period_journal,
|
||||
'You cannot create entries on different periods/journals in the same move',
|
||||
'You can not create journal items on different periods/journals in the same journal entry',
|
||||
['line_id']),
|
||||
]
|
||||
|
||||
@@ -1201,7 +1211,7 @@ class account_move(osv.osv):
|
||||
valid_moves = self.validate(cr, uid, ids, context)
|
||||
|
||||
if not valid_moves:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('You cannot validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !'))
|
||||
raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !\nMake sure you have configured payment terms properly !\nThe latest payment term line should be of the type "Balance" !'))
|
||||
obj_sequence = self.pool.get('ir.sequence')
|
||||
for move in self.browse(cr, uid, valid_moves, context=context):
|
||||
if move.name =='/':
|
||||
@@ -1237,7 +1247,7 @@ class account_move(osv.osv):
|
||||
if not top:
|
||||
top = account2.id
|
||||
elif top<>account2.id:
|
||||
raise osv.except_osv(_('Error !'), _('You cannot validate a Journal Entry unless all journal items are in same chart of accounts !'))
|
||||
raise osv.except_osv(_('Error !'), _('You can not validate a journal entry unless all journal items belongs to the same chart of accounts !'))
|
||||
return self.post(cursor, user, ids, context=context)
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context=None):
|
||||
@@ -1324,7 +1334,7 @@ class account_move(osv.osv):
|
||||
for move in self.browse(cr, uid, ids, context=context):
|
||||
if move['state'] != 'draft':
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('You can not delete posted movement: "%s"!') % \
|
||||
_('You can not delete a posted journal entry "%s"!') % \
|
||||
move['name'])
|
||||
line_ids = map(lambda x: x.id, move.line_id)
|
||||
context['journal_id'] = move.journal_id.id
|
||||
@@ -1344,7 +1354,7 @@ class account_move(osv.osv):
|
||||
|
||||
def _centralise(self, cr, uid, move, mode, context=None):
|
||||
assert mode in ('debit', 'credit'), 'Invalid Mode' #to prevent sql injection
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
@@ -1606,7 +1616,7 @@ class account_tax_code(osv.osv):
|
||||
(parent_ids,) + where_params)
|
||||
res=dict(cr.fetchall())
|
||||
obj_precision = self.pool.get('decimal.precision')
|
||||
res2 = {}
|
||||
res2 = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
def _rec_get(record):
|
||||
amount = res.get(record.id, 0.0)
|
||||
@@ -1775,6 +1785,9 @@ class account_tax(osv.osv):
|
||||
'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Application', required=True)
|
||||
|
||||
}
|
||||
_sql_constraints = [
|
||||
('name_company_uniq', 'unique(name, company_id)', 'Tax Name must be unique per company!'),
|
||||
]
|
||||
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
|
||||
"""
|
||||
@@ -2133,7 +2146,11 @@ class account_model(osv.osv):
|
||||
period_id = period_id[0]
|
||||
|
||||
for model in self.browse(cr, uid, ids, context=context):
|
||||
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
|
||||
try:
|
||||
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
|
||||
except:
|
||||
raise osv.except_osv(_('Wrong model !'), _('You have a wrong expression "%(...)s" in your model !'))
|
||||
|
||||
move_id = account_move_obj.create(cr, uid, {
|
||||
'ref': entry['name'],
|
||||
'period_id': period_id,
|
||||
@@ -2205,8 +2222,8 @@ class account_model_line(osv.osv):
|
||||
}
|
||||
_order = 'sequence'
|
||||
_sql_constraints = [
|
||||
('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model (Credit Or Debit Must Be "0")!'),
|
||||
('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model (Credit + Debit Must Be greater "0")!'),
|
||||
('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model, they must be positive!'),
|
||||
('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model, they must be positive!'),
|
||||
]
|
||||
account_model_line()
|
||||
|
||||
@@ -2372,7 +2389,7 @@ class account_account_template(osv.osv):
|
||||
_check_recursion = check_cycle
|
||||
_constraints = [
|
||||
(_check_recursion, 'Error ! You can not create recursive account templates.', ['parent_id']),
|
||||
(_check_type, 'Configuration Error! \nYou cannot define children to an account with internal type different of "View"! ', ['type']),
|
||||
(_check_type, 'Configuration Error!\nYou can not define children to an account with internal type different of "View"! ', ['type']),
|
||||
|
||||
]
|
||||
|
||||
@@ -2405,7 +2422,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
|
||||
ptids = tmpl_obj.read(cr, uid, [tids[0]['parent_id'][0]], ['code'])
|
||||
res = None
|
||||
if not ptids or not ptids[0]['code']:
|
||||
raise osv.except_osv(_('Error !'), _('Cannot locate parent code for template account!'))
|
||||
raise osv.except_osv(_('Error !'), _('I can not locate a parent code for the template account!'))
|
||||
res = acc_obj.search(cr, uid, [('code','=',ptids[0]['code'])])
|
||||
return res and res[0] or False
|
||||
|
||||
@@ -2713,7 +2730,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
unconfigured_cmp = list(set(company_ids)-set(configured_cmp))
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
res['fields'][field]['domain'] = [('id','in',unconfigured_cmp)]
|
||||
res['fields'][field]['selection'] = [('', '')]
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
|
||||
@@ -83,7 +83,8 @@ class account_bank_statement(osv.osv):
|
||||
res[statement.id] -= res_currency_obj.compute(cursor,
|
||||
user, company_currency_id, currency_id,
|
||||
line.credit, context=context)
|
||||
if statement.state == 'draft':
|
||||
|
||||
if statement.state in ('draft', 'open'):
|
||||
for line in statement.line_ids:
|
||||
res[statement.id] += line.amount
|
||||
for r in res:
|
||||
@@ -120,7 +121,7 @@ class account_bank_statement(osv.osv):
|
||||
_name = "account.bank.statement"
|
||||
_description = "Bank Statement"
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself', states={'confirm': [('readonly', True)]}),
|
||||
'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'), # readonly for account_cash_statement
|
||||
'date': fields.date('Date', required=True, states={'confirm': [('readonly', True)]}),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True,
|
||||
readonly=True, states={'draft':[('readonly',False)]}),
|
||||
@@ -129,19 +130,21 @@ class account_bank_statement(osv.osv):
|
||||
'balance_start': fields.float('Starting Balance', digits_compute=dp.get_precision('Account'),
|
||||
states={'confirm':[('readonly',True)]}),
|
||||
'balance_end_real': fields.float('Ending Balance', digits_compute=dp.get_precision('Account'),
|
||||
states={'confirm':[('readonly', True)]}),
|
||||
'balance_end': fields.function(_end_balance, string='Balance'),
|
||||
states={'confirm': [('readonly', True)]}),
|
||||
'balance_end': fields.function(_end_balance, store=True, # store=True for account_cash_statement
|
||||
string="Balance", help='Balance as calculated based on Starting Balance and transaction lines'),
|
||||
'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
|
||||
'line_ids': fields.one2many('account.bank.statement.line',
|
||||
'statement_id', 'Statement lines',
|
||||
states={'confirm':[('readonly', True)]}),
|
||||
'move_line_ids': fields.one2many('account.move.line', 'statement_id',
|
||||
'Entry lines', states={'confirm':[('readonly',True)]}),
|
||||
'state': fields.selection([('draft', 'Draft'),('confirm', 'Confirmed')],
|
||||
'State', required=True,
|
||||
states={'confirm': [('readonly', True)]}, readonly="1",
|
||||
help='When new statement is created the state will be \'Draft\'. \
|
||||
\n* And after getting confirmation from the bank it will be in \'Confirmed\' state.'),
|
||||
'state': fields.selection([('draft', 'Draft'),
|
||||
('open','Open'), # used by cash statements
|
||||
('confirm', 'Closed')],
|
||||
'State', required=True, readonly="1",
|
||||
help='When new statement is created the state will be \'Draft\'.\n'
|
||||
'And after getting confirmation from the bank it will be in \'Confirmed\' state.'),
|
||||
'currency': fields.function(_currency, string='Currency',
|
||||
type='many2one', relation='res.currency'),
|
||||
'account_id': fields.related('journal_id', 'default_debit_account_id', type='many2one', relation='account.account', string='Account used in this journal', readonly=True, help='used in statement reconciliation domain, but shouldn\'t be used elswhere.'),
|
||||
@@ -378,7 +381,7 @@ class account_bank_statement(osv.osv):
|
||||
if t['state'] in ('draft'):
|
||||
unlink_ids.append(t['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete bank statement(s) which are already confirmed !'))
|
||||
raise osv.except_osv(_('Invalid action !'), _('In order to delete a bank statement, you must first cancel it to delete related journal items.'))
|
||||
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
|
||||
return True
|
||||
|
||||
|
||||
@@ -119,39 +119,6 @@ class account_cash_statement(osv.osv):
|
||||
res2[statement.id] = encoding_total
|
||||
return res2
|
||||
|
||||
def _end_balance(self, cursor, user, ids, name, attr, context=None):
|
||||
res_currency_obj = self.pool.get('res.currency')
|
||||
res_users_obj = self.pool.get('res.users')
|
||||
res = {}
|
||||
|
||||
company_currency_id = res_users_obj.browse(cursor, user, user,
|
||||
context=context).company_id.currency_id.id
|
||||
|
||||
statements = self.browse(cursor, user, ids, context=context)
|
||||
for statement in statements:
|
||||
res[statement.id] = statement.balance_start
|
||||
currency_id = statement.currency.id
|
||||
for line in statement.move_line_ids:
|
||||
if line.debit > 0:
|
||||
if line.account_id.id == \
|
||||
statement.journal_id.default_debit_account_id.id:
|
||||
res[statement.id] += res_currency_obj.compute(cursor,
|
||||
user, company_currency_id, currency_id,
|
||||
line.debit, context=context)
|
||||
else:
|
||||
if line.account_id.id == \
|
||||
statement.journal_id.default_credit_account_id.id:
|
||||
res[statement.id] -= res_currency_obj.compute(cursor,
|
||||
user, company_currency_id, currency_id,
|
||||
line.credit, context=context)
|
||||
|
||||
if statement.state in ('draft', 'open'):
|
||||
for line in statement.line_ids:
|
||||
res[statement.id] += line.amount
|
||||
for r in res:
|
||||
res[r] = round(res[r], 2)
|
||||
return res
|
||||
|
||||
def _get_company(self, cr, uid, context=None):
|
||||
user_pool = self.pool.get('res.users')
|
||||
company_pool = self.pool.get('res.company')
|
||||
@@ -218,18 +185,11 @@ class account_cash_statement(osv.osv):
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'balance_end_real': fields.float('Closing Balance', digits_compute=dp.get_precision('Account'), states={'confirm': [('readonly', True)]}, help="closing balance entered by the cashbox verifier"),
|
||||
'state': fields.selection(
|
||||
[('draft', 'Draft'),
|
||||
('confirm', 'Closed'),
|
||||
('open','Open')], 'State', required=True, states={'confirm': [('readonly', True)]}, readonly="1"),
|
||||
'total_entry_encoding': fields.function(_get_sum_entry_encoding, store=True, string="Cash Transaction", help="Total cash transactions"),
|
||||
'closing_date': fields.datetime("Closed On"),
|
||||
'balance_end': fields.function(_end_balance, store=True, string='Balance', help="Closing balance based on Starting Balance and Cash Transactions"),
|
||||
'balance_end_cash': fields.function(_balance_end_cash, store=True, string='Balance', help="Closing balance based on cashBox"),
|
||||
'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'),
|
||||
'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'),
|
||||
'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'),
|
||||
'user_id': fields.many2one('res.users', 'Responsible', required=False),
|
||||
}
|
||||
_defaults = {
|
||||
@@ -247,7 +207,7 @@ class account_cash_statement(osv.osv):
|
||||
]
|
||||
open_jrnl = self.search(cr, uid, sql)
|
||||
if open_jrnl:
|
||||
raise osv.except_osv(_('Error'), _('You can not have two open register for the same journal'))
|
||||
raise osv.except_osv(_('Error'), _('You can not have two open register for the same journal!'))
|
||||
|
||||
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id'], context=context).type == 'cash':
|
||||
open_close = self._get_cash_open_close_box_lines(cr, uid, context)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<attribute name="rowspan">23</attribute>
|
||||
<attribute name="string"/>
|
||||
</xpath>
|
||||
<group colspan="8">
|
||||
<group colspan="8" position="inside">
|
||||
<group colspan="4" width="600">
|
||||
<field name="charts"/>
|
||||
<group colspan="4" groups="base.group_extended">
|
||||
|
||||
@@ -294,7 +294,7 @@
|
||||
</field>
|
||||
</group>
|
||||
<group col="4" colspan="2">
|
||||
<button colspan="2" name="button_reset_taxes" states="draft" string="Compute Taxes" type="object" groups="base.group_user" icon="terp-stock_format-scientific" help="This action will erase taxes"/>
|
||||
<button colspan="2" name="button_reset_taxes" states="draft,proforma2" string="Compute Taxes" type="object" groups="base.group_user" icon="terp-stock_format-scientific" help="This action will erase taxes"/>
|
||||
<field name="amount_untaxed"/>
|
||||
<label string="" colspan="2"/>
|
||||
<field name="amount_tax"/>
|
||||
@@ -355,7 +355,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Invoice">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<filter name="draft" icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
|
||||
<filter name="proforma" icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices"/>
|
||||
<filter name="invoices" icon="terp-dolar" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
|
||||
@@ -364,16 +364,16 @@
|
||||
<separator orientation="vertical"/>
|
||||
<field name="number"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id" select="1" widget="selection" string="Salesman">
|
||||
<filter domain="[('user_id','=',uid)]" help="My invoices" icon="terp-personal" separator="1"/>
|
||||
<field name="user_id" widget="selection" string="Salesman">
|
||||
<filter domain="[('user_id','=',uid)]" help="My invoices" icon="terp-personal" />
|
||||
</field>
|
||||
<field name="origin"/>
|
||||
<field name="amount_total"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group col="10" colspan="4">
|
||||
<field name="journal_id" widget="selection" select='1'/>
|
||||
<field name="period_id" select='1' string="Period"/>
|
||||
<group>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="period_id" string="Period"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
|
||||
@@ -650,14 +650,15 @@ class account_move_line(osv.osv):
|
||||
id2 = part.property_account_receivable.id
|
||||
if journal:
|
||||
jt = journal_obj.browse(cr, uid, journal).type
|
||||
#FIXME: Bank and cash journal are such a journal we can not assume a account based on this 2 journals
|
||||
# Bank and cash journal can have a payment or receipt transaction, and in both type partner account
|
||||
# will not be same id payment then payable, and if receipt then receivable
|
||||
#if jt in ('sale', 'purchase_refund', 'bank', 'cash'):
|
||||
if jt in ('sale', 'purchase_refund'):
|
||||
val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id2)
|
||||
elif jt in ('purchase', 'sale_refund', 'expense', 'bank', 'cash'):
|
||||
elif jt in ('purchase', 'sale_refund'):
|
||||
val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id1)
|
||||
elif jt in ('general', 'bank', 'cash'):
|
||||
if part.customer:
|
||||
val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id2)
|
||||
elif part.supplier:
|
||||
val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id1)
|
||||
if val.get('account_id', False):
|
||||
d = self.onchange_account_id(cr, uid, ids, val['account_id'])
|
||||
val.update(d['value'])
|
||||
@@ -1021,7 +1022,7 @@ class account_move_line(osv.osv):
|
||||
attrs.append("context=\"{'journal_id': journal_id}\"")
|
||||
|
||||
elif field == 'account_id' and journal.id:
|
||||
attrs.append('domain="[(\'journal_id\', \'=\', '+str(journal.id)+'),(\'type\',\'<>\',\'view\'), (\'type\',\'<>\',\'closed\')]" on_change="onchange_account_id(account_id, partner_id)"')
|
||||
attrs.append('domain="[(\'journal_id\', \'=\', journal_id),(\'type\',\'<>\',\'view\'), (\'type\',\'<>\',\'closed\')]" on_change="onchange_account_id(account_id, partner_id)"')
|
||||
|
||||
elif field == 'partner_id':
|
||||
attrs.append('on_change="onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)"')
|
||||
@@ -1231,7 +1232,7 @@ class account_move_line(osv.osv):
|
||||
move_id = move_obj.create(cr, uid, v, context)
|
||||
vals['move_id'] = move_id
|
||||
else:
|
||||
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
|
||||
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece!\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
|
||||
ok = not (journal.type_control_ids or journal.account_control_ids)
|
||||
if ('account_id' in vals):
|
||||
account = account_obj.browse(cr, uid, vals['account_id'], context=context)
|
||||
@@ -1256,7 +1257,7 @@ class account_move_line(osv.osv):
|
||||
vals['amount_currency'] = cur_obj.compute(cr, uid, account.company_id.currency_id.id,
|
||||
account.currency_id.id, vals.get('debit', 0.0)-vals.get('credit', 0.0), context=ctx)
|
||||
if not ok:
|
||||
raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal !'))
|
||||
raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal, check the tab \'Entry Controls\' on the related journal !'))
|
||||
|
||||
if vals.get('analytic_account_id',False):
|
||||
if journal.analytic_journal_id:
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Accounts">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-sale" string="Receivable Accounts" domain="[('type','=','receivable')]"/>
|
||||
<filter icon="terp-purchase" string="Payable Accounts" domain="[('type','=','payable')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -387,7 +387,7 @@
|
||||
<field name="model">account.journal</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Search Account Journal">
|
||||
<search string="Search Account Journal">
|
||||
<group>
|
||||
<filter domain="['|', ('type', '=', 'sale'), ('type', '=', 'sale_refund')]" string="Sale" icon="terp-camera_test"/>
|
||||
<filter domain="['|', ('type', '=', 'purchase'), ('type', '=', 'purchase_refund')]" string="Purchase" icon="terp-purchase"/>
|
||||
@@ -404,7 +404,7 @@
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Type" context="{'group_by':'type'}" icon="terp-stock_symbol-selection"/>
|
||||
</group>
|
||||
</tree>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_journal_form" model="ir.ui.view">
|
||||
@@ -482,7 +482,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Bank Statements">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
|
||||
<filter string="Confirmed" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -526,7 +526,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Bank Statements">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
|
||||
<filter string="Confirmed" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -907,7 +907,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Taxes">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="description"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
@@ -1102,7 +1102,7 @@
|
||||
<separator string="Internal Note" colspan="4"/>
|
||||
<field name="narration" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Analytic Lines" groups="base.group_analytic_accounting">
|
||||
<page string="Analytic Lines" groups="analytic.group_analytic_accounting">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -1149,7 +1149,7 @@
|
||||
<field name="reconcile_partial_id"/>
|
||||
<field name="state"/>
|
||||
</page>
|
||||
<page string="Analytic Lines" groups="base.group_analytic_accounting">
|
||||
<page string="Analytic Lines" groups="analytic.group_analytic_accounting">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -1176,7 +1176,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Journal Items">
|
||||
<group col='10' colspan='4'>
|
||||
<group>
|
||||
<filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-document-new" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
|
||||
@@ -1188,20 +1188,20 @@
|
||||
domain="[('reconcile_id','=',False), ('account_id.reconcile','=',True)]" help="Unreconciled Journal Items"
|
||||
name="unreconciled"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="move_id" select="1" string="Number (Move)"/>
|
||||
<field name="date" select='1'/>
|
||||
<field name="account_id" select='1'/>
|
||||
<field name="partner_id" select='1'>
|
||||
<field name="move_id" string="Number (Move)"/>
|
||||
<field name="date"/>
|
||||
<field name="account_id"/>
|
||||
<field name="partner_id">
|
||||
<filter help="Next Partner Entries to reconcile" name="next_partner" string="Next Partner to reconcile" context="{'next_partner_only': 1}" icon="terp-gtk-jump-to-ltr" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<field name="journal_id" widget="selection" context="{'journal_id':self, 'visible_id':self, 'normal_view':False}"/>
|
||||
<field name="period_id" context="{'period_id':self, 'search_default_period_id':self}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="12" col="10">
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
|
||||
@@ -1390,7 +1390,7 @@
|
||||
<separator string="Internal Note" colspan="4"/>
|
||||
<field name="narration" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Analytic Lines" groups="base.group_analytic_accounting">
|
||||
<page string="Analytic Lines" groups="analytic.group_analytic_accounting">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -1433,7 +1433,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Move">
|
||||
<group col='8' colspan='4'>
|
||||
<group>
|
||||
<filter icon="terp-document-new" string="Unposted" domain="[('state','=','draft')]" help="Unposted Journal Entries"/>
|
||||
<filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Journal Entries"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -1445,12 +1445,12 @@
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group col='8' colspan='4'>
|
||||
<group>
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="period_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="12" col="10">
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
|
||||
@@ -1832,7 +1832,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Entry Subscription">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Subscription"/>
|
||||
<filter icon="terp-camera_test" string="Running" domain="[('state','=','running')]" help="Running Subscription"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -2278,7 +2278,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Tax Templates">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-sale" string="Sale" domain="[('type_tax_use','=','sale')]" help="Taxes used in Sales"/>
|
||||
<filter icon="terp-purchase" string="Purchase" domain="[('type_tax_use','=','purchase')]" help="Taxes used in Purchases"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="model">res.company</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<notebook>
|
||||
<notebook position="inside">
|
||||
<page string="Overdue Payments" position="inside">
|
||||
<separator string="Overdue Payments Message" colspan="4"/>
|
||||
<field name="overdue_msg" nolabel="1" colspan ="4"/>
|
||||
|
||||
+350
-270
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+337
-255
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+326
-250
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+202
-236
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+330
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+338
-259
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+336
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+331
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+328
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+334
-252
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
+327
-251
File diff suppressed because it is too large
Load Diff
@@ -100,7 +100,7 @@ class account_installer(osv.osv_memory):
|
||||
unconfigured_cmp = list(set(company_ids)-set(configured_cmp))
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
res['fields'][field]['domain'] = [('id','in',unconfigured_cmp)]
|
||||
res['fields'][field]['selection'] = [('', '')]
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
|
||||
@@ -375,7 +375,7 @@ class account_invoice(osv.osv):
|
||||
if t['state'] in ('draft', 'cancel') and t['internal_number']== False:
|
||||
unlink_ids.append(t['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete invoice(s) that are already opened(or been in opened state ever) or paid!'))
|
||||
raise osv.except_osv(_('Invalid action !'), _('You can not delete an invoice which is open or paid. We suggest you to refund it instead.'))
|
||||
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
|
||||
return True
|
||||
|
||||
@@ -828,7 +828,7 @@ class account_invoice(osv.osv):
|
||||
total_percent += line.value_amount
|
||||
total_fixed = (total_fixed * 100) / (inv.amount_total or 1.0)
|
||||
if (total_fixed + total_percent) > 100:
|
||||
raise osv.except_osv(_('Error !'), _("Cannot create the invoice !\nThe payment term defined gives a computed amount greater than the total invoiced amount."))
|
||||
raise osv.except_osv(_('Error !'), _("Can not create the invoice !\nThe related payment term is probably misconfigured as it gives a computed amount greater than the total invoiced amount."))
|
||||
|
||||
# one move line per tax line
|
||||
iml += ait_obj.move_line_get(cr, uid, inv.id)
|
||||
@@ -860,10 +860,10 @@ class account_invoice(osv.osv):
|
||||
if totlines:
|
||||
res_amount_currency = total_currency
|
||||
i = 0
|
||||
ctx.update({'date': inv.date_invoice})
|
||||
for t in totlines:
|
||||
if inv.currency_id.id != company_currency:
|
||||
amount_currency = cur_obj.compute(cr, uid,
|
||||
company_currency, inv.currency_id.id, t[1])
|
||||
amount_currency = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, t[1], context=ctx)
|
||||
else:
|
||||
amount_currency = False
|
||||
|
||||
@@ -910,7 +910,7 @@ class account_invoice(osv.osv):
|
||||
journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
|
||||
if journal.centralisation:
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('Cannot create invoice move on centralised journal'))
|
||||
_('You cannot create an invoice on a centralised journal. Uncheck the centralised counterpart box in the related journal from the configuration menu.'))
|
||||
|
||||
line = self.finalize_invoice_move_lines(cr, uid, inv, line)
|
||||
|
||||
@@ -1019,7 +1019,7 @@ class account_invoice(osv.osv):
|
||||
pay_ids = account_move_line_obj.browse(cr, uid, i['payment_ids'])
|
||||
for move_line in pay_ids:
|
||||
if move_line.reconcile_partial_id and move_line.reconcile_partial_id.line_partial_ids:
|
||||
raise osv.except_osv(_('Error !'), _('You cannot cancel the Invoice which is Partially Paid! You need to unreconcile concerned payment entries!'))
|
||||
raise osv.except_osv(_('Error !'), _('You can not cancel an invoice which is partially paid! You need to unreconcile related payment entries first!'))
|
||||
|
||||
# First, set the invoices as cancelled and detach the move ids
|
||||
self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})
|
||||
@@ -1241,6 +1241,7 @@ class account_invoice(osv.osv):
|
||||
account_invoice()
|
||||
|
||||
class account_invoice_line(osv.osv):
|
||||
|
||||
def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict):
|
||||
res = {}
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
|
||||
@@ -28,15 +28,15 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Analytic Account">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/>
|
||||
<filter icon="terp-camera_test" string="Current" domain="[('state','=','open')]" help="Current Accounts"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-go-today" string="Overdue Account" domain="[('date','<',time.strftime('%%Y-%%m-%%d'))]" help="Analytic Accounts with a past deadline."/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="partner_id" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
@@ -204,7 +204,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Analytic Lines">
|
||||
<group col='6' colspan='4'>
|
||||
<group>
|
||||
<filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" icon="terp-camera_test" help="Analytic Journal Items related to a sale journal."/>
|
||||
<filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase" help="Analytic Journal Items related to a purchase journal."/>
|
||||
<filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]" icon="terp-folder-orange"/>
|
||||
@@ -430,13 +430,13 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Analytic Entries Stats">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-go-year" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Sale journal in this year"/>
|
||||
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Sale journal in this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="account_id" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
<field name="account_id"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Analytic Entries Analysis">
|
||||
<group col="10" colspan="12">
|
||||
<group>
|
||||
<filter icon="terp-go-year" string=" 365 Days "
|
||||
domain="[('day','<=', time.strftime('%%Y-%%m-%%d')),('day','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Analytic Entries of last 365 days"/>
|
||||
@@ -44,7 +44,6 @@
|
||||
help="Analytic Entries of last 30 days"/>
|
||||
<filter icon="terp-go-week"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('day','<=', time.strftime('%%Y-%%m-%%d')), ('day','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Analytic Entries during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Entries Analysis">
|
||||
<group colspan="10" col="12">
|
||||
<group>
|
||||
<filter icon="terp-go-year" string="This F.Year"
|
||||
name="thisyear"
|
||||
context="{'year':'current_year'}"
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Invoices Analysis">
|
||||
<group col="10" colspan="12">
|
||||
<group>
|
||||
<filter string="Draft"
|
||||
icon="terp-document-new"
|
||||
domain="[('state','=','draft')]"
|
||||
@@ -78,7 +78,6 @@
|
||||
help="Customer Invoices And Refunds"/>
|
||||
<filter icon="terp-personal"
|
||||
string="Supplier"
|
||||
separator="1"
|
||||
domain="['|', ('type','=','in_invoice'),('type','=','in_refund')]"
|
||||
help="Supplier Invoices And Refunds"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -87,7 +86,6 @@
|
||||
help="Customer And Supplier Invoices"/>
|
||||
<filter icon="terp-dolar_ok!"
|
||||
string="Refund"
|
||||
separator="1"
|
||||
domain="['|', ('type','=','out_refund'),('type','=','in_refund')]"
|
||||
help="Customer And Supplier Refunds"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -152,8 +152,8 @@
|
||||
<filter icon="terp-go-year" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="This year's Sales by type"/>
|
||||
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="This months' Sales by type"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -218,8 +218,8 @@
|
||||
<filter icon="terp-go-year" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="All Months Sales by type"/>
|
||||
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="This Months Sales by type"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="month"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -41,12 +41,16 @@ class account_invoice_refund(osv.osv_memory):
|
||||
|
||||
def _get_journal(self, cr, uid, context=None):
|
||||
obj_journal = self.pool.get('account.journal')
|
||||
user_obj = self.pool.get('res.users')
|
||||
if context is None:
|
||||
context = {}
|
||||
journal = obj_journal.search(cr, uid, [('type', '=', 'sale_refund')])
|
||||
if context.get('type', False):
|
||||
if context['type'] in ('in_invoice', 'in_refund'):
|
||||
journal = obj_journal.search(cr, uid, [('type', '=', 'purchase_refund')])
|
||||
inv_type = context.get('type', 'out_invoice')
|
||||
company_id = user_obj.browse(cr, uid, uid, context=context).company_id.id
|
||||
type = (inv_type == 'out_invoice') and 'sale_refund' or \
|
||||
(inv_type == 'out_refund') and 'sale' or \
|
||||
(inv_type == 'in_invoice') and 'purchase_refund' or \
|
||||
(inv_type == 'in_refund') and 'purchase'
|
||||
journal = obj_journal.search(cr, uid, [('type', '=', type), ('company_id','=',company_id)], limit=1, context=context)
|
||||
return journal and journal[0] or False
|
||||
|
||||
_defaults = {
|
||||
@@ -57,15 +61,17 @@ class account_invoice_refund(osv.osv_memory):
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
user_obj = self.pool.get('res.users')
|
||||
res = super(account_invoice_refund,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
type = context.get('journal_type', 'sale_refund')
|
||||
if type in ('sale', 'sale_refund'):
|
||||
type = 'sale_refund'
|
||||
else:
|
||||
type = 'purchase_refund'
|
||||
type = context.get('type', 'out_invoice')
|
||||
company_id = user_obj.browse(cr, uid, uid, context=context).company_id.id
|
||||
journal_type = (type == 'out_invoice') and 'sale_refund' or \
|
||||
(type == 'out_refund') and 'sale' or \
|
||||
(type == 'in_invoice') and 'purchase_refund' or \
|
||||
(type == 'in_refund') and 'purchase'
|
||||
for field in res['fields']:
|
||||
if field == 'journal_id':
|
||||
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
|
||||
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', journal_type), ('company_id','child_of',[company_id])], context=context)
|
||||
res['fields'][field]['selection'] = journal_select
|
||||
return res
|
||||
|
||||
@@ -198,10 +204,10 @@ class account_invoice_refund(osv.osv_memory):
|
||||
if 'value' in data and data['value']:
|
||||
inv_obj.write(cr, uid, [inv_id], data['value'])
|
||||
created_inv.append(inv_id)
|
||||
if inv.type in ('out_invoice', 'out_refund'):
|
||||
xml_id = 'action_invoice_tree3'
|
||||
else:
|
||||
xml_id = 'action_invoice_tree4'
|
||||
xml_id = (inv.type == 'out_refund') and 'action_invoice_tree1' or \
|
||||
(inv.type == 'in_refund') and 'action_invoice_tree2' or \
|
||||
(inv.type == 'out_invoice') and 'action_invoice_tree3' or \
|
||||
(inv.type == 'in_invoice') and 'action_invoice_tree4'
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account', xml_id)
|
||||
id = result and result[1] or False
|
||||
result = act_obj.read(cr, uid, id, context=context)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<field name="domain">[('invoice_id','=',False)]</field>
|
||||
<field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
|
||||
</record>
|
||||
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="menu_invoicing" groups="base.group_extended"/>
|
||||
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="menu_invoicing" groups="analytic.group_analytic_accounting"/>
|
||||
|
||||
<record id="action_account_analytic_managed_overpassed" model="ir.actions.act_window">
|
||||
<field name="name">Overpassed Accounts</field>
|
||||
@@ -20,6 +20,6 @@
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="domain">[('date','<=',time.strftime('%Y-%m-%d')),('state','=','open')]</field>
|
||||
</record>
|
||||
<menuitem action="action_account_analytic_managed_overpassed" id="menu_action_account_analytic_managed_overpassed" sequence="50" parent="menu_invoicing" groups="base.group_extended"/>
|
||||
<menuitem action="action_account_analytic_managed_overpassed" id="menu_action_account_analytic_managed_overpassed" sequence="50" parent="menu_invoicing" groups="analytic.group_analytic_accounting"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -39,7 +39,11 @@ Allows to automatically select analytic accounts based on criterions:
|
||||
'images' : ['images/analytic_defaults.jpeg'],
|
||||
'depends' : ['sale'],
|
||||
'init_xml' : [],
|
||||
'update_xml': ['security/ir.model.access.csv', 'account_analytic_default_view.xml'],
|
||||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'security/account_analytic_default_security.xml',
|
||||
'account_analytic_default_view.xml'
|
||||
],
|
||||
'demo_xml' : [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Accounts">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<filter icon="terp-go-month" string="Current" name = "current" help="Analytical defaults whose end date is greater than today or None" domain = "['|', ('date_stop', '>', datetime.date.today().strftime('%%Y-%%m-%%d')), ('date_stop', '=', False)]" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="analytic_default_comp_rule" model="ir.rule">
|
||||
<field name="name">Analytic Default multi company rule</field>
|
||||
<field model="ir.model" name="model_id" ref="model_account_analytic_default"/>
|
||||
<field eval="True" name="global"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -25,7 +25,7 @@ from osv import osv
|
||||
|
||||
class account_invoice_line(osv.osv):
|
||||
_inherit = "account.invoice.line"
|
||||
|
||||
|
||||
def move_line_get(self, cr, uid, invoice_id, context=None):
|
||||
res = super(account_invoice_line,self).move_line_get(cr, uid, invoice_id, context=context)
|
||||
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)
|
||||
@@ -33,9 +33,9 @@ class account_invoice_line(osv.osv):
|
||||
def get_price(cr, uid, inv, company_currency,i_line):
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
if inv.currency_id.id != company_currency:
|
||||
price = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, i_line.product_id.product_tmpl_id.standard_price * i_line.quantity, context={'date': inv.date_invoice})
|
||||
price = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, i_line.product_id.standard_price * i_line.quantity, context={'date': inv.date_invoice})
|
||||
else:
|
||||
price = i_line.product_id.product_tmpl_id.standard_price * i_line.quantity
|
||||
price = i_line.product_id.standard_price * i_line.quantity
|
||||
return price
|
||||
|
||||
if inv.type in ('out_invoice','out_refund'):
|
||||
@@ -43,27 +43,27 @@ class account_invoice_line(osv.osv):
|
||||
if i_line.product_id:
|
||||
if inv.type == 'out_invoice':
|
||||
# debit account dacc will be the output account
|
||||
# first check the product, if empty check the category
|
||||
dacc = i_line.product_id.product_tmpl_id.property_stock_account_output and i_line.product_id.product_tmpl_id.property_stock_account_output.id
|
||||
# first check the product, if empty check the category
|
||||
dacc = i_line.product_id.property_stock_account_output and i_line.product_id.property_stock_account_output.id
|
||||
if not dacc:
|
||||
dacc = i_line.product_id.categ_id.property_stock_account_output_categ and i_line.product_id.categ_id.property_stock_account_output_categ.id
|
||||
else:
|
||||
# = out_refund
|
||||
# debit account dacc will be the input account
|
||||
# first check the product, if empty check the category
|
||||
dacc = i_line.product_id.product_tmpl_id.property_stock_account_input and i_line.product_id.product_tmpl_id.property_stock_account_input.id
|
||||
# first check the product, if empty check the category
|
||||
dacc = i_line.product_id.property_stock_account_input and i_line.product_id.property_stock_account_input.id
|
||||
if not dacc:
|
||||
dacc = i_line.product_id.categ_id.property_stock_account_input_categ and i_line.product_id.categ_id.property_stock_account_input_categ.id
|
||||
# in both cases the credit account cacc will be the expense account
|
||||
# first check the product, if empty check the category
|
||||
cacc = i_line.product_id.product_tmpl_id.property_account_expense and i_line.product_id.product_tmpl_id.property_account_expense.id
|
||||
# first check the product, if empty check the category
|
||||
cacc = i_line.product_id.property_account_expense and i_line.product_id.property_account_expense.id
|
||||
if not cacc:
|
||||
cacc = i_line.product_id.categ_id.property_account_expense_categ and i_line.product_id.categ_id.property_account_expense_categ.id
|
||||
if dacc and cacc:
|
||||
res.append({
|
||||
'type':'src',
|
||||
'name': i_line.name[:64],
|
||||
'price_unit':i_line.product_id.product_tmpl_id.standard_price,
|
||||
'price_unit':i_line.product_id.standard_price,
|
||||
'quantity':i_line.quantity,
|
||||
'price':get_price(cr, uid, inv, company_currency, i_line),
|
||||
'account_id':dacc,
|
||||
@@ -72,11 +72,11 @@ class account_invoice_line(osv.osv):
|
||||
'account_analytic_id':i_line.account_analytic_id.id,
|
||||
'taxes':i_line.invoice_line_tax_id,
|
||||
})
|
||||
|
||||
|
||||
res.append({
|
||||
'type':'src',
|
||||
'name': i_line.name[:64],
|
||||
'price_unit':i_line.product_id.product_tmpl_id.standard_price,
|
||||
'price_unit':i_line.product_id.standard_price,
|
||||
'quantity':i_line.quantity,
|
||||
'price': -1 * get_price(cr, uid, inv, company_currency, i_line),
|
||||
'account_id':cacc,
|
||||
@@ -88,36 +88,36 @@ class account_invoice_line(osv.osv):
|
||||
elif inv.type in ('in_invoice','in_refund'):
|
||||
for i_line in inv.invoice_line:
|
||||
if i_line.product_id:
|
||||
if i_line.product_id.product_tmpl_id.type != 'service':
|
||||
# get the price difference account at the product
|
||||
acc = i_line.product_id.product_tmpl_id.property_account_creditor_price_difference and i_line.product_id.product_tmpl_id.property_account_creditor_price_difference.id
|
||||
if i_line.product_id.type != 'service':
|
||||
# get the price difference account at the product
|
||||
acc = i_line.product_id.property_account_creditor_price_difference and i_line.product_id.property_account_creditor_price_difference.id
|
||||
if not acc:
|
||||
# if not found on the product get the price difference account at the category
|
||||
# if not found on the product get the price difference account at the category
|
||||
acc = i_line.product_id.categ_id.property_account_creditor_price_difference_categ and i_line.product_id.categ_id.property_account_creditor_price_difference_categ.id
|
||||
a = None
|
||||
if inv.type == 'in_invoice':
|
||||
# oa will be the stock input account
|
||||
# first check the product, if empty check the category
|
||||
oa = i_line.product_id.product_tmpl_id.property_stock_account_input and i_line.product_id.product_tmpl_id.property_stock_account_input.id
|
||||
# first check the product, if empty check the category
|
||||
oa = i_line.product_id.property_stock_account_input and i_line.product_id.property_stock_account_input.id
|
||||
if not oa:
|
||||
oa = i_line.product_id.categ_id.property_stock_account_input_categ and i_line.product_id.categ_id.property_stock_account_input_categ.id
|
||||
else:
|
||||
# = in_refund
|
||||
# oa will be the stock output account
|
||||
# first check the product, if empty check the category
|
||||
oa = i_line.product_id.product_tmpl_id.property_stock_account_output and i_line.product_id.product_tmpl_id.property_stock_account_output.id
|
||||
# first check the product, if empty check the category
|
||||
oa = i_line.product_id.property_stock_account_output and i_line.product_id.property_stock_account_output.id
|
||||
if not oa:
|
||||
oa = i_line.product_id.categ_id.property_stock_account_output_categ and i_line.product_id.categ_id.property_stock_account_output_categ.id
|
||||
if oa:
|
||||
# get the fiscal position
|
||||
# get the fiscal position
|
||||
fpos = i_line.invoice_id.fiscal_position or False
|
||||
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
|
||||
diff_res = []
|
||||
# calculate and write down the possible price difference between invoice price and product price
|
||||
# calculate and write down the possible price difference between invoice price and product price
|
||||
for line in res:
|
||||
if a == line['account_id'] and i_line.product_id.id == line['product_id']:
|
||||
uom = i_line.product_id.uos_id or i_line.product_id.uom_id
|
||||
standard_price = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.product_tmpl_id.standard_price, i_line.uos_id.id)
|
||||
standard_price = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.standard_price, i_line.uos_id.id)
|
||||
if standard_price != i_line.price_unit and line['price_unit'] == i_line.price_unit and acc:
|
||||
price_diff = i_line.price_unit - standard_price
|
||||
line.update({'price':standard_price * line['quantity']})
|
||||
@@ -134,8 +134,8 @@ class account_invoice_line(osv.osv):
|
||||
'taxes':line.get('taxes',[]),
|
||||
})
|
||||
res += diff_res
|
||||
return res
|
||||
|
||||
return res
|
||||
|
||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
|
||||
if not product:
|
||||
return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context)
|
||||
@@ -145,19 +145,19 @@ class account_invoice_line(osv.osv):
|
||||
if type in ('in_invoice','in_refund'):
|
||||
product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
|
||||
if type == 'in_invoice':
|
||||
oa = product_obj.product_tmpl_id.property_stock_account_input and product_obj.product_tmpl_id.property_stock_account_input.id
|
||||
oa = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id
|
||||
if not oa:
|
||||
oa = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id
|
||||
else:
|
||||
oa = product_obj.product_tmpl_id.property_stock_account_output and product_obj.product_tmpl_id.property_stock_account_output.id
|
||||
oa = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id
|
||||
if not oa:
|
||||
oa = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id
|
||||
if oa:
|
||||
fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id, context=context) or False
|
||||
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
|
||||
res['value'].update({'account_id':a})
|
||||
res['value'].update({'account_id':a})
|
||||
return res
|
||||
|
||||
|
||||
account_invoice_line()
|
||||
|
||||
class account_invoice(osv.osv):
|
||||
@@ -170,7 +170,7 @@ class account_invoice(osv.osv):
|
||||
if inv_obj.type == 'in_invoice':
|
||||
if line.get('product_id',False):
|
||||
product_obj = self.pool.get('product.product').browse(cr, uid, line['product_id'][0])
|
||||
oa = product_obj.product_tmpl_id.property_stock_account_output and product_obj.product_tmpl_id.property_stock_account_output.id
|
||||
oa = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id
|
||||
if not oa:
|
||||
oa = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id
|
||||
if oa:
|
||||
@@ -180,6 +180,6 @@ class account_invoice(osv.osv):
|
||||
line.update({'account_id': (account_data['id'],account_data['name'])})
|
||||
res = super(account_invoice,self)._refund_cleanup_lines(cr, uid, lines)
|
||||
return res
|
||||
|
||||
|
||||
account_invoice()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<field name="inherit_id" ref="account.product_normal_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook/page/group/field[@name='property_account_expense']" position="after">
|
||||
<label string="" colspan="2"/>
|
||||
<field name="property_account_creditor_price_difference" domain="[('type','<>','view'),('type','<>','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
|
||||
<newline/>
|
||||
</xpath>
|
||||
@@ -36,7 +37,7 @@
|
||||
<form position="inside">
|
||||
<group col="2" colspan="2">
|
||||
<separator string=" Accounting Property" colspan="2"/>
|
||||
<field name="property_account_creditor_price_difference_categ" domain="[('type','<>','view'),('type','<>','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
|
||||
<field name="property_account_creditor_price_difference_categ" domain="[('type','<>','view'),('type','<>','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -29,7 +29,7 @@ class purchase_order(osv.osv):
|
||||
def inv_line_create(self, cr, uid, a, ol):
|
||||
line = super(purchase_order, self).inv_line_create(cr, uid, a, ol)
|
||||
if ol.product_id:
|
||||
oa = ol.product_id.product_tmpl_id.property_stock_account_input and ol.product_id.product_tmpl_id.property_stock_account_input.id
|
||||
oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id
|
||||
if not oa:
|
||||
oa = ol.product_id.categ_id.property_stock_account_input_categ and ol.product_id.categ_id.property_stock_account_input_categ.id
|
||||
if oa:
|
||||
|
||||
@@ -8,14 +8,14 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2009-11-24 12:54+0000\n"
|
||||
"PO-Revision-Date: 2011-08-29 20:43+0000\n"
|
||||
"PO-Revision-Date: 2011-09-17 13:42+0000\n"
|
||||
"Last-Translator: lholivier <olivier.lenoir@free.fr>\n"
|
||||
"Language-Team: French <fr@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: 2011-09-05 05:59+0000\n"
|
||||
"X-Generator: Launchpad (build 13830)\n"
|
||||
"X-Launchpad-Export-Date: 2011-09-18 04:58+0000\n"
|
||||
"X-Generator: Launchpad (build 13955)\n"
|
||||
|
||||
#. module: account_asset
|
||||
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_list_normal
|
||||
@@ -94,7 +94,7 @@ msgstr "Écritures générées"
|
||||
#: field:account.asset.property,method_delay:0
|
||||
#: field:account.asset.property.history,method_delay:0
|
||||
msgid "Number of interval"
|
||||
msgstr ""
|
||||
msgstr "Période"
|
||||
|
||||
#. module: account_asset
|
||||
#: wizard_button:account.asset.compute,asset_compute,asset_open:0
|
||||
@@ -173,7 +173,7 @@ msgstr "Compte Analytique"
|
||||
#. module: account_asset
|
||||
#: field:account.asset.property,state:0
|
||||
msgid "State"
|
||||
msgstr ""
|
||||
msgstr "État"
|
||||
|
||||
#. module: account_asset
|
||||
#: view:account.asset.asset:0
|
||||
@@ -252,7 +252,7 @@ msgstr ""
|
||||
#: field:account.asset.board,value_gross:0
|
||||
#: field:account.asset.property,value_total:0
|
||||
msgid "Gross value"
|
||||
msgstr ""
|
||||
msgstr "Valeur brute"
|
||||
|
||||
#. module: account_asset
|
||||
#: selection:account.asset.property,method_time:0
|
||||
@@ -315,7 +315,7 @@ msgstr "Emplacement"
|
||||
#. module: account_asset
|
||||
#: field:account.asset.property,method:0
|
||||
msgid "Computation method"
|
||||
msgstr ""
|
||||
msgstr "Méthode de calcul"
|
||||
|
||||
#. module: account_asset
|
||||
#: field:account.asset.property,method_time:0
|
||||
@@ -325,7 +325,7 @@ msgstr ""
|
||||
#. module: account_asset
|
||||
#: field:account.asset.asset,active:0
|
||||
msgid "Active"
|
||||
msgstr ""
|
||||
msgstr "Actif"
|
||||
|
||||
#. module: account_asset
|
||||
#: field:account.asset.property.history,user_id:0
|
||||
@@ -480,12 +480,12 @@ msgstr ""
|
||||
#. module: account_asset
|
||||
#: field:account.asset.asset,value_total:0
|
||||
msgid "Total value"
|
||||
msgstr ""
|
||||
msgstr "Valeur totale"
|
||||
|
||||
#. module: account_asset
|
||||
#: selection:account.asset.asset,state:0
|
||||
msgid "View"
|
||||
msgstr ""
|
||||
msgstr "Vue"
|
||||
|
||||
#. module: account_asset
|
||||
#: view:account.asset.asset:0
|
||||
@@ -495,17 +495,17 @@ msgstr ""
|
||||
#. module: account_asset
|
||||
#: field:account.asset.asset,sequence:0
|
||||
msgid "Sequence"
|
||||
msgstr ""
|
||||
msgstr "Séquence"
|
||||
|
||||
#. module: account_asset
|
||||
#: field:account.asset.property,value_residual:0
|
||||
msgid "Residual value"
|
||||
msgstr ""
|
||||
msgstr "Valeur résiduelle"
|
||||
|
||||
#. module: account_asset
|
||||
#: wizard_button:account.asset.close,init,asset_close:0
|
||||
msgid "End of asset"
|
||||
msgstr ""
|
||||
msgstr "Fin de l'immobilisation"
|
||||
|
||||
#. module: account_asset
|
||||
#: selection:account.asset.property,type:0
|
||||
@@ -515,7 +515,7 @@ msgstr ""
|
||||
#. module: account_asset
|
||||
#: selection:account.asset.property,type:0
|
||||
msgid "Indirect"
|
||||
msgstr ""
|
||||
msgstr "Indirect"
|
||||
|
||||
#. module: account_asset
|
||||
#: field:account.asset.asset,parent_id:0
|
||||
@@ -526,4 +526,4 @@ msgstr ""
|
||||
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_tree
|
||||
#: model:ir.ui.menu,name:account_asset.menu_action_account_asset_asset_tree
|
||||
msgid "Asset Hierarchy"
|
||||
msgstr ""
|
||||
msgstr "Hiérarchie des immobilisations"
|
||||
|
||||
@@ -170,12 +170,12 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Budget">
|
||||
<group col="20" colspan="4">
|
||||
<group>
|
||||
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help="Draft Budgets"/>
|
||||
<filter string="To Approve" icon="terp-camera_test" domain="[('state','=','confirm')]" help="To Approve Budgets" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1" />
|
||||
<field name="name"/>
|
||||
<field name="code" />
|
||||
<field name="state"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
@@ -222,13 +222,13 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Budget Lines">
|
||||
<field name="crossovered_budget_id"/>
|
||||
<field name="analytic_account_id" select="1" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="general_budget_id" select="1"/>
|
||||
<field name="analytic_account_id"/>
|
||||
<field name="general_budget_id"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="paid_date" select="1"/>
|
||||
<field name="planned_amount" select="1"/>
|
||||
<field name="practical_amount" select="1"/>
|
||||
<field name="paid_date"/>
|
||||
<field name="planned_amount"/>
|
||||
<field name="practical_amount"/>
|
||||
<field name="theoritical_amount"/>
|
||||
<field name="percentage"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Coda">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<field name="journal_id" widget='selection'/>
|
||||
<field name="date"/>
|
||||
<field name="user_id" widget='selection'/>
|
||||
|
||||
@@ -48,6 +48,7 @@ Note that if you want to check the followup level for a given partner/account en
|
||||
'depends': ['account_accountant', 'mail'],
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
'security/account_followup_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/account_followup_print_view.xml',
|
||||
'report/account_followup_report.xml',
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Followup">
|
||||
<group col="10" colspan="4">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Follow-ups Sent">
|
||||
<group col="10" colspan="12">
|
||||
<group>
|
||||
<filter icon="terp-go-year" string="This Fiscal year"
|
||||
name="fiscalyear"
|
||||
domain="[('period_id','in','current_year')]"
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="account_followup_comp_rule" model="ir.rule">
|
||||
<field name="name">Account Followup multi company rule</field>
|
||||
<field model="ir.model" name="model_id" ref="model_account_followup_followup"/>
|
||||
<field eval="True" name="global"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record id="account_followup_stat_by_partner_comp_rule" model="ir.rule">
|
||||
<field name="name">Account Followup Statistics by Partner Rule</field>
|
||||
<field ref="model_account_followup_stat_by_partner" name="model_id"/>
|
||||
<field eval="True" name="global"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -46,7 +46,7 @@
|
||||
<field name="model">payment.mode</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Payment Mode">
|
||||
<search string="Payment Mode">
|
||||
<field name="name"/>
|
||||
<field name="journal" widget='selection'/>
|
||||
<field name="company_id" widget='selection' groups="base.group_multi_company"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal'}"/>
|
||||
</group>
|
||||
</form>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Payment Orders">
|
||||
<group col="8" colspan="4">
|
||||
<group>
|
||||
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
|
||||
<filter string="Confirmed" domain="[('state','=','open')]" icon="terp-camera_test"/>
|
||||
<filter string="Done" domain="[('state','=','done')]" icon="terp-dialog-close"/>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<xpath expr="//label[@string='description']" position="attributes">
|
||||
<attribute name="string">You can enhance the Account Sequence Application by installing .</attribute>
|
||||
</xpath>
|
||||
<group colspan="8">
|
||||
<group colspan="8" position="inside">
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="prefix"/>
|
||||
<field name="suffix"/>
|
||||
|
||||
@@ -145,6 +145,16 @@ class account_voucher(osv.osv):
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
|
||||
def _check_paid(self, cr, uid, ids, name, args, context=None):
|
||||
res = {}
|
||||
for voucher in self.browse(cr, uid, ids, context=context):
|
||||
ok = True
|
||||
for line in voucher.move_ids:
|
||||
if (line.account_id.type, 'in', ('receivable', 'payable')) and not line.reconcile_id:
|
||||
ok = False
|
||||
res[voucher.id] = ok
|
||||
return res
|
||||
|
||||
def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -288,6 +298,7 @@ class account_voucher(osv.osv):
|
||||
'analytic_id': fields.many2one('account.analytic.account','Write-Off Analytic Account', readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'writeoff_amount': fields.function(_get_writeoff_amount, string='Write-Off Amount', type='float', readonly=True, multi="writeoff"),
|
||||
'currency_rate_difference': fields.function(_get_writeoff_amount, string="Currency Rate Difference", type='float', multi="writeoff"),
|
||||
'paid': fields.function(_check_paid, string='Paid', type='boolean', help="The Voucher has been totally paid."),
|
||||
}
|
||||
_defaults = {
|
||||
'period_id': _get_period,
|
||||
@@ -696,7 +707,7 @@ class account_voucher(osv.osv):
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
for t in self.read(cr, uid, ids, ['state'], context=context):
|
||||
if t['state'] not in ('draft', 'cancel'):
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delete Voucher(s) which are already opened or paid !'))
|
||||
raise osv.except_osv(_('Invalid action !'), _('In order to delete a voucher, you must cancel it!'))
|
||||
return super(account_voucher, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
def onchange_payment(self, cr, uid, ids, pay_now, journal_id, partner_id, ttype='sale'):
|
||||
@@ -871,13 +882,22 @@ class account_voucher(osv.osv):
|
||||
diff = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.writeoff_amount, context=context_multi_currency)
|
||||
account_id = False
|
||||
write_off_name = ''
|
||||
|
||||
if voucher.payment_option == 'with_writeoff':
|
||||
account_id = voucher.writeoff_acc_id.id
|
||||
write_off_name = voucher.comment
|
||||
elif voucher.type in ('sale', 'receipt'):
|
||||
account_id = voucher.partner_id.property_account_receivable.id
|
||||
if not voucher.partner_id:
|
||||
account_id = property_obj.search(cr,uid,[('name','=','property_account_receivable'),('res_id','=',False)])
|
||||
else:
|
||||
account_id = voucher.partner_id.property_account_receivable.id
|
||||
else:
|
||||
account_id = voucher.partner_id.property_account_payable.id
|
||||
if not voucher.partner_id:
|
||||
account_id = property_obj.search(cr,uid,[('name','=','property_account_payable'),('res_id','=',False)])
|
||||
else:
|
||||
account_id = voucher.partner_id.property_account_payable.id
|
||||
if not account_id:
|
||||
raise osv.except_osv(_('Error !'), _('No receivable/payable account defined in properties!'))
|
||||
move_line = {
|
||||
'name': write_off_name or name,
|
||||
'account_id': account_id,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user