[MERGE] Merge with lp:openobject-addons

bzr revid: hip@tinyerp.com-20121029110953-vhr0c0enwfis01yr
This commit is contained in:
Hiral Patel (OpenERP)
2012-10-29 16:39:53 +05:30
16 changed files with 126 additions and 91 deletions
-1
View File
@@ -39,7 +39,6 @@ class account_analytic_line(osv.osv):
}
_defaults = {
'date': fields.date.context_today,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
}
_order = 'date desc'
+5 -2
View File
@@ -865,8 +865,11 @@ class account_invoice(osv.osv):
self.check_tax_lines(cr, uid, inv, compute_taxes, ait_obj)
# I disabled the check_total feature
#if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0):
# raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.'))
group_check_total_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'group_supplier_inv_check_total')[1]
group_check_total = self.pool.get('res.groups').browse(cr, uid, group_check_total_id, context=context)
if group_check_total and uid in [x.id for x in group_check_total.users]:
if (inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0)):
raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe encoded total does not match the computed total.'))
if inv.payment_term:
total_fixed = total_percent = 0
+1
View File
@@ -186,6 +186,7 @@
<field name="journal_id" groups="account.group_account_user"
on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
<field name="currency_id" groups="base.group_multi_currency"/>
<field name="check_total" groups="account.group_supplier_inv_check_total"/>
</group>
</group>
<notebook>
+2
View File
@@ -120,6 +120,8 @@ class account_config_settings(osv.osv_memory):
'group_analytic_accounting': fields.boolean('Analytic accounting',
implied_group='analytic.group_analytic_accounting',
help="Allows you to use the analytic accounting."),
'group_check_supplier_invoice_total': fields.boolean('Check the total of supplier invoices',
implied_group="account.group_supplier_inv_check_total"),
}
def _default_company(self, cr, uid, context=None):
+4
View File
@@ -220,6 +220,10 @@
<field name="module_account_check_writing" class="oe_inline"/>
<label for="module_account_check_writing"/>
</div>
<div>
<field name="group_check_supplier_invoice_total" class="oe_inline"/>
<label for="group_check_supplier_invoice_total"/>
</div>
</div>
</group>
<separator string="Bank &amp; Cash"/>
@@ -26,6 +26,11 @@
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_supplier_inv_check_total" model="res.groups">
<field name="name">Check Total on supplier invoices</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="account_move_comp_rule" model="ir.rule">
<field name="name">Account Entry</field>
<field name="model_id" ref="model_account_move"/>
+2 -2
View File
@@ -988,11 +988,11 @@ class account_voucher(osv.osv):
if amount_residual > 0:
account_id = line.voucher_id.company_id.expense_currency_exchange_account_id
if not account_id:
raise osv.except_osv(_('Warning!'),_("First you have to configure the 'Expense Currency Rate' on the company, then create accounting entry for currency rate difference."))
raise osv.except_osv(_('Insufficient Configuration!'),_("You should configure the 'Loss Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates."))
else:
account_id = line.voucher_id.company_id.income_currency_exchange_account_id
if not account_id:
raise osv.except_osv(_('Warning!'),_("First you have to configure the 'Income Currency Rate' on the company, then create accounting entry for currency rate difference."))
raise osv.except_osv(_('Insufficient Configuration!'),_("You should configure the 'Gain Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates."))
# Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise
# the receivable/payable account may have a secondary currency, which render this field mandatory
account_currency_id = company_currency <> current_currency and current_currency or False
+8 -1
View File
@@ -305,8 +305,15 @@ class account_analytic_line(osv.osv):
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
}
def _get_default_date(self, cr, uid, context=None):
return fields.date.context_today(self, cr, uid, context=context)
def __get_default_date(self, cr, uid, context=None):
return self._get_default_date(cr, uid, context=context)
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d'),
'date': __get_default_date,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
'amount': 0.00
}
@@ -223,16 +223,26 @@ class hr_timesheet_sheet(osv.osv):
hr_timesheet_sheet()
class hr_timesheet_line(osv.osv):
_inherit = "hr.analytic.timesheet"
class account_analytic_line(osv.osv):
_inherit = "account.analytic.line"
def _get_default_date(self, cr, uid, context=None):
if context is None:
context = {}
if 'date' in context:
return context['date']
return time.strftime('%Y-%m-%d')
#get the default date (should be: today)
res = super(account_analytic_line, self)._get_default_date(cr, uid, context=context)
#if we got the dates from and to from the timesheet and if the default date is in between, we use the default
#but if the default isn't included in those dates, we use the date start of the timesheet as default
if context.get('timesheet_date_from') and context.get('timesheet_date_to'):
if context['timesheet_date_from'] <= res <= context['timesheet_date_to']:
return res
return context.get('timesheet_date_from')
#if we don't get the dates from the timesheet, we return the default value from super()
return res
class hr_timesheet_line(osv.osv):
_inherit = "hr.analytic.timesheet"
def _sheet(self, cursor, user, ids, name, args, context=None):
sheet_obj = self.pool.get('hr_timesheet_sheet.sheet')
@@ -278,9 +288,6 @@ class hr_timesheet_line(osv.osv):
},
),
}
_defaults = {
'date': _get_default_date,
}
def _check_sheet_state(self, cr, uid, ids, context=None):
if context is None:
@@ -103,7 +103,7 @@
</widget>
</page>
<page string="Details">
<field context="{'user_id':user_id}" name="timesheet_ids" nolabel="1">
<field context="{'user_id':user_id, 'timesheet_date_from': date_from, 'timesheet_date_to': date_to}}" name="timesheet_ids" nolabel="1">
<tree editable="top" string="Timesheet Activities">
<field name="date"/>
<field domain="[('type','in',['normal', 'contract']), ('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
+78 -69
View File
@@ -8,45 +8,45 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-09 00:36+0000\n"
"PO-Revision-Date: 2011-12-22 17:13+0000\n"
"Last-Translator: Tomislav Bosnjakovic <Unknown>\n"
"PO-Revision-Date: 2012-10-28 19:42+0000\n"
"Last-Translator: Marijan Rajic <Unknown>\n"
"Language-Team: Croatian <hr@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: 2012-10-19 05:36+0000\n"
"X-Generator: Launchpad (build 16165)\n"
"X-Launchpad-Export-Date: 2012-10-29 05:00+0000\n"
"X-Generator: Launchpad (build 16194)\n"
#. module: mail
#: field:mail.compose.message,subtype:0 field:mail.message,subtype:0
#: field:mail.message.common,subtype:0
msgid "Message Type"
msgstr ""
msgstr "Tip poruke"
#. module: mail
#: help:mail.compose.message,auto_delete:0
msgid "Permanently delete emails after sending"
msgstr ""
msgstr "Trajno obrisati e-poštu nakon slanja"
#. module: mail
#: view:mail.message:0
msgid "Open Related Document"
msgstr ""
msgstr "Otvori povezani dokument"
#. module: mail
#: view:mail.message:0
msgid "Open Attachments"
msgstr "Otvori privitke"
msgstr "Otvori priloge"
#. module: mail
#: view:mail.message:0
msgid "Message Details"
msgstr "Detalji poruke"
msgstr "Detalji porukue"
#. module: mail
#: view:mail.thread:0
msgid "Communication History"
msgstr ""
msgstr "Povijest komunikacije"
#. module: mail
#: view:mail.message:0
@@ -57,73 +57,73 @@ msgstr "Grupiraj po..."
#: model:ir.actions.act_window,name:mail.action_email_compose_message_wizard
#: view:mail.compose.message:0
msgid "Compose Email"
msgstr ""
msgstr "Sastavi e-poštu"
#. module: mail
#: help:mail.compose.message,body_text:0 help:mail.message,body_text:0
#: help:mail.message.common,body_text:0
msgid "Plain-text version of the message"
msgstr ""
msgstr "Verzija poruke u običnom tekstu"
#. module: mail
#: view:mail.compose.message:0
msgid "Body"
msgstr ""
msgstr "Sadržaj"
#. module: mail
#: help:mail.compose.message,email_to:0 help:mail.message,email_to:0
#: help:mail.message.common,email_to:0
msgid "Message recipients"
msgstr ""
msgstr "Primatelji poruke"
#. module: mail
#: field:mail.compose.message,body_text:0 field:mail.message,body_text:0
#: field:mail.message.common,body_text:0
msgid "Text Contents"
msgstr ""
msgstr "Sadržaj"
#. module: mail
#: view:mail.message:0 selection:mail.message,state:0
msgid "Received"
msgstr ""
msgstr "Primljeno"
#. module: mail
#: view:mail.message:0
msgid "Thread"
msgstr ""
msgstr "Nit"
#. module: mail
#: field:mail.message,mail_server_id:0
msgid "Outgoing mail server"
msgstr ""
msgstr "Izlazni poslužitelj e-pošte"
#. module: mail
#: selection:mail.message,state:0
msgid "Cancelled"
msgstr ""
msgstr "Otkazano"
#. module: mail
#: field:mail.compose.message,reply_to:0 field:mail.message,reply_to:0
#: field:mail.message.common,reply_to:0
msgid "Reply-To"
msgstr ""
msgstr "Odgovori na"
#. module: mail
#: help:mail.compose.message,body_html:0 help:mail.message,body_html:0
#: help:mail.message.common,body_html:0
msgid "Rich-text/HTML version of the message"
msgstr ""
msgstr "Verzija poruke u Rich-text/HTML formatu"
#. module: mail
#: field:mail.compose.message,auto_delete:0 field:mail.message,auto_delete:0
msgid "Auto Delete"
msgstr ""
msgstr "Auto brisanje"
#. module: mail
#: help:mail.compose.message,email_bcc:0 help:mail.message,email_bcc:0
#: help:mail.message.common,email_bcc:0
msgid "Blind carbon copy message recipients"
msgstr ""
msgstr "Primatelji skrivene kopije poruke"
#. module: mail
#: model:ir.model,name:mail.model_res_partner view:mail.message:0
@@ -134,13 +134,13 @@ msgstr "Partner"
#: field:mail.compose.message,subject:0 field:mail.message,subject:0
#: field:mail.message.common,subject:0
msgid "Subject"
msgstr ""
msgstr "Naslov"
#. module: mail
#: code:addons/mail/wizard/mail_compose_message.py:152
#, python-format
msgid "On %(date)s, "
msgstr ""
msgstr "Na %(date)s, "
#. module: mail
#: field:mail.compose.message,email_from:0 field:mail.message,email_from:0
@@ -151,32 +151,32 @@ msgstr "Od"
#. module: mail
#: view:mail.message:0
msgid "Email message"
msgstr ""
msgstr "Poruka e-pošte"
#. module: mail
#: view:mail.compose.message:0
msgid "Send"
msgstr ""
msgstr "Pošalji"
#. module: mail
#: view:mail.message:0
msgid "Failed"
msgstr ""
msgstr "Neuspjelo"
#. module: mail
#: view:mail.message:0 field:mail.message,state:0
msgid "State"
msgstr ""
msgstr "Stanje"
#. module: mail
#: view:mail.message:0
msgid "Reply"
msgstr ""
msgstr "Odgovor"
#. module: mail
#: view:mail.message:0 selection:mail.message,state:0
msgid "Sent"
msgstr ""
msgstr "Poslano"
#. module: mail
#: help:mail.compose.message,subtype:0 help:mail.message,subtype:0
@@ -185,39 +185,41 @@ msgid ""
"Type of message, usually 'html' or 'plain', used to select plaintext or rich "
"text contents accordingly"
msgstr ""
"Tip poruke, obično 'html' ili 'običan tekst', koristi se za odabir običnog "
"ili bogatije formatiranog teksta"
#. module: mail
#: view:mail.message:0
msgid "Recipients"
msgstr ""
msgstr "Primatelji"
#. module: mail
#: model:ir.model,name:mail.model_mail_compose_message
msgid "Email composition wizard"
msgstr ""
msgstr "Čarobnjak za sastavljanje e-pošte"
#. module: mail
#: field:mail.compose.message,res_id:0 field:mail.message,res_id:0
#: field:mail.message.common,res_id:0
msgid "Related Document ID"
msgstr ""
msgstr "Povezani ID dokumenta"
#. module: mail
#: view:mail.message:0
msgid "Advanced"
msgstr ""
msgstr "Napredno"
#. module: mail
#: code:addons/mail/wizard/mail_compose_message.py:157
#, python-format
msgid "Re:"
msgstr ""
msgstr "Re:"
#. module: mail
#: field:mail.compose.message,model:0 field:mail.message,model:0
#: field:mail.message.common,model:0
msgid "Related Document Model"
msgstr ""
msgstr "Povezani model dokumenta"
#. module: mail
#: view:mail.message:0
@@ -227,42 +229,42 @@ msgstr "Mjesec"
#. module: mail
#: view:mail.message:0
msgid "Email Search"
msgstr "Pretraživanje e-mailova"
msgstr "Pretraga e-pošte"
#. module: mail
#: help:mail.message,original:0
msgid "Original version of the message, as it was sent on the network"
msgstr ""
msgstr "Originalna varijanta poruke, kakva je poslana na mrežu"
#. module: mail
#: view:mail.message:0
msgid "Partner Name"
msgstr "Naziv partnera"
msgstr "Ime partnera"
#. module: mail
#: view:mail.message:0
msgid "Retry"
msgstr ""
msgstr "Pokušaj ponovo"
#. module: mail
#: view:mail.message:0 selection:mail.message,state:0
msgid "Outgoing"
msgstr ""
msgstr "Odlazno"
#. module: mail
#: view:mail.message:0
msgid "Send Now"
msgstr ""
msgstr "Pošalji odmah"
#. module: mail
#: field:mail.message,partner_id:0
msgid "Related partner"
msgstr ""
msgstr "Povezani partner"
#. module: mail
#: view:mail.message:0
msgid "User"
msgstr ""
msgstr "Korisnik"
#. module: mail
#: field:mail.compose.message,date:0 field:mail.message,date:0
@@ -273,19 +275,19 @@ msgstr "Datum"
#. module: mail
#: view:mail.message:0
msgid "Extended Filters..."
msgstr ""
msgstr "Prošireni filteri..."
#. module: mail
#: code:addons/mail/wizard/mail_compose_message.py:153
#, python-format
msgid "%(sender_name)s wrote:"
msgstr ""
msgstr "%(sender_name)s je napisao:"
#. module: mail
#: field:mail.compose.message,body_html:0 field:mail.message,body_html:0
#: field:mail.message.common,body_html:0
msgid "Rich-text Contents"
msgstr ""
msgstr "Formatirani tekst"
#. module: mail
#: field:mail.message,original:0
@@ -346,18 +348,18 @@ msgstr ""
#. module: mail
#: view:mail.message:0
msgid "Open"
msgstr ""
msgstr "Otvori"
#. module: mail
#: code:addons/mail/mail_thread.py:434
#, python-format
msgid "[OpenERP-Forward-Failed] %s"
msgstr ""
msgstr "[OpenERP-Forward-Failed] %s"
#. module: mail
#: field:mail.message,user_id:0
msgid "Related User"
msgstr ""
msgstr "Povezani korisnik"
#. module: mail
#: help:mail.compose.message,headers:0 help:mail.message,headers:0
@@ -366,11 +368,13 @@ msgid ""
"Full message headers, e.g. SMTP session headers (usually available on "
"inbound messages only)"
msgstr ""
"Cjelovito zaglavlje poruke, npr. zaglavlje SMTP sesije (obično dostupno samo "
"kod dolaznih poruka)"
#. module: mail
#: view:mail.message:0
msgid "Creation Month"
msgstr ""
msgstr "Mjesec kreiranja"
#. module: mail
#: field:mail.compose.message,email_to:0 field:mail.message,email_to:0
@@ -387,7 +391,7 @@ msgstr "Detalji"
#: model:ir.actions.act_window,name:mail.action_view_mailgate_thread
#: view:mail.thread:0
msgid "Email Threads"
msgstr ""
msgstr "Niti e-pošte"
#. module: mail
#: help:mail.compose.message,email_from:0 help:mail.message,email_from:0
@@ -396,28 +400,30 @@ msgid ""
"Message sender, taken from user preferences. If empty, this is not a mail "
"but a message."
msgstr ""
"Pošiljatelj poruke, preuzet iz korisničkih preferenci. Ukoliko je prazno, "
"biti će poruka a ne e-pošta."
#. module: mail
#: view:mail.message:0
msgid "Body (Plain)"
msgstr ""
msgstr "Tijelo (obično)"
#. module: mail
#: code:addons/mail/wizard/mail_compose_message.py:153
#, python-format
msgid "You"
msgstr ""
msgstr "Vi"
#. module: mail
#: help:mail.compose.message,message_id:0 help:mail.message,message_id:0
#: help:mail.message.common,message_id:0
msgid "Message unique identifier"
msgstr ""
msgstr "Jedinstveni identifikator poruke"
#. module: mail
#: view:mail.message:0
msgid "Body (Rich)"
msgstr ""
msgstr "Tijelo (formatirano)"
#. module: mail
#: code:addons/mail/mail_message.py:155
@@ -427,6 +433,9 @@ msgid ""
" Subject: %s \n"
"\t"
msgstr ""
"%s napisano %s: \n"
" Predmet: %s \n"
"\t"
#. module: mail
#: model:ir.actions.act_window,name:mail.act_res_partner_emails
@@ -445,64 +454,64 @@ msgstr "Poruke"
#: field:mail.compose.message,headers:0 field:mail.message,headers:0
#: field:mail.message.common,headers:0
msgid "Message Headers"
msgstr ""
msgstr "Zaglavlja poruke"
#. module: mail
#: field:mail.compose.message,email_bcc:0 field:mail.message,email_bcc:0
#: field:mail.message.common,email_bcc:0
msgid "Bcc"
msgstr "Bcc"
msgstr "Skrivena kopija"
#. module: mail
#: model:ir.model,name:mail.model_mail_message_common
msgid "mail.message.common"
msgstr ""
msgstr "mail.message.common"
#. module: mail
#: help:mail.compose.message,references:0 help:mail.message,references:0
#: help:mail.message.common,references:0
msgid "Message references, such as identifiers of previous messages"
msgstr ""
msgstr "Reference poruke, poput identifikatora prethodnih poruka"
#. module: mail
#: constraint:res.partner:0
msgid "Error ! You cannot create recursive associated members."
msgstr ""
msgstr "Greška! Nije moguće kreirati pridružene članove rekurzivno."
#. module: mail
#: help:mail.compose.message,email_cc:0 help:mail.message,email_cc:0
#: help:mail.message.common,email_cc:0
msgid "Carbon copy message recipients"
msgstr ""
msgstr "Primatelji skrivene kopije"
#. module: mail
#: selection:mail.message,state:0
msgid "Delivery Failed"
msgstr ""
msgstr "Isporuka nije uspjela"
#. module: mail
#: model:ir.model,name:mail.model_mail_message
msgid "Email Message"
msgstr ""
msgstr "Poruka e-pošte"
#. module: mail
#: model:ir.model,name:mail.model_mail_thread view:mail.thread:0
msgid "Email Thread"
msgstr ""
msgstr "Nit e-pošte"
#. module: mail
#: field:mail.compose.message,filter_id:0
msgid "Filters"
msgstr ""
msgstr "Filteri"
#. module: mail
#: code:addons/mail/mail_thread.py:220
#, python-format
msgid "Mail attachment"
msgstr ""
msgstr "Prilog e-pošte"
#. module: mail
#: help:mail.compose.message,reply_to:0 help:mail.message,reply_to:0
#: help:mail.message.common,reply_to:0
msgid "Preferred response address for the message"
msgstr ""
msgstr "Željena povratna adresa za poruku"
+1 -1
View File
@@ -37,7 +37,7 @@ modules.
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'images': ['images/crm_statistics_dashboard.jpeg', 'images/opportunity_to_quote.jpeg'],
'depends': ['sale_stock', 'crm'],
'depends': ['sale', 'crm'],
'data': [
'wizard/crm_make_sale_view.xml',
'sale_crm_view.xml',
+1 -1
View File
@@ -31,7 +31,7 @@ Price and Cost Price.
""",
'author':'OpenERP SA',
'images':['images/sale_margin.jpeg'],
'depends':['sale_stock'],
'depends':['sale'],
'demo':['sale_margin_demo.xml'],
'test': ['test/sale_margin.yml'],
'data':['security/ir.model.access.csv','sale_margin_view.xml'],
-2
View File
@@ -14,7 +14,6 @@
product_uom: product.product_uom_unit
product_uom_qty: 100.0
state: draft
delay: 7.0
product_id: product.product_product_24
product_uos_qty: 100.0
th_weight: 0.0
@@ -23,7 +22,6 @@
partner_id: base.res_partner_4
partner_invoice_id: base.res_partner_address_7
partner_shipping_id: base.res_partner_address_7
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.sale_shop_1
-
+1 -1
View File
@@ -618,7 +618,7 @@ class stock_picking(osv.osv):
def create(self, cr, user, vals, context=None):
if ('name' not in vals) or (vals.get('name')=='/'):
seq_obj_name = 'stock.picking.' + vals['type']
seq_obj_name = self._name
vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name)
new_id = super(stock_picking, self).create(cr, user, vals, context)
if new_id:
@@ -82,7 +82,7 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({
// TODO: Use do_action({menu_id: id, type: 'ir.actions.menu'})
self.rpc('/web/menu/action', {'menu_id': id}).then(function(ir_menu_data) {
if (ir_menu_data.action.length){
instance.webclient.user_menu.on_action({action_id: ir_menu_data.action[0][2].id});
instance.webclient.on_menu_action({action_id: ir_menu_data.action[0][2].id});
}
});
this.$el.find('.oe_systray_shortcuts').trigger('mouseout');