diff --git a/addons/account/account.py b/addons/account/account.py
index 04c5c92d98c..34b421c7e6f 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -423,7 +423,7 @@ class account_journal(osv.osv):
'user_id': fields.many2one('res.users', 'User', help="The responsible user of this journal"),
'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'),
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
- 'entry_posted': fields.boolean('Skip \'Draft\' State of Created Entries', help='Check this box if you don\'t want that new account moves pass through the draft state'),
+ 'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want that new account moves pass through the \'draft\' state and goes direclty to the \'posted state\' without any manual validation.'),
}
_defaults = {
'active': lambda *a: 1,
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 125e3a7d5f0..d915a5f96cb 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -404,7 +404,11 @@ class account_move_line(osv.osv):
account_id = line['account_id']['id']
partner_id = (line['partner_id'] and line['partner_id']['id']) or False
writeoff = debit - credit
- date = time.strftime('%Y-%m-%d')
+ # Ifdate_p in context => take this date
+ if context.has_key('date_p') and context['date_p']:
+ date=context['date_p']
+ else:
+ date = time.strftime('%Y-%m-%d')
cr.execute('SELECT account_id, reconcile_id \
FROM account_move_line \
@@ -435,9 +439,15 @@ class account_move_line(osv.osv):
self_credit = 0.0
self_debit = -writeoff
+ # If comment exist in context, take it
+ if context['comment']:
+ libelle=context['comment']
+ else:
+ libelle='Write-Off'
+
writeoff_lines = [
(0, 0, {
- 'name':'Write-Off',
+ 'name':libelle,
'debit':self_debit,
'credit':self_credit,
'account_id':account_id,
@@ -447,7 +457,7 @@ class account_move_line(osv.osv):
'amount_currency': account.currency_id.id and -currency or 0.0
}),
(0, 0, {
- 'name':'Write-Off',
+ 'name':libelle,
'debit':debit,
'credit':credit,
'account_id':writeoff_acc_id,
@@ -488,6 +498,11 @@ class account_move_line(osv.osv):
return r_id
def view_header_get(self, cr, user, view_id, view_type, context):
+ if context.get('account_id', False):
+ cr.execute('select code from account_account where id=%d', (context['account_id'],))
+ res = cr.fetchone()
+ res = _('Entries: ')+ (res[0] or '')
+ return res
if (not context.get('journal_id', False)) or (not context.get('period_id', False)):
return False
cr.execute('select code from account_journal where id=%d', (context['journal_id'],))
@@ -495,8 +510,8 @@ class account_move_line(osv.osv):
cr.execute('select code from account_period where id=%d', (context['period_id'],))
p = cr.fetchone()[0] or ''
if j or p:
- return j+':'+p
- return 'Journal'
+ return j+(p and (':'+p) or '')
+ return False
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False):
result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context)
@@ -709,7 +724,6 @@ class account_move_line(osv.osv):
tax_id=tax_obj.browse(cr,uid,vals['account_tax_id'])
total = vals['credit'] or (-vals['debit'])
for tax in tax_obj.compute(cr,uid,[tax_id],total,1.00):
- print 'Processing Tax', tax
self.write(cr, uid,[result], {
'tax_code_id': tax['base_code_id'],
'tax_amount': tax['base_sign'] * total
@@ -729,7 +743,6 @@ class account_move_line(osv.osv):
'credit': tax['amount']>0 and tax['amount'] or 0.0,
'debit': tax['amount']<0 and -tax['amount'] or 0.0,
}
- print data
self.create(cr, uid, data, context)
if check:
tmp = self.pool.get('account.move').validate(cr, uid, [vals['move_id']], context)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index cb3a373b4fc..01b32235907 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -888,7 +888,7 @@
-
+
@@ -1319,17 +1319,18 @@
- Move line select
+ Entries
account.move.line
form
tree,form
[('account_id','child_of', [active_id]),('state','<>','draft')]
+ {'account_id':active_id}
- Open all entries lines
+ Account Entries
@@ -1514,14 +1515,14 @@
-
+
account.chart.template.form
account.chart.template
form
-
- Account Chart Templates
+ Chart of Accounts Templates
account.chart.template
form
tree,form
@@ -1598,7 +1599,7 @@
wizard.account.chart.duplicate
form
-
- Duplicate Account Chart
+ Duplicate Chart of Accounts
ir.actions.act_window
wizard.account.chart.duplicate
form
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 7dabe6fe88d..89e47a1ac43 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -685,20 +685,30 @@ class account_invoice(osv.osv):
invoice = self.browse(cr, uid, ids[0])
src_account_id = invoice.account_id.id
journal = self.pool.get('account.journal').browse(cr, uid, pay_journal_id)
- if not name:
- if journal.sequence_id:
- name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.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.'))
+ if journal.sequence_id:
+ name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.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.'))
+ # Take the seq as name for move
+ if journal.sequence_id:
+ seq = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.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.')
types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1}
direction = types[invoice.type]
+ #take the choosen date
+ if context.has_key('date_p') and context['date_p']:
+ date=context['date_p']
+ else:
+ date=time.strftime('%Y-%m-%d')
l1 = {
'name': name,
'debit': direction * pay_amount>0 and direction * pay_amount,
'credit': direction * pay_amount<0 and - direction * pay_amount,
'account_id': src_account_id,
'partner_id': invoice.partner_id.id,
- 'date': time.strftime('%Y-%m-%d'),
+ 'date': date,
+ 'ref':invoice.number,
}
l2 = {
'name':name,
@@ -706,11 +716,12 @@ class account_invoice(osv.osv):
'credit': direction * pay_amount>0 and direction * pay_amount,
'account_id': pay_account_id,
'partner_id': invoice.partner_id.id,
- 'date': time.strftime('%Y-%m-%d'),
+ 'date': date,
+ 'ref':invoice.number,
}
lines = [(0, 0, l1), (0, 0, l2)]
- move = {'name': name, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id}
+ move = {'name': seq, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id}
move_id = self.pool.get('account.move').create(cr, uid, move)
line_ids = []
diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml
index ccc93735a59..8e523c5bc4d 100644
--- a/addons/account/partner_view.xml
+++ b/addons/account/partner_view.xml
@@ -5,20 +5,6 @@
Partners Extension
-->
-
- res.partner.form.inherit
- res.partner
- form
-
-
-
-
-
-
-
-
-
-
res.partner.property.form.inherit
res.partner
@@ -26,16 +12,56 @@
2
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account/product_view.xml b/addons/account/product_view.xml
index 1512b202f2f..3ca95e625b8 100644
--- a/addons/account/product_view.xml
+++ b/addons/account/product_view.xml
@@ -50,10 +50,13 @@
form
-
-
-
-
+
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 27ba38f3f88..d8f6d8af516 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -78,7 +78,7 @@
- Analytic Charts of Accounts
+ Analytic Chart of Accounts
ir.actions.act_window
account.analytic.account
[('parent_id','=',False)]
diff --git a/addons/account/wizard/wizard_move_line_select.py b/addons/account/wizard/wizard_move_line_select.py
index 86c677ffb6a..10c69f81468 100644
--- a/addons/account/wizard/wizard_move_line_select.py
+++ b/addons/account/wizard/wizard_move_line_select.py
@@ -52,7 +52,10 @@ class wizard_move_line_select(wizard.interface):
result = mod_obj._get_id(cr, uid, 'account', 'action_move_line_tree1')
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
result = act_obj.read(cr, uid, [id])[0]
- result['context'] = str({'fiscalyear': context.get('fiscalyear', False)})
+ result['context'] = {
+ 'fiscalyear': context.get('fiscalyear', False),
+ 'account_id': data['id']
+ }
result['domain']=result['domain'][0:-1]+','+domain+result['domain'][-1]
return result
diff --git a/addons/account/wizard/wizard_pay_invoice.py b/addons/account/wizard/wizard_pay_invoice.py
index c8f1197571e..3503070ee21 100644
--- a/addons/account/wizard/wizard_pay_invoice.py
+++ b/addons/account/wizard/wizard_pay_invoice.py
@@ -68,6 +68,13 @@ def _pay_and_reconcile(self, cr, uid, data, context):
ctx = {'date':data['form']['date']}
amount = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, amount, context=ctx)
+
+ # Take the choosen date
+ if form.has_key('comment'):
+ context={'date_p':form['date'],'comment':form['comment']}
+ else:
+ context={'date_p':form['date'],'comment':False}
+
acc_id = journal.default_credit_account_id and journal.default_credit_account_id.id
if not acc_id:
raise wizard.except_wizard(_('Error !'), _('Your journal must have a default credit and debit account.'))
@@ -80,7 +87,7 @@ def _wo_check(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
invoice = pool.get('account.invoice').browse(cr, uid, data['id'], context)
journal = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context)
- if invoice.company_id.currency_id.id<>journal.currency.id:
+ if invoice.company_id.currency_id.id<>journal.currency.id or journal.currency.id <> invoice.currency_id.id:
return 'addendum'
if pool.get('res.currency').is_zero(cr, uid, invoice.currency_id,
(data['form']['amount'] - invoice.amount_total)):
@@ -92,11 +99,13 @@ _transaction_add_form = '''
+
'''
_transaction_add_fields = {
'writeoff_acc_id': {'string':'Write-Off account', 'type':'many2one', 'relation':'account.account', 'required':True},
'writeoff_journal_id': {'string': 'Write-Off journal', 'type': 'many2one', 'relation':'account.journal', 'required':True},
+ 'comment': {'string': 'Entry Name', 'type':'char', 'size': 64, 'required':True},
}
def _get_value_addendum(self, cr, uid, data, context={}):
diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml
index 4aaced6c4f6..d643f44feb7 100644
--- a/addons/delivery/delivery_view.xml
+++ b/addons/delivery/delivery_view.xml
@@ -124,10 +124,9 @@
sale.order
-
+
-
-
+
@@ -195,4 +194,4 @@
-
\ No newline at end of file
+
diff --git a/addons/membership/membership_view.xml b/addons/membership/membership_view.xml
index fdfe3ba3e4e..16ac3e910cc 100644
--- a/addons/membership/membership_view.xml
+++ b/addons/membership/membership_view.xml
@@ -318,7 +318,7 @@
res.partner
-
+
@@ -341,7 +341,7 @@
-
+
diff --git a/addons/product/partner_view.xml b/addons/product/partner_view.xml
index 68fc31d3640..c13194c47e6 100644
--- a/addons/product/partner_view.xml
+++ b/addons/product/partner_view.xml
@@ -7,9 +7,12 @@
form
-
-
-
+
+
+
+
+
+
diff --git a/addons/product/product.py b/addons/product/product.py
index 529936bec0b..a9bf05ad65c 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -328,6 +328,13 @@ class product_template(osv.osv):
product_template()
class product_product(osv.osv):
+ def view_header_get(self, cr, uid, view_id, view_type, context):
+ res = super(product_product, self).view_header_get(cr, uid, view_id, view_type, context)
+ if res: return res
+ if (not context.get('categ_id', False)):
+ return False
+ return _('Products: ')+self.pool.get('product.category').browse(cr, uid, context['categ_id'], context).name
+
def _product_price(self, cr, uid, ids, name, arg, context={}):
res = {}
quantity = context.get('quantity', 1)
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 61e00f64916..aed5604555e 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -46,64 +46,64 @@
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
@@ -162,8 +162,7 @@
-
-
+
@@ -199,12 +198,13 @@
- product.normal.action.tree
+
ir.actions.act_window
product.product
form
tree,form
[('categ_id','child_of',[active_id])]
+ {'categ_id':active_id}
diff --git a/addons/purchase/partner_view.xml b/addons/purchase/partner_view.xml
index 188ac119d79..cdab52d471f 100644
--- a/addons/purchase/partner_view.xml
+++ b/addons/purchase/partner_view.xml
@@ -7,9 +7,11 @@
form
-
-
-
+
+
+
+
+
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 35c46825008..688892ee02f 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -99,10 +99,10 @@ class purchase_order(osv.osv):
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', states={'posted':[('readonly',True)]}),
'location_id': fields.many2one('stock.location', 'Delivery destination', required=True),
- 'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}),
+ 'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}, help="The pricelist sets the currency used for this purchase order. It also computes the supplier price for the selected products/quantities."),
'state': fields.selection([('draft', 'Request for Quotation'), ('wait', 'Waiting'), ('confirmed', 'Confirmed'), ('approved', 'Approved'),('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled')], 'Order State', readonly=True, help="The state of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' state. Then the order has to be confirmed by the user, the state switch to 'Confirmed'. Then the supplier must confirm the order to change the state to 'Approved'. When the purchase order is paid and received, the state becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the state becomes in exception.", select=True),
- 'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order State', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}),
+ 'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}),
'validator' : fields.many2one('res.users', 'Validated by', readonly=True),
'notes': fields.text('Notes'),
'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),
@@ -331,7 +331,7 @@ class purchase_order_line(osv.osv):
}
_table = 'purchase_order_line'
_name = 'purchase.order.line'
- _description = 'Purchase Order line'
+ _description = 'Purchase Order lines'
def copy(self, cr, uid, id, default=None,context={}):
if not default:
default = {}
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 57bdae954ec..5484b22ea8b 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -1,10 +1,6 @@
-
- Suppliers
-
-
@@ -13,23 +9,23 @@
form
diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml
index e060ab15ca0..1eb0b03f75a 100644
--- a/addons/stock/product_view.xml
+++ b/addons/stock/product_view.xml
@@ -8,12 +8,14 @@
form
-
-
-
-
-
-
+
@@ -48,8 +50,8 @@
-
-
+
+
product.normal.stock.form.inherit
@@ -58,13 +60,13 @@
-
+
-
-
-
-
-
+
+
+
+
+
@@ -76,12 +78,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 7b3c1bd0c77..5c50d3bead7 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -1135,6 +1135,8 @@ class product_product(osv.osv):
# Utiliser browse pour limiter les queries !
#
def view_header_get(self, cr, user, view_id, view_type, context):
+ res = super(product_product, self).view_header_get(cr, user, view_id, view_type, context)
+ if res: return res
if (not context.get('location', False)):
return False
cr.execute('select name from stock_location where id=%d', (context['location'],))
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index f1d8550cd1d..256ee36b4e4 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -55,20 +55,19 @@
form
@@ -185,7 +184,6 @@
-
@@ -310,27 +308,27 @@
form
@@ -538,12 +536,12 @@
form