diff --git a/addons/account/i18n/it.po b/addons/account/i18n/it.po index d38b9e78254..3e1cac8d4b5 100644 --- a/addons/account/i18n/it.po +++ b/addons/account/i18n/it.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-04-26 07:46+0000\n" +"PO-Revision-Date: 2010-05-10 08:37+0000\n" "Last-Translator: eLBati - albatos.com \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-28 03:44+0000\n" +"X-Launchpad-Export-Date: 2010-05-11 04:18+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -1192,7 +1192,7 @@ msgstr "Report tassa" #: wizard_button:account.analytic.account.chart,init,open:0 #: wizard_button:account.chart,init,open:0 msgid "Open Charts" -msgstr "Apri" +msgstr "Apri conti" #. module: account #: wizard_view:account.fiscalyear.close.state,init:0 @@ -4162,7 +4162,7 @@ msgstr "Fattura" #: wizard_button:account.open_closed_fiscalyear,init,open:0 #: wizard_button:account_use_models,create,open_move:0 msgid "Open" -msgstr "Apri" +msgstr "Aperto" #. module: account #: model:ir.ui.menu,name:account.next_id_29 diff --git a/addons/base_vat/partner.py b/addons/base_vat/partner.py index a056171f730..e21aac5fa29 100644 --- a/addons/base_vat/partner.py +++ b/addons/base_vat/partner.py @@ -24,6 +24,11 @@ from osv import osv from osv import fields import string from tools.func import partial +from tools.translate import _ + +_ref_vat = { + 'be': 'BE0477472701', +} def mult_add(i, j): """Sum each digits of the multiplication of i and j.""" @@ -32,6 +37,10 @@ def mult_add(i, j): class res_partner(osv.osv): _inherit = 'res.partner' + def _split_vat(self, vat): + vat_country, vat_number = vat[:2].lower(), vat[2:].replace(' ', '') + return vat_country, vat_number + def check_vat(self, cr, uid, ids): ''' Check the VAT number depending of the country. @@ -39,11 +48,9 @@ class res_partner(osv.osv): ''' for partner in self.browse(cr, uid, ids): if not partner.vat: - continue #FIXME return False? empty vat numbre is invalid? - - vat_country, vat_number = partner.vat[:2].lower(), partner.vat[2:].replace(' ', '') - res = self.pool.get('res.country').search(cr, uid, [('code', '=', vat_country.upper())]) - if not res: + continue + vat_country, vat_number = self._split_vat(partner.vat) + if not hasattr(self, 'check_vat_' + vat_country): return False check = getattr(self, 'check_vat_' + vat_country) if not check(vat_number): @@ -51,26 +58,26 @@ class res_partner(osv.osv): return True - def __getattr__(self, attr): - if not attr.startswith('check_vat_'): - super(res_partner, self).__getattr__(attr) - - def default_vat_check(self, cn, vn): - # by default, a VAT number is valid if: - # it starts with 2 letters - # has more than 3 characters - return len(vn) > 0 and len(cn) == 2 and cn[0] in string.ascii_lowercase and cn[1] in string.ascii_lowercase - - return partial(default_vat_check, self, attr[10:]) - - def vat_change(self, cr, uid, ids, value, context={}): return {'value': {'vat_subjected': bool(value)}} _columns = { 'vat_subjected': fields.boolean('VAT Legal Statement', help="Check this box if the partner is subjected to the VAT. It will be used for the VAT legal statement.") } - _constraints = [(check_vat, "The VAT doesn't seem to be correct.", ["vat"])] + + def _construct_constraint_msg(self, cr, uid, ids): + def default_vat_check(cn, vn): + # by default, a VAT number is valid if: + # it starts with 2 letters + # has more than 3 characters + return cn[0] in string.ascii_lowercase and cn[1] in string.ascii_lowercase + + vat_country, vat_number = self._split_vat(self.browse(cr, uid, ids)[0].vat) + if default_vat_check(vat_country, vat_number): + return _('The Vat does not seems to be correct. You should have entered something like this %s'), (_ref_vat[vat_country]) + return _('The VAT is invalid, it shoul begin with the country code'), () + + _constraints = [(check_vat, _construct_constraint_msg, ["vat"])] # code from the following methods come from Tryton (B2CK) # http://www.tryton.org/hgwebdir.cgi/modules/relationship/file/544d1de586d9/party.py diff --git a/addons/board_manufacturing/board_manufacturing_view.xml b/addons/board_manufacturing/board_manufacturing_view.xml index 17b4bc486bc..191f1818612 100644 --- a/addons/board_manufacturing/board_manufacturing_view.xml +++ b/addons/board_manufacturing/board_manufacturing_view.xml @@ -15,7 +15,7 @@ - + diff --git a/addons/board_warehouse/board_warehouse_view.xml b/addons/board_warehouse/board_warehouse_view.xml index cdc93d9a274..af797401935 100644 --- a/addons/board_warehouse/board_warehouse_view.xml +++ b/addons/board_warehouse/board_warehouse_view.xml @@ -23,7 +23,7 @@
- + diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 91ef20be892..34d8b46bcf4 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -774,7 +774,7 @@ class crm_case_history(osv.osv): """ res = {} for hist in self.browse(cursor, user, ids, context or {}): - res[hist.id] = (hist.email or '/') + ' (' + str(hist.date) + ')\n' + res[hist.id] = (hist.email_from or '/') + ' (' + str(hist.date) + ')\n' res[hist.id] += (hist.description or '') return res diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index f89c558fee4..9608616debd 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -141,8 +141,8 @@ - + diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py index b0d20cd6e55..ae9ff8541c6 100644 --- a/addons/crm/wizard/crm_send_email.py +++ b/addons/crm/wizard/crm_send_email.py @@ -92,9 +92,10 @@ class crm_send_new_email(osv.osv_memory): email_from = data.get('email_from', False) case_pool._history(cr, uid, [case], _('Send'), history=True, email=data['email_to'], details=body, email_from=email_from, message_id=message_id) - x_headers = { - 'Reply-To':"%s" % case.section_id.reply_to, - } + x_headers = dict() + #x_headers = { + # 'Reply-To':"%s" % case.section_id.reply_to, + #} if message_id: x_headers['References'] = "%s" % (message_id) diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index 7e7d31975e5..35b3ed481e9 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -28,6 +28,17 @@ class delivery_carrier(osv.osv): _name = "delivery.carrier" _description = "Carrier and delivery grids" + def name_get(self, cr, uid, ids, context={}): + if not len(ids): + return [] + order_id = context.get('order_id',False) + if not order_id: + res = super(delivery_carrier, self).name_get(cr, uid, ids, context=context) + else: + order = self.pool.get('sale.order').browse(cr, uid, [order_id])[0] + currency = order.pricelist_id.currency_id.name or '' + res = [(r['id'], r['name']+' ('+(str(r['price']))+' '+currency+')') for r in self.read(cr, uid, ids, ['name', 'price'], context)] + return res def get_price(self, cr, uid, ids, field_name, arg=None, context={}): res={} sale_obj=self.pool.get('sale.order') @@ -94,9 +105,7 @@ class delivery_grid(osv.osv): } _order = 'sequence' - def get_price(self, cr, uid, id, order, dt, context): - total = 0 weight = 0 volume = 0 @@ -112,7 +121,6 @@ class delivery_grid(osv.osv): def get_price_from_picking(self, cr, uid, id, total, weight, volume, context={}): grid = self.browse(cr, uid, id, context) - price = 0.0 ok = False diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 16f4a61ed1e..f14d45c79de 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -289,5 +289,16 @@ + + sale.order.multicompany + sale.order + + + +