diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py
index 83e5ed4f19f..38707ace374 100644
--- a/addons/marketing_campaign/marketing_campaign.py
+++ b/addons/marketing_campaign/marketing_campaign.py
@@ -26,6 +26,7 @@ from dateutil.relativedelta import relativedelta
from operator import itemgetter
from traceback import format_exception
from sys import exc_info
+from tools.safe_eval import safe_eval as eval
from osv import fields, osv
import netsvc
@@ -82,6 +83,13 @@ class marketing_campaign(osv.osv):
_name = "marketing.campaign"
_description = "Marketing Campaign"
+
+ def _check_has_start(self, cr, uid, ids, context=None):
+ for campaign in self.browse(cr, uid, ids, context=context):
+ if not any(a.start for a in campaign.activity_ids):
+ return False
+ return True
+
_columns = {
'name': fields.char('Name', size=64, required=True),
'object_id': fields.many2one('ir.model', 'Model', required=True,
@@ -90,15 +98,15 @@ this campaign to be run"),
'partner_field_id': fields.many2one('ir.model.fields', 'Partner Field',
domain="[('model_id', '=', object_id), ('ttype', '=', 'many2one'), ('relation', '=', 'res.partner')]",
help="The generated workitems will be linked to the partner related to the record. If the record is the partner itself left this field empty."),
- 'mode':fields.selection([('test', 'Test Directly'),
+ 'mode': fields.selection([('test', 'Test Directly'),
('test_realtime', 'Test in Realtime'),
('manual', 'With Manual Confirmation'),
('active', 'Normal')],
'Mode', required=True, help= \
-"""Test - It creates and process all the activities directly (without waiting for the delay on transitions) but do not send emails or produce reports.
-Test in Realtime - It creates and process all the activities directly but do not send emails or produce reports.
+"""Test - It creates and process all the activities directly (without waiting for the delay on transitions) but does not send emails or produce reports.
+Test in Realtime - It creates and processes all the activities directly but does not send emails or produce reports.
With Manual Confirmation - the campaigns runs normally, but the user has to validate all workitem manually.
-Normal - the campaign runs normally and automatically sends all emails and reports"""),
+Normal - the campaign runs normally and automatically sends all emails and reports (be very careful with this mode, you're live!)"""),
'state': fields.selection([('draft', 'Draft'),
('running', 'Running'),
('done', 'Done'),
@@ -106,32 +114,34 @@ Normal - the campaign runs normally and automatically sends all emails and repor
'State',),
'activity_ids': fields.one2many('marketing.campaign.activity',
'campaign_id', 'Activities'),
- 'fixed_cost': fields.float('Fixed Cost', help="The fixed cost is cost\
-you required for the campaign"),
+ 'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for the campaign (used for campaign analysis), see also variable cost on activities"),
}
+
_defaults = {
'state': lambda *a: 'draft',
'mode': lambda *a: 'test',
}
+
+ _constraints = [(_check_has_start, 'Please mark at least one activity as a start activity', ['Activities'])]
def state_running_set(self, cr, uid, ids, *args):
# TODO check that all subcampaigns are running
campaign = self.browse(cr, uid, ids[0])
if not campaign.activity_ids :
raise osv.except_osv("Error", "There is no activitity in the campaign")
- actvity_ids = [ act_id.id for act_id in campaign.activity_ids]
+ activity_ids = [ act_id.id for act_id in campaign.activity_ids]
+
+ if not activity_ids:
+ raise osv.except_osv(_("Error"), _("The campaign cannot be started : there are no activities in it"))
+
act_obj = self.pool.get('marketing.campaign.activity')
- act_ids = act_obj.search(cr, uid, [('id', 'in', actvity_ids),
- ('start', '=', True)])
- if not act_ids :
- raise osv.except_osv("Error", "There is no starting activitity in the campaign")
- act_ids = act_obj.search(cr, uid, [('id', 'in', actvity_ids),
+ act_ids = act_obj.search(cr, uid, [('id', 'in', activity_ids),
('type', '=', 'email')])
for activity in act_obj.browse(cr, uid, act_ids):
if not activity.email_template_id.enforce_from_account :
- raise osv.except_osv("Error", "Campaign cannot be start : Email Account is missing in email activity")
+ raise osv.except_osv(_("Error"), _("The campaign cannot be started: an email account is missing in the email activity '%s'")%activity.name)
if activity.email_template_id.enforce_from_account.state != 'approved' :
- raise osv.except_osv("Error", "Campaign cannot be start : Email Account is not approved for email activity")
+ raise osv.except_osv(_("Error"), _("The campaign cannot be started: the email account is not approved in the email activity '%s'")%activity.name)
self.write(cr, uid, ids, {'state': 'running'})
return True
@@ -141,7 +151,7 @@ you required for the campaign"),
[('campaign_id', 'in', ids),
('state', '=', 'running')])
if segment_ids :
- raise osv.except_osv("Error", "Campaign cannot be marked as done before all segments are done")
+ raise osv.except_osv(_("Error"), _("The campaign cannot be marked as done before all segments are done"))
self.write(cr, uid, ids, {'state': 'done'})
return True
@@ -187,7 +197,7 @@ you required for the campaign"),
partner_field = campaign.partner_field_id.name
if partner_field:
return getattr(record, partner_field)
- elif campaign.model_id.model == 'res.partner':
+ elif campaign.object_id.model == 'res.partner':
return record
return None
@@ -206,9 +216,10 @@ class marketing_campaign_segment(osv.osv):
string='Object'),
'ir_filter_id': fields.many2one('ir.filters', 'Filter', help=""),
'sync_last_date': fields.datetime('Latest Synchronization'),
- 'sync_mode': fields.selection([('create_date', 'Sync only on creation'),
- ('write_date', 'Sync at each modification')],
- 'Synchronization Mode'),
+ 'sync_mode': fields.selection([('create_date', 'If record created after last sync'),
+ ('write_date', 'If record modified after last sync (no duplicates)')],
+ 'Workitem creation mode',
+ help="Determines when new workitems should be created for records matching a segment."),
'state': fields.selection([('draft', 'Draft'),
('running', 'Running'),
('done', 'Done'),
@@ -269,6 +280,7 @@ class marketing_campaign_segment(osv.osv):
criteria += eval(segment.ir_filter_id.domain)
object_ids = model_obj.search(cr, uid, criteria, context=context)
+ # XXX TODO: rewrite this loop more efficiently without doing 1 search per record!
for o_ids in model_obj.browse(cr, uid, object_ids, context=context):
# avoid duplicated workitem for the same resource
if segment.sync_mode == 'write_date':
@@ -318,9 +330,9 @@ class marketing_campaign_activity(osv.osv):
'object_id': fields.related('campaign_id','object_id',
type='many2one', relation='ir.model',
string='Object', readonly=True),
- 'start': fields.boolean('Start',help= "This activity is launched when the campaign starts."),
+ 'start': fields.boolean('Start', help= "This activity is launched when the campaign starts.", select=True),
'condition': fields.char('Condition', size=256, required=True,
- help="Python condition to know if the activity can be launched"),
+ help="Python condition to know if the activity can be executed, otherwise it will be deleted or cancelled."),
'type': fields.selection(_action_types, 'Type', required=True,
help="Describe type of action to be performed on the Activity.Eg : Send email,Send paper.."),
'email_template_id': fields.many2one('email.template','Email Template'),
@@ -341,9 +353,9 @@ class marketing_campaign_activity(osv.osv):
'variable_cost': fields.float('Variable Cost'),
'revenue': fields.float('Revenue'),
'signal': fields.char('Signal', size=128,
- help='An activity with a signal can be called programmatically. Attention, the workitem is always created when the signal is send'),
- 'keep_if_condition_not_met': fields.boolean('Keep if condition not met',
- help="By activating this option, the workitems that aren't processed because the condition is not met are marked as cancelled instead of being deleted.")
+ help='An activity with a signal can be called programmatically. Be careful, the workitem is always created when a signal is sent'),
+ 'keep_if_condition_not_met': fields.boolean('Keep as cancelled when condition not met',
+ help="By activating this option, workitems that aren't executed because the condition is not met are marked as cancelled instead of being deleted.")
}
_defaults = {
@@ -460,7 +472,7 @@ class marketing_campaign_transition(osv.osv):
('cosmetic', 'Cosmetic'), # fake plastic transition
],
'Trigger', required=True,
- help="How is triggered the destination workitem"),
+ help="How is the destination workitem triggered"),
}
_defaults = {
@@ -516,7 +528,7 @@ class marketing_campaign_workitem(osv.osv):
def button_draft(self, cr, uid, workitem_ids, context={}):
for wi in self.browse(cr, uid, workitem_ids, context=context):
- if wi.state=='exception':
+ if wi.state in ('exception', 'cancelled'):
self.write(cr, uid, [wi.id], {'state':'todo'}, context=context)
return True
@@ -531,13 +543,13 @@ class marketing_campaign_workitem(osv.osv):
return
activity = workitem.activity_id
+ proxy = self.pool.get(workitem.object_id.model)
+ object_id = proxy.browse(cr, uid, workitem.res_id, context=context)
eval_context = {
- 'pool': self.pool,
- 'cr': cr,
- 'uid': uid,
- 'wi': workitem,
- 'object': activity,
+ 'activity': activity,
+ 'workitem': workitem,
+ 'object': object_id,
'transition': activity.to_ids
}
try:
@@ -585,7 +597,7 @@ class marketing_campaign_workitem(osv.osv):
wi_id = self.create(cr, uid, values, context=context)
# Now, depending of the trigger and the campaign mode
- # we now if must run the newly created workitem.
+ # we know if must run the newly created workitem.
#
# rows = transition trigger \ colums = campaign mode
#
@@ -666,6 +678,8 @@ class marketing_campaign_workitem(osv.osv):
'datas' : datas,
'nodestroy': True,
}
+ else:
+ raise osv.except_osv(_('No preview'),_('The current step for this item has no email or report to preview.'))
return res
marketing_campaign_workitem()
@@ -675,6 +689,9 @@ class email_template(osv.osv):
_defaults = {
'object_name': lambda obj, cr, uid, context: context.get('object_id',False),
}
+
+ # TODO: add constraint to prevent disabling / disapproving an email account used in a running campaign
+
email_template()
class report_xml(osv.osv):
diff --git a/addons/marketing_campaign/marketing_campaign_view.xml b/addons/marketing_campaign/marketing_campaign_view.xml
index 1d07fc1e99c..95b9cfbebba 100644
--- a/addons/marketing_campaign/marketing_campaign_view.xml
+++ b/addons/marketing_campaign/marketing_campaign_view.xml
@@ -236,20 +236,15 @@
-
-
-
+
-
-
-
+
@@ -311,8 +306,8 @@
-
-
+
+
@@ -340,7 +335,7 @@
-
+
@@ -350,8 +345,8 @@
-
-
+
+
@@ -384,7 +379,7 @@
- Campaign Activities (Workitems)
+ Campaign Followupir.actions.act_windowmarketing.campaign.workitemform
diff --git a/addons/mrp/i18n/pl.po b/addons/mrp/i18n/pl.po
index 5c744899ee2..bd1e6a04652 100644
--- a/addons/mrp/i18n/pl.po
+++ b/addons/mrp/i18n/pl.po
@@ -1,19 +1,19 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * mrp
+# * mrp
#
msgid ""
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-05-21 08:19+0000\n"
+"PO-Revision-Date: 2010-07-18 15:01+0000\n"
"Last-Translator: Grzegorz Grzelak (Cirrus.pl) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-22 03:56+0000\n"
+"X-Launchpad-Export-Date: 2010-07-19 03:41+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
@@ -45,7 +45,7 @@ msgstr "Planowanie zasobów produkcyjnych (MRP)"
#. module: mrp
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nieprawidłowa nazwa modelu w definicji akcji."
#. module: mrp
#: field:mrp.bom.revision,indice:0
@@ -91,12 +91,14 @@ msgid "Stockable Stock"
msgstr "Zapas rejestrowany"
#. module: mrp
-#: field:mrp.procurement,origin:0 field:mrp.production,origin:0
+#: field:mrp.procurement,origin:0
+#: field:mrp.production,origin:0
msgid "Origin"
msgstr "Pochodzenie"
#. module: mrp
-#: model:ir.ui.menu,name:mrp.menu_mrp_configuration view:res.company:0
+#: model:ir.ui.menu,name:mrp.menu_mrp_configuration
+#: view:res.company:0
msgid "Configuration"
msgstr "Konfiguracja"
@@ -175,7 +177,8 @@ msgstr "Automatyczne nabycia"
#. module: mrp
#: wizard_field:change_production_qty,confirm,product_qty:0
-#: field:mrp.bom,product_qty:0 field:mrp.production,product_qty:0
+#: field:mrp.bom,product_qty:0
+#: field:mrp.production,product_qty:0
#: field:mrp.production.product.line,product_qty:0
msgid "Product Qty"
msgstr "Ilość produktu"
@@ -203,7 +206,7 @@ msgstr "Wyjątek przesunięcia"
#. module: mrp
#: model:process.node,note:mrp.process_node_orderrfq0
msgid "A purchase order is created for a sub-contracting demand."
-msgstr ""
+msgstr "Zamówienie zakupu zostało utworzone dla podwykonawcy."
#. module: mrp
#: rml:mrp.production.order:0
@@ -262,7 +265,8 @@ msgid "Internal Ref."
msgstr "Wewn. odnośnik"
#. module: mrp
-#: view:mrp.procurement:0 field:mrp.procurement,state:0
+#: view:mrp.procurement:0
+#: field:mrp.procurement,state:0
#: field:mrp.production,state:0
msgid "Status"
msgstr "Stan"
@@ -304,26 +308,29 @@ msgstr ""
#. module: mrp
#: model:ir.actions.act_window,name:mrp.mrp_production_action
-#: model:ir.ui.menu,name:mrp.menu_mrp_production_action view:mrp.production:0
+#: model:ir.ui.menu,name:mrp.menu_mrp_production_action
+#: view:mrp.production:0
msgid "Production Orders"
msgstr "Zamówienia produkcji"
#. module: mrp
-#: rml:bom.structure:0 field:mrp.procurement,product_qty:0
+#: rml:bom.structure:0
+#: field:mrp.procurement,product_qty:0
#: rml:mrp.production.order:0
#: wizard_field:product.product.procurement,init,qty:0
msgid "Quantity"
msgstr "Ilość"
#. module: mrp
-#: selection:mrp.procurement,priority:0 selection:mrp.production,priority:0
+#: selection:mrp.procurement,priority:0
+#: selection:mrp.production,priority:0
msgid "Not urgent"
msgstr "Nie pilne"
#. module: mrp
#: model:process.transition,name:mrp.process_transition_procureserviceproduct0
msgid "Procure Service Product"
-msgstr ""
+msgstr "Nabycie usługi"
#. module: mrp
#: view:mrp.production:0
@@ -359,10 +366,11 @@ msgstr "Proces nabycia"
#. module: mrp
#: field:mrp.production,date_planned_date:0
msgid "Scheduled Date"
-msgstr ""
+msgstr "Zaplanowana data"
#. module: mrp
-#: selection:mrp.procurement,priority:0 selection:mrp.production,priority:0
+#: selection:mrp.procurement,priority:0
+#: selection:mrp.production,priority:0
msgid "Urgent"
msgstr "Pilne"
@@ -478,19 +486,20 @@ msgid "Stockable Product Stock"
msgstr ""
#. module: mrp
-#: field:mrp.bom,product_uos:0 field:mrp.production.product.line,product_uos:0
+#: field:mrp.bom,product_uos:0
+#: field:mrp.production.product.line,product_uos:0
msgid "Product UOS"
msgstr "JS produktu"
#. module: mrp
#: model:process.transition,name:mrp.process_transition_productionprocureproducts0
msgid "Production Procure Products"
-msgstr ""
+msgstr "Nabycie z produkcji"
#. module: mrp
#: model:process.process,name:mrp.process_process_serviceproductprocess0
msgid "Service Product Process"
-msgstr ""
+msgstr "Proces usługi"
#. module: mrp
#: model:process.transition,note:mrp.process_transition_purchaseprocure0
@@ -544,7 +553,7 @@ msgstr "Czas produkcji"
#: model:ir.actions.act_window,name:mrp.mrp_procurement_action4
#: model:ir.ui.menu,name:mrp.menu_mrp_procurement_action4
msgid "Exceptions Procurements to Fix"
-msgstr ""
+msgstr "Wyjątki nabycia do poprawienia"
#. module: mrp
#: selection:mrp.procurement,state:0
@@ -602,8 +611,10 @@ msgid "Waiting"
msgstr "Oczekiwanie"
#. module: mrp
-#: model:ir.model,name:mrp.model_mrp_routing field:mrp.bom,routing_id:0
-#: field:mrp.production,routing_id:0 view:mrp.routing:0
+#: model:ir.model,name:mrp.model_mrp_routing
+#: field:mrp.bom,routing_id:0
+#: field:mrp.production,routing_id:0
+#: view:mrp.routing:0
#: model:process.node,name:mrp.process_node_routing0
msgid "Routing"
msgstr "Marszruta"
@@ -676,7 +687,8 @@ msgid "Production orders"
msgstr "Zamówienia produkcji"
#. module: mrp
-#: field:mrp.bom,child_complete_ids:0 field:mrp.bom,child_ids:0
+#: field:mrp.bom,child_complete_ids:0
+#: field:mrp.bom,child_ids:0
msgid "BoM Hyerarchy"
msgstr "Hierarchia Zest. Mat."
@@ -702,7 +714,8 @@ msgid "Security Days"
msgstr "Dni na wszelki wypadek"
#. module: mrp
-#: view:mrp.production:0 field:mrp.production,cycle_total:0
+#: view:mrp.production:0
+#: field:mrp.production,cycle_total:0
msgid "Total Cycles"
msgstr "Suma cykli"
@@ -762,7 +775,9 @@ msgid "Production done"
msgstr "Produkcja wykonana"
#. module: mrp
-#: rml:bom.structure:0 field:mrp.bom,code:0 field:mrp.routing,code:0
+#: rml:bom.structure:0
+#: field:mrp.bom,code:0
+#: field:mrp.routing,code:0
#: field:mrp.workcenter,code:0
msgid "Code"
msgstr "Kod"
@@ -774,7 +789,8 @@ msgstr "Liczba godzin"
#. module: mrp
#: model:ir.model,name:mrp.model_mrp_property_group
-#: field:mrp.property,group_id:0 field:mrp.property.group,name:0
+#: field:mrp.property,group_id:0
+#: field:mrp.property.group,name:0
msgid "Property Group"
msgstr "Grupa właściwości"
@@ -789,12 +805,14 @@ msgid "References"
msgstr "Odnośniki"
#. module: mrp
-#: wizard_button:change_production_qty,confirm,end:0 view:mrp.procurement:0
+#: wizard_button:change_production_qty,confirm,end:0
+#: view:mrp.procurement:0
#: selection:mrp.procurement,state:0
#: wizard_button:mrp.procurement.compute,init,end:0
#: wizard_button:mrp.procurement.compute.all,init,end:0
#: wizard_button:mrp.procurement.orderpoint.compute,init,end:0
-#: view:mrp.production:0 wizard_button:mrp.workcenter.load,init,end:0
+#: view:mrp.production:0
+#: wizard_button:mrp.workcenter.load,init,end:0
#: wizard_button:product.product.procurement,init,end:0
#: wizard_button:product_price,init,end:0
msgid "Cancel"
@@ -876,10 +894,14 @@ msgid "Nbr of cycle"
msgstr "Liczba cykli"
#. module: mrp
-#: field:mrp.bom,name:0 field:mrp.procurement,name:0
-#: rml:mrp.production.order:0 field:mrp.production.product.line,name:0
-#: field:mrp.property,name:0 field:mrp.routing,name:0
-#: field:mrp.routing.workcenter,name:0 field:stock.warehouse.orderpoint,name:0
+#: field:mrp.bom,name:0
+#: field:mrp.procurement,name:0
+#: rml:mrp.production.order:0
+#: field:mrp.production.product.line,name:0
+#: field:mrp.property,name:0
+#: field:mrp.routing,name:0
+#: field:mrp.routing.workcenter,name:0
+#: field:stock.warehouse.orderpoint,name:0
msgid "Name"
msgstr "Nazwa"
@@ -992,7 +1014,8 @@ msgid "Notes"
msgstr "Uwagi"
#. module: mrp
-#: model:ir.model,name:mrp.model_mrp_bom view:mrp.bom:0
+#: model:ir.model,name:mrp.model_mrp_bom
+#: view:mrp.bom:0
#: field:mrp.production,bom_id:0
msgid "Bill of Material"
msgstr "Zestawienie materiałowe"
@@ -1053,7 +1076,8 @@ msgid "Sale Ref"
msgstr "Odnośnik sprzedaży"
#. module: mrp
-#: field:mrp.procurement,priority:0 field:mrp.production,priority:0
+#: field:mrp.procurement,priority:0
+#: field:mrp.production,priority:0
#: rml:mrp.production.order:0
msgid "Priority"
msgstr "Priorytet"
@@ -1082,7 +1106,8 @@ msgstr "Narzędzie"
#. module: mrp
#: help:mrp.production,location_src_id:0
-msgid "Location where the system will look for products used in raw materials."
+msgid ""
+"Location where the system will look for products used in raw materials."
msgstr ""
"Strefa, w której system oczekuje produktów jako materiałów do produkcji."
@@ -1118,7 +1143,8 @@ msgid "Max Quantity"
msgstr "Ilość maks."
#. module: mrp
-#: model:ir.model,name:mrp.model_mrp_procurement view:mrp.procurement:0
+#: model:ir.model,name:mrp.model_mrp_procurement
+#: view:mrp.procurement:0
msgid "Procurement"
msgstr "Nabycie"
@@ -1168,7 +1194,8 @@ msgid "Procurement for raw materials."
msgstr "Nabycie dla materiałów do produkcji."
#. module: mrp
-#: view:mrp.procurement:0 field:mrp.procurement,note:0
+#: view:mrp.procurement:0
+#: field:mrp.procurement,note:0
#: rml:mrp.production.order:0
msgid "Note"
msgstr "Uwaga"
@@ -1194,8 +1221,10 @@ msgid "Define a routing to describe the manufacturing steps."
msgstr "Zdefiniuj marszrutę, aby opisać kroki produkcyjne."
#. module: mrp
-#: field:mrp.bom,active:0 field:mrp.routing,active:0
-#: field:mrp.workcenter,active:0 field:stock.warehouse.orderpoint,active:0
+#: field:mrp.bom,active:0
+#: field:mrp.routing,active:0
+#: field:mrp.workcenter,active:0
+#: field:stock.warehouse.orderpoint,active:0
msgid "Active"
msgstr "Aktywne"
@@ -1208,18 +1237,23 @@ msgstr "Nabądź produkty"
#: model:ir.actions.act_window,name:mrp.mrp_property_action
#: model:ir.ui.menu,name:mrp.menu_mrp_property_action
#: model:ir.ui.menu,name:mrp.menu_mrp_property_group_action_prop
-#: view:mrp.bom:0 field:mrp.bom,property_ids:0 view:mrp.procurement:0
-#: field:mrp.procurement,property_ids:0 view:mrp.property:0
+#: view:mrp.bom:0
+#: field:mrp.bom,property_ids:0
+#: view:mrp.procurement:0
+#: field:mrp.procurement,property_ids:0
+#: view:mrp.property:0
msgid "Properties"
msgstr "Właściwości"
#. module: mrp
-#: field:mrp.procurement,date_planned:0 field:mrp.production,date_planned:0
+#: field:mrp.procurement,date_planned:0
+#: field:mrp.production,date_planned:0
msgid "Scheduled date"
msgstr "Planowana data"
#. module: mrp
-#: view:mrp.procurement:0 view:mrp.production:0
+#: view:mrp.procurement:0
+#: view:mrp.production:0
msgid "Extra Information"
msgstr "Dodatkowe informacje"
@@ -1267,7 +1301,8 @@ msgid "Change Product Qty."
msgstr "Zmień ilość produktu"
#. module: mrp
-#: selection:mrp.procurement,state:0 selection:mrp.production,state:0
+#: selection:mrp.procurement,state:0
+#: selection:mrp.production,state:0
msgid "Done"
msgstr "Wykonano"
@@ -1315,15 +1350,18 @@ msgid "Capacity per Cycle"
msgstr "Ilość na cykl"
#. module: mrp
-#: field:mrp.bom,product_id:0 field:mrp.procurement,product_id:0
-#: field:mrp.production,product_id:0 rml:mrp.production.order:0
+#: field:mrp.bom,product_id:0
+#: field:mrp.procurement,product_id:0
+#: field:mrp.production,product_id:0
+#: rml:mrp.production.order:0
#: field:mrp.production.product.line,product_id:0
#: field:stock.warehouse.orderpoint,product_id:0
msgid "Product"
msgstr "Produkt"
#. module: mrp
-#: view:mrp.production:0 field:mrp.production,hour_total:0
+#: view:mrp.production:0
+#: field:mrp.production,hour_total:0
msgid "Total Hours"
msgstr "Suma godzin"
@@ -1338,7 +1376,8 @@ msgid "Product BoM Structure"
msgstr "Struktura Zest. Mat. produktu"
#. module: mrp
-#: field:mrp.bom,product_uom:0 field:mrp.production,product_uom:0
+#: field:mrp.bom,product_uom:0
+#: field:mrp.production,product_uom:0
#: field:mrp.production.product.line,product_uom:0
#: field:stock.warehouse.orderpoint,product_uom:0
msgid "Product UOM"
@@ -1364,14 +1403,16 @@ msgid "Product type is Stockable and procure method is make to stock"
msgstr "Typ produktu jest Rejestrowany i metoda nabycia jest Na zapas."
#. module: mrp
-#: help:mrp.bom,date_start:0 help:mrp.bom,date_stop:0
+#: help:mrp.bom,date_start:0
+#: help:mrp.bom,date_stop:0
msgid "Validity of this BoM or component. Keep empty if it's always valid."
msgstr ""
"Ważność tego Zestawienia materiałowego lub komponentu. Pozostaw puste, jeśli "
"ma być zawsze ważny."
#. module: mrp
-#: field:mrp.procurement,product_uos:0 field:mrp.production,product_uos:0
+#: field:mrp.procurement,product_uos:0
+#: field:mrp.production,product_uos:0
msgid "Product UoS"
msgstr "JS produktu"
@@ -1383,12 +1424,14 @@ msgstr "JM produktu"
#. module: mrp
#: model:ir.model,name:mrp.model_mrp_workcenter
#: field:mrp.production.workcenter.line,workcenter_id:0
-#: field:mrp.routing.workcenter,workcenter_id:0 view:mrp.workcenter:0
+#: field:mrp.routing.workcenter,workcenter_id:0
+#: view:mrp.workcenter:0
msgid "Workcenter"
msgstr "Centrum robocze"
#. module: mrp
-#: selection:mrp.procurement,priority:0 selection:mrp.production,priority:0
+#: selection:mrp.procurement,priority:0
+#: selection:mrp.production,priority:0
msgid "Very Urgent"
msgstr "Bardzo pilne"
@@ -1428,7 +1471,8 @@ msgid "Stockable Order Request"
msgstr ""
#. module: mrp
-#: view:mrp.production:0 view:mrp.production.product.line:0
+#: view:mrp.production:0
+#: view:mrp.production.product.line:0
msgid "Scheduled Products"
msgstr "Zaplanowane produkty"
@@ -1455,7 +1499,8 @@ msgstr "Jeśli w zamówieniu nabycia produkt jest typu Rejestrowany."
#. module: mrp
#: model:ir.model,name:mrp.model_mrp_production_workcenter_line
-#: view:mrp.production:0 rml:mrp.production.order:0
+#: view:mrp.production:0
+#: rml:mrp.production.order:0
msgid "Work Orders"
msgstr "Centra robocze"
@@ -1603,7 +1648,8 @@ msgstr "Wykorzystanie centrów roboczych"
msgid ""
"Efficiency on the production. A factor of 0.9 means a loss of 10% in the "
"production."
-msgstr "Efektywność produkcji. Współczynnik 0,9 oznacza stratę 10% produkcji."
+msgstr ""
+"Efektywność produkcji. Współczynnik 0,9 oznacza stratę 10% produkcji."
#. module: mrp
#: field:mrp.bom,product_rounding:0
@@ -1693,7 +1739,8 @@ msgid "plus"
msgstr "plus"
#. module: mrp
-#: field:mrp.bom.revision,bom_id:0 field:mrp.procurement,bom_id:0
+#: field:mrp.bom.revision,bom_id:0
+#: field:mrp.procurement,bom_id:0
msgid "BoM"
msgstr "Zest. Mat."
@@ -1737,7 +1784,8 @@ msgid "last indice"
msgstr ""
#. module: mrp
-#: field:mrp.bom,revision_ids:0 view:mrp.bom.revision:0
+#: field:mrp.bom,revision_ids:0
+#: view:mrp.bom.revision:0
msgid "BoM Revisions"
msgstr "Wersje Zest. Mat."
@@ -1747,12 +1795,14 @@ msgid "Retry"
msgstr "Powtórz"
#. module: mrp
-#: selection:mrp.procurement,state:0 selection:mrp.production,state:0
+#: selection:mrp.procurement,state:0
+#: selection:mrp.production,state:0
msgid "Draft"
msgstr "Projekt"
#. module: mrp
-#: selection:mrp.procurement,priority:0 selection:mrp.production,priority:0
+#: selection:mrp.procurement,priority:0
+#: selection:mrp.production,priority:0
msgid "Normal"
msgstr "Normalne"
@@ -1806,8 +1856,11 @@ msgid "from stock"
msgstr "z zapasu"
#. module: mrp
-#: view:mrp.bom:0 view:mrp.property:0 view:mrp.property.group:0
-#: view:mrp.routing:0 view:mrp.routing.workcenter:0
+#: view:mrp.bom:0
+#: view:mrp.property:0
+#: view:mrp.property.group:0
+#: view:mrp.routing:0
+#: view:mrp.routing.workcenter:0
msgid "General Information"
msgstr "Informacje ogólne"
@@ -1860,10 +1913,14 @@ msgid "Change Product Qty"
msgstr "Zmień ilość produktu"
#. module: mrp
-#: field:mrp.bom.revision,description:0 view:mrp.property:0
-#: field:mrp.property,description:0 field:mrp.property.group,description:0
-#: view:mrp.routing:0 field:mrp.routing,note:0
-#: field:mrp.routing.workcenter,note:0 view:mrp.workcenter:0
+#: field:mrp.bom.revision,description:0
+#: view:mrp.property:0
+#: field:mrp.property,description:0
+#: field:mrp.property.group,description:0
+#: view:mrp.routing:0
+#: field:mrp.routing,note:0
+#: field:mrp.routing.workcenter,note:0
+#: view:mrp.workcenter:0
#: field:mrp.workcenter,note:0
msgid "Description"
msgstr "Opis"
@@ -1923,7 +1980,8 @@ msgid "On Stock"
msgstr "Na zapas"
#. module: mrp
-#: field:mrp.bom,sequence:0 rml:mrp.production.order:0
+#: field:mrp.bom,sequence:0
+#: rml:mrp.production.order:0
#: field:mrp.production.workcenter.line,sequence:0
#: field:mrp.routing.workcenter,sequence:0
msgid "Sequence"
@@ -1981,4 +2039,9 @@ msgstr "Tygodniowe odchylenie wartości zapasów"
#: model:ir.model,name:mrp.model_report_mrp_inout
#: view:report.mrp.inout:0
msgid "Stock value variation"
-msgstr "Odchylenie wartości zapasów"
+msgstr "Zmiany wartości zapasów"
+
+#. module: mrp
+#: view:board.board:0
+msgid "Next production orders"
+msgstr "Następne zamówienie produkcji"
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index e7a5f1c195a..840c5f74d67 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -319,7 +319,7 @@ class procurement_order(osv.osv):
move_obj = self.pool.get('stock.move')
for procurement in self.browse(cr, uid, ids):
if procurement.product_qty <= 0.00:
- raise osv.except_osv(_('Data Insufficient !'), _('Please check the Quantity of Procurement Order(s), it should not be less than 1!'))
+ raise osv.except_osv(_('Data Insufficient !'), _('Please check the Quantity in Procurement Order(s), it should not be less than 1!'))
if procurement.product_id.type in ('product', 'consu'):
if not procurement.move_id:
source = procurement.location_id.id
diff --git a/addons/product/product.py b/addons/product/product.py
index aa916fb5b5c..cbb2ffefd67 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -48,25 +48,24 @@ class product_uom(osv.osv):
_name = 'product.uom'
_description = 'Product Unit of Measure'
+ def _compute_factor_inv(self, factor):
+ return factor and round(1.0 / factor, 6) or 0.0
+
def _factor_inv(self, cursor, user, ids, name, arg, context):
res = {}
for uom in self.browse(cursor, user, ids, context=context):
- if uom.factor:
- res[uom.id] = round(1 / uom.factor, 6)
- else:
- res[uom.id] = 0.0
+ res[uom.id] = self._compute_factor_inv(uom.factor)
return res
def _factor_inv_write(self, cursor, user, id, name, value, arg, context):
- if value:
- self.write(cursor, user, id, {
- 'factor': round(1/value, 6),
- }, context=context)
- else:
- self.write(cursor, user, id, {
- 'factor': 0.0,
- }, context=context)
- return True
+ return self.write(cursor, user, id, {'factor': self._compute_factor_inv(value)}, context=context)
+
+ def create(self, cr, uid, data, context={}):
+ if 'factor_inv' in data:
+ if data['factor_inv'] <> 1:
+ data['factor'] = self._compute_factor_inv(data['factor_inv'])
+ del(data['factor_inv'])
+ return super(product_uom, self).create(cr, uid, data, context)
_columns = {
'name': fields.char('Name', size=64, required=True, translate=True),
@@ -85,13 +84,11 @@ class product_uom(osv.osv):
"Use 1.0 for a UoM that cannot be further split, such as a piece."),
'active': fields.boolean('Active', help="By unchecking the active field you can disable a unit of measure without deleting it."),
'uom_type': fields.selection([('bigger','Bigger than the reference UoM'),
- ('reference','Reference UoM for this category (ratio=1)'),
+ ('reference','Reference UoM for this category'),
('smaller','Smaller than the reference UoM')],'UoM Type', required=1),
}
_defaults = {
- 'factor': 1.0,
- 'factor_inv': 1.0,
'active': 1,
'rounding': 0.01,
'uom_type': 'reference',
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index e58987cf2c8..4e68abfbda5 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -297,6 +297,7 @@
+
diff --git a/addons/project/project.py b/addons/project/project.py
index af8332abb27..816e85c29b4 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -337,6 +337,7 @@ class task(osv.osv):
def copy_data(self, cr, uid, id, default={}, context=None):
default = default or {}
default['work_ids'] = []
+ default['active'] = True
return super(task, self).copy_data(cr, uid, id, default, context)
def _check_dates(self, cr, uid, ids, context=None):
@@ -353,8 +354,17 @@ class task(osv.osv):
return False
return True
+ def _is_template(self, cr, uid, ids, field_name, arg, context=None):
+ res = {}
+ for task in self.browse(cr, uid, ids, context=context):
+ res[task.id] = True
+ if task.project_id:
+ if task.project_id.active == False or task.project_id.state == 'template':
+ res[task.id] = False
+ return res
+
_columns = {
- 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the task without removing it. This is basically used for the management of templates of projects and tasks."),
+ 'active': fields.function(_is_template, method=True, store=True, string='Not a Template Task', type='boolean', help="This field is computed automatically and have the same behavior than the boolean 'active' field: if the task is linked to a template or unactivated project, it will be hidden unless specifically asked."),
'name': fields.char('Task Summary', size=128, required=True),
'description': fields.text('Description'),
'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance'),
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 473d67750e0..2e9320e420b 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -188,8 +188,7 @@ class project_issue(osv.osv, crm.crm_case):
method=True, multi='working_days_open', type="float", store=True),
'working_hours_close': fields.function(_compute_day, string='Working Hours to Close the Issue', \
method=True, multi='working_days_close', type="float", store=True),
- 'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('history', '=', True),('model','=',_name)]),
- 'log_ids': fields.one2many('mailgate.message', 'res_id', 'Logs', domain=[('history', '=', False),('model','=',_name)]),
+ 'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
'date_action_last': fields.datetime('Last Action', readonly=1),
'date_action_next': fields.datetime('Next Action', readonly=1),
}
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index cbf24b18f76..d014181bcb5 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -73,14 +73,24 @@
-
+
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
@@ -90,17 +100,13 @@
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/project_scrum/project_scrum.py b/addons/project_scrum/project_scrum.py
index 5fc873c40aa..11e1b785405 100644
--- a/addons/project_scrum/project_scrum.py
+++ b/addons/project_scrum/project_scrum.py
@@ -168,7 +168,7 @@ class project_scrum_product_backlog(osv.osv):
if match:
ids = self.search(cr, uid, [('sprint_id','=', int(match.group(1)))], limit=limit, context=context)
return self.name_get(cr, uid, ids, context=context)
- return super(scrum_product_backlog, self).name_search(cr, uid, name, args, operator,context, limit=limit)
+ return super(project_scrum_product_backlog, self).name_search(cr, uid, name, args, operator,context, limit=limit)
def _calc_progress(self, cr, uid, ids, name, args, context):
res = {}
diff --git a/addons/project_scrum/project_scrum_view.xml b/addons/project_scrum/project_scrum_view.xml
index fd044427869..007399c40a8 100644
--- a/addons/project_scrum/project_scrum_view.xml
+++ b/addons/project_scrum/project_scrum_view.xml
@@ -90,7 +90,7 @@
-
+ \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-22 04:08+0000\n"
+"X-Launchpad-Export-Date: 2010-07-19 03:41+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale
@@ -71,7 +71,8 @@ msgid "Steps To Deliver a Sale Order"
msgstr "Kroki dostawy zamówienia sprzedaży"
#. module: sale
-#: wizard_field:sale.advance_payment_inv,init,qtty:0 rml:sale.order:0
+#: wizard_field:sale.advance_payment_inv,init,qtty:0
+#: rml:sale.order:0
msgid "Quantity"
msgstr "Ilość"
@@ -81,7 +82,8 @@ msgid "You invoice has been successfully created !"
msgstr "Twoja faktura została poprawnie utworzona"
#. module: sale
-#: view:sale.order:0 view:sale.order.line:0
+#: view:sale.order:0
+#: view:sale.order.line:0
msgid "Automatic Declaration"
msgstr "Deklaracja automatyczna"
@@ -156,10 +158,12 @@ msgstr "Przesunięcia zapasów"
#. module: sale
#: view:sale.order.line:0
msgid "Manual Designation"
-msgstr ""
+msgstr "Ręczne przypisanie"
#. module: sale
-#: view:sale.order:0 field:sale.order,note:0 view:sale.order.line:0
+#: view:sale.order:0
+#: field:sale.order,note:0
+#: view:sale.order.line:0
#: field:sale.order.line,notes:0
msgid "Notes"
msgstr "Notatki"
@@ -170,7 +174,8 @@ msgid "Invoice after delivery"
msgstr "Faktura po dostawie"
#. module: sale
-#: field:sale.order,amount_tax:0 field:sale.order.line,tax_id:0
+#: field:sale.order,amount_tax:0
+#: field:sale.order.line,tax_id:0
msgid "Taxes"
msgstr "Podatki"
@@ -185,7 +190,8 @@ msgid "Shipping Policy"
msgstr "Zasady wysyłki"
#. module: sale
-#: selection:sale.order,state:0 selection:sale.order.line,state:0
+#: selection:sale.order,state:0
+#: selection:sale.order.line,state:0
msgid "Cancelled"
msgstr "Anulowano"
@@ -230,7 +236,8 @@ msgid "Procurement is created after confirmation of sale order."
msgstr "Nabycie jest tworzone po potwierdzeniu zamówienia sprzedaży"
#. module: sale
-#: field:sale.order,project_id:0 field:sale.shop,project_id:0
+#: field:sale.order,project_id:0
+#: field:sale.shop,project_id:0
msgid "Analytic Account"
msgstr "Konto analityczne"
@@ -320,7 +327,8 @@ msgid "Invoice Based on Sales Orders"
msgstr "Faktura wg zamówień sprzedaży"
#. module: sale
-#: model:ir.model,name:sale.model_sale_shop view:sale.shop:0
+#: model:ir.model,name:sale.model_sale_shop
+#: view:sale.shop:0
msgid "Sale Shop"
msgstr "Sklep sprzedaży"
@@ -335,7 +343,8 @@ msgid "Order N°"
msgstr "Nr zamówienia"
#. module: sale
-#: field:sale.order,order_line:0 view:sale.order.line:0
+#: field:sale.order,order_line:0
+#: view:sale.order.line:0
msgid "Order Lines"
msgstr "Pozycje zamówienia"
@@ -345,7 +354,8 @@ msgid "Disc.(%)"
msgstr "Up.(%)"
#. module: sale
-#: view:sale.order:0 view:sale.order.line:0
+#: view:sale.order:0
+#: view:sale.order.line:0
#: field:sale.order.line,invoice_lines:0
msgid "Invoice Lines"
msgstr "Pozycje faktury"
@@ -443,13 +453,15 @@ msgid "Order Reference"
msgstr "Numer"
#. module: sale
-#: selection:sale.order,state:0 view:sale.order.line:0
+#: selection:sale.order,state:0
+#: view:sale.order.line:0
#: selection:sale.order.line,state:0
msgid "Done"
msgstr "Wykonano"
#. module: sale
-#: field:sale.order,pricelist_id:0 field:sale.shop,pricelist_id:0
+#: field:sale.order,pricelist_id:0
+#: field:sale.shop,pricelist_id:0
msgid "Pricelist"
msgstr "Cennik"
@@ -620,7 +632,8 @@ msgid "Taxes :"
msgstr "Podatki :"
#. module: sale
-#: field:sale.order,invoiced_rate:0 field:sale.order.line,invoiced:0
+#: field:sale.order,invoiced_rate:0
+#: field:sale.order.line,invoiced:0
msgid "Invoiced"
msgstr "Zafakturowano"
@@ -773,7 +786,8 @@ msgid "Direct Delivery"
msgstr "Dostawa bezpośrednia"
#. module: sale
-#: view:sale.order:0 view:sale.order.line:0
+#: view:sale.order:0
+#: view:sale.order.line:0
#: field:sale.order.line,property_ids:0
msgid "Properties"
msgstr "Właściwości"
@@ -787,7 +801,7 @@ msgstr "Oferta"
#. module: sale
#: model:product.template,name:sale.advance_product_0_product_template
msgid "Advance Product"
-msgstr ""
+msgstr "Awansuj produkt"
#. module: sale
#: model:process.transition,note:sale.process_transition_invoice0
@@ -806,7 +820,8 @@ msgstr "Oblicz"
#. module: sale
#: model:ir.actions.act_window,name:sale.action_shop_form
-#: model:ir.ui.menu,name:sale.menu_action_shop_form field:sale.order,shop_id:0
+#: model:ir.ui.menu,name:sale.menu_action_shop_form
+#: field:sale.order,shop_id:0
msgid "Shop"
msgstr "Sklep"
@@ -867,7 +882,8 @@ msgid "Delivery Order Only"
msgstr "Tylko zamówienia dostawy"
#. module: sale
-#: view:sale.order:0 view:sale.order.line:0
+#: view:sale.order:0
+#: view:sale.order.line:0
msgid "Sales order lines"
msgstr "Pozycje zamówienia sprzedaży"
@@ -882,14 +898,15 @@ msgid "Sales"
msgstr "Sprzedaż"
#. module: sale
-#: view:sale.order:0 view:sale.order.line:0
+#: view:sale.order:0
+#: view:sale.order.line:0
msgid "Qty"
msgstr "Il."
#. module: sale
#: model:process.node,note:sale.process_node_packinglist0
msgid "Packing OUT is created for stockable products."
-msgstr ""
+msgstr "Wydanie zewnętrzne jest tworzone dla produktów rejestrowanych."
#. module: sale
#: view:sale.order:0
@@ -897,7 +914,8 @@ msgid "Other data"
msgstr "Inne dane"
#. module: sale
-#: wizard_field:sale.advance_payment_inv,init,amount:0 rml:sale.order:0
+#: wizard_field:sale.advance_payment_inv,init,amount:0
+#: rml:sale.order:0
#: field:sale.order.line,price_unit:0
msgid "Unit Price"
msgstr "Cena jednostkowa"
@@ -923,7 +941,8 @@ msgstr "Faktura"
#: model:process.transition.action,name:sale.process_transition_action_cancel1
#: model:process.transition.action,name:sale.process_transition_action_cancel2
#: wizard_button:sale.advance_payment_inv,init,end:0
-#: view:sale.config.picking_policy:0 view:sale.order.line:0
+#: view:sale.config.picking_policy:0
+#: view:sale.order.line:0
#: wizard_button:sale.order.line.make_invoice,init,end:0
#: wizard_button:sale.order.make_invoice,init,end:0
msgid "Cancel"
@@ -945,14 +964,15 @@ msgstr ""
"ale oczekuje na planistę, aby uruchomił akcję dla daty zamówienia."
#. module: sale
-#: view:sale.order:0 view:sale.order.line:0
+#: view:sale.order:0
+#: view:sale.order.line:0
msgid "UoM"
msgstr "JM"
#. module: sale
#: field:sale.order.line,number_packages:0
msgid "Number Packages"
-msgstr ""
+msgstr "Liczba opakowań"
#. module: sale
#: model:process.transition,note:sale.process_transition_deliver0
@@ -1060,7 +1080,8 @@ msgid "Ordering Contact"
msgstr "Kontakt do zamawiającego"
#. module: sale
-#: rml:sale.order:0 field:sale.order.line,name:0
+#: rml:sale.order:0
+#: field:sale.order.line,name:0
msgid "Description"
msgstr "Opis"
@@ -1117,7 +1138,8 @@ msgid ""
msgstr "Nazwa i adres kontaktu proszącego o ofertę."
#. module: sale
-#: field:sale.order,partner_id:0 field:sale.order.line,order_partner_id:0
+#: field:sale.order,partner_id:0
+#: field:sale.order.line,order_partner_id:0
msgid "Customer"
msgstr "Klient"
@@ -1129,7 +1151,8 @@ msgstr "Cennik zakupu"
#. module: sale
#: model:ir.model,name:sale.model_sale_order
#: model:process.node,name:sale.process_node_saleorder0
-#: model:res.request.link,name:sale.req_link_sale_order view:sale.order:0
+#: model:res.request.link,name:sale.req_link_sale_order
+#: view:sale.order:0
#: field:stock.picking,sale_id:0
msgid "Sale Order"
msgstr "Zamówienie sprzedaży"
@@ -1156,7 +1179,8 @@ msgid "Total amount"
msgstr "Suma kwot"
#. module: sale
-#: rml:sale.order:0 field:sale.order,date_order:0
+#: rml:sale.order:0
+#: field:sale.order,date_order:0
msgid "Date Ordered"
msgstr "Data zamówienia"
@@ -1166,9 +1190,9 @@ msgid "Product UoS"
msgstr "JS produktu"
#. module: sale
-#: selection:report.sale.order.created,state:0
+#: selection:sale.order,state:0
msgid "Manual In Progress"
-msgstr "Recznie w trakcie przetwarzania"
+msgstr "Ręcznie w toku"
#. module: sale
#: field:sale.order.line,product_uom:0
@@ -1245,7 +1269,8 @@ msgstr ""
"oddzielnie)"
#. module: sale
-#: view:sale.order:0 view:sale.order.line:0
+#: view:sale.order:0
+#: view:sale.order.line:0
msgid "States"
msgstr "Stany"
@@ -1265,7 +1290,8 @@ msgid "Error: Invalid ean code"
msgstr "Błąd: Niedozwolony kod EAN"
#. module: sale
-#: field:sale.order,picked_rate:0 field:sale.order,shipped:0
+#: field:sale.order,picked_rate:0
+#: field:sale.order,shipped:0
msgid "Picked"
msgstr "Wydano"
@@ -1442,7 +1468,7 @@ msgstr "Sprzedaż wg produktów"
#. module: sale
#: model:ir.ui.menu,name:sale.next_id_81
msgid "This Month"
-msgstr "W tym miesiącu"
+msgstr "Bieżący miesiąc"
#. module: sale
#: field:report.sale.order.category,category_id:0
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 172fe1226ef..155f157ae50 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -221,7 +221,7 @@ class sale_order(osv.osv):
('invoice_except', 'Invoice Exception'),
('done', 'Done'),
('cancel', 'Cancelled')
- ], 'Order State', readonly=True, help="Gives the state of the quotation or sale order. The exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). The 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True),
+ ], 'Order State', readonly=True, help="Gives the state of the quotation or sale order. \nThe exception state is automatically set when a cancel operation occurs in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception). \nThe 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the date 'Ordered Date'.", select=True),
'date_order': fields.date('Ordered Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'create_date': fields.date('Creation Date', readonly=True, help="Date on which sale order is created"),
'date_confirm': fields.date('Confirmation Date', readonly=True, help="Date on which sale order is confirmed"),
@@ -473,7 +473,9 @@ class sale_order(osv.osv):
for o in self.browse(cr, uid, ids):
lines = []
for line in o.order_line:
- if (line.state in states) and not line.invoiced:
+ if line.invoiced:
+ raise osv.except_osv(_('Error !'), _('The Sale Order already has some lines invoiced. You should continue the billing process by line.'))
+ elif (line.state in states):
lines.append(line.id)
created_lines = self.pool.get('sale.order.line').invoice_line_create(cr, uid, lines)
if created_lines:
@@ -830,11 +832,11 @@ class sale_order_line(osv.osv):
'notes': fields.text('Notes'),
'th_weight': fields.float('Weight', readonly=True, states={'draft':[('readonly',False)]}),
'state': fields.selection([('draft', 'Draft'),('confirmed', 'Confirmed'),('done', 'Done'),('cancel', 'Cancelled'),('exception', 'Exception')], 'State', required=True, readonly=True,
- help=' * The \'Draft\' state is set automatically when sale order in draft state. \
- \n* The \'Confirmed\' state is set automatically when sale order in confirm state. \
- \n* The \'Exception\' state is set automatically when sale order is set as exception. \
- \n* The \'Done\' state is set automatically when sale order is set as done. \
- \n* The \'Cancelled\' state is set automatically when user cancel sale order.'),
+ help='* The \'Draft\' state is set when the related sale order in draft state. \
+ \n* The \'Confirmed\' state is set when the related sale order is confirmed. \
+ \n* The \'Exception\' state is set when the related sale order is set as exception. \
+ \n* The \'Done\' state is set when the sale order line has been picked. \
+ \n* The \'Cancelled\' state is set when a user cancel the sale order related.'),
'order_partner_id': fields.related('order_id', 'partner_id', type='many2one', relation='res.partner', string='Customer'),
'salesman_id':fields.related('order_id', 'user_id', type='many2one', relation='res.users', string='Salesman'),
'company_id': fields.related('order_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True, states={'draft':[('readonly',False)]}),
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 54474a81633..008fc6be35e 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -93,7 +93,7 @@
-
-
sale.order.formsale.order
@@ -264,14 +263,17 @@
search
-
+
-
+
-
+
+
+
+
@@ -397,23 +399,20 @@
-
-
+
+ attrs="{'invisible': ['|',('state', 'not in', ('confirmed', 'exception')),('invoiced', '=', 1)]}"/>
+ icon="gtk-jump-to"
+ attrs="{'invisible': ['|',('state', 'not in', ('confirmed','exception')),('invoiced', '=', 0)]}"/>
@@ -436,13 +435,13 @@
search
-
+
-
+
@@ -464,20 +463,23 @@
-
-
+
diff --git a/addons/sale/wizard/sale_make_invoice_advance.xml b/addons/sale/wizard/sale_make_invoice_advance.xml
index a4f48554166..598df143393 100644
--- a/addons/sale/wizard/sale_make_invoice_advance.xml
+++ b/addons/sale/wizard/sale_make_invoice_advance.xml
@@ -31,7 +31,7 @@
-
+
diff --git a/addons/sale_crm/wizard/crm_make_sale.py b/addons/sale_crm/wizard/crm_make_sale.py
index 683d050b454..371d206e4f7 100644
--- a/addons/sale_crm/wizard/crm_make_sale.py
+++ b/addons/sale_crm/wizard/crm_make_sale.py
@@ -21,7 +21,6 @@
from osv import fields, osv
from tools.translate import _
-from mx.DateTime import now
import time
import decimal_precision as dp
@@ -100,7 +99,7 @@ class crm_make_sale(osv.osv_memory):
raise osv.except_osv(_('Data Insufficient!'),_('Customer has no addresses defined!'))
vals = {
- 'origin': 'Opportunity:%s' % str(case.id),
+ 'origin': 'Opportunity: %s' % str(case.id),
'section_id': case.section_id and case.section_id.id or False,
'shop_id': make.shop_id.id,
'partner_id': partner_id,
@@ -108,8 +107,7 @@ class crm_make_sale(osv.osv_memory):
'partner_invoice_id': partner_addr['invoice'],
'partner_order_id': partner_addr['contact'],
'partner_shipping_id': partner_addr['delivery'],
- 'order_policy': 'manual',
- 'date_order': now(),
+ 'date_order': time.strftime('%Y-%m-%d'),
'fiscal_position': fpos,
}
@@ -121,14 +119,21 @@ class crm_make_sale(osv.osv_memory):
vals['project_id'] = make.analytic_account.id
new_id = sale_obj.create(cr, uid, vals)
for line in make.sale_order_line:
- value = sale_line_obj.product_id_change(cr, uid, [], pricelist,
- line.product_id.id, qty=1, partner_id=partner_id, fiscal_position=fpos)['value']
- value['product_id'] =line.product_id.id
+ value = {}
value['order_id'] = new_id
- value['tax_id'] = [(6,0,line['tax_id'])]
+ value['name'] = line.name
+ value['delay'] = line.delay
+ value['product_id'] =line.product_id and line.product_id.id or False
+ value['price_unit'] = line.price_unit
+ value['tax_id'] = line.tax_id and [(6,0,map(lambda x: x.id,line.tax_id))] or False
+ value['type'] = line.type
value['product_uom_qty']=line.product_uom_qty
- value['discount']=line.discount
value['product_uom']=line.product_uom.id
+ value['product_uos_qty']=line.product_uos_qty
+ value['product_uos']=line.product_uos and line.product_uos.id or False
+ value['product_packaging'] = line.product_packaging and line.product_packaging.id or False
+ value['discount']=line.discount
+ value['notes']=line.notes
sale_line_obj.create(cr, uid, value)
case_obj.write(cr, uid, [case.id], {'ref': 'sale.order,%s' % new_id})
new_ids.append(new_id)
@@ -149,7 +154,6 @@ class crm_make_sale(osv.osv_memory):
'view_id': False,
'type': 'ir.actions.act_window',
'res_id': new_ids and new_ids[0]
-
}
else:
value = {
@@ -165,8 +169,8 @@ class crm_make_sale(osv.osv_memory):
_columns = {
'shop_id': fields.many2one('sale.shop', 'Shop', required=True),
- 'partner_id': fields.many2one('res.partner', 'Customer', required=True, help='Use this partner if there is no partner on the Opportunity'),
- 'sale_order_line': fields.one2many('sale.order.make.line', 'order_line', 'Product Line', readonly=True, states={'draft': [('readonly', False)]}),
+ 'partner_id': fields.many2one('res.partner', 'Customer', required=True),
+ 'sale_order_line': fields.one2many('sale.order.make.line', 'opportunity_order_id', 'Product Line'),
'analytic_account': fields.many2one('account.analytic.account', 'Analytic Account'),
'close': fields.boolean('Close Case', help='Check this to close the case after having created the sale order.'),
}
@@ -180,140 +184,33 @@ crm_make_sale()
class sale_order_make_line(osv.osv_memory):
-
- def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
+ def product_id_change(self, cr, uid, ids, product, qty=0,
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
- lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False):
+ lang=False, update_tax=True, packaging=False, flag=False):
if not partner_id:
raise osv.except_osv(_('No Customer Defined !'), _('You have to select a customer in the sale form !\nPlease set one customer before choosing a product.'))
- warning = {}
- product_uom_obj = self.pool.get('product.uom')
- partner_obj = self.pool.get('res.partner')
- product_obj = self.pool.get('product.product')
- if partner_id:
- lang = partner_obj.browse(cr, uid, partner_id).lang
- context = {'lang': lang, 'partner_id': partner_id}
-
- if not product:
- return {'value': {'th_weight': 0, 'product_packaging': False,
- 'product_uos_qty': qty}, 'domain': {'product_uom': [],
- 'product_uos': []}}
-
- if not date_order:
- date_order = time.strftime('%Y-%m-%d')
-
- result = {}
- product_obj = product_obj.browse(cr, uid, product, context=context)
- if not packaging and product_obj.packaging:
- packaging = product_obj.packaging[0].id
- result['product_packaging'] = packaging
-
- if packaging:
- default_uom = product_obj.uom_id and product_obj.uom_id.id
- pack = self.pool.get('product.packaging').browse(cr, uid, packaging, context=context)
- q = product_uom_obj._compute_qty(cr, uid, uom, pack.qty, default_uom)
-# qty = qty - qty % q + q
- if qty and (q and not (qty % q) == 0):
- ean = pack.ean
- qty_pack = pack.qty
- type_ul = pack.ul
- warn_msg = _("You selected a quantity of %d Units.\nBut it's not compatible with the selected packaging.\nHere is a proposition of quantities according to the packaging: ") % (qty)
- warn_msg = warn_msg + "\n\n" + _("EAN: ") + str(ean) + _(" Quantity: ") + str(qty_pack) + _(" Type of ul: ") + str(type_ul.name)
- warning = {
- 'title': _('Picking Information !'),
- 'message': warn_msg
- }
- result['product_uom_qty'] = qty
-
- uom2 = False
- if uom:
- uom2 = product_uom_obj.browse(cr, uid, uom)
- if product_obj.uom_id.category_id.id != uom2.category_id.id:
- uom = False
-
- if uos:
- if product_obj.uos_id:
- uos2 = product_uom_obj.browse(cr, uid, uos)
- if product_obj.uos_id.category_id.id != uos2.category_id.id:
- uos = False
- else:
- uos = False
- if product_obj.description_sale:
- result['notes'] = product_obj.description_sale
- fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
- if update_tax: #The quantity only have changed
- result['delay'] = (product_obj.sale_delay or 0.0)
- partner = partner_obj.browse(cr, uid, partner_id)
- result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id)
- result.update({'type': product_obj.procure_method})
-
- if not flag:
- result['name'] = self.pool.get('product.product').name_get(cr, uid, [product_obj.id], context=context)[0][1]
- domain = {}
- if (not uom) and (not uos):
- result['product_uom'] = product_obj.uom_id.id
- if product_obj.uos_id:
- result['product_uos'] = product_obj.uos_id.id
- result['product_uos_qty'] = qty * product_obj.uos_coeff
- uos_category_id = product_obj.uos_id.category_id.id
- else:
- result['product_uos'] = False
- result['product_uos_qty'] = qty
- uos_category_id = False
- domain = {'product_uom':
- [('category_id', '=', product_obj.uom_id.category_id.id)],
- 'product_uos':
- [('category_id', '=', uos_category_id)]}
-
- elif uos and not uom: # only happens if uom is False
- result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id
- result['product_uom_qty'] = qty_uos / product_obj.uos_coeff
- elif uom: # whether uos is set or not
- default_uom = product_obj.uom_id and product_obj.uom_id.id
- q = product_uom_obj._compute_qty(cr, uid, uom, qty, default_uom)
- if product_obj.uos_id:
- result['product_uos'] = product_obj.uos_id.id
- result['product_uos_qty'] = qty * product_obj.uos_coeff
- else:
- result['product_uos'] = False
- result['product_uos_qty'] = qty
-
- if not uom2:
- uom2 = product_obj.uom_id
- return {'value': result, 'domain': domain, 'warning': warning}
+ date_order = time.strftime('%Y-%m-%d')
+ part = self.pool.get('res.partner').browse(cr, uid, partner_id)
+ pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False
+ fiscal_position = part.property_account_position and part.property_account_position.id or False
+ return self.pool.get('sale.order.line').product_id_change(cr, uid, ids, pricelist, product, qty, uom, qty_uos, uos, name, partner_id, lang, update_tax, date_order, packaging, fiscal_position, flag)
- def product_uom_change(self, cursor, user, ids, pricelist, product, qty=0,
- uom=False, qty_uos=0, uos=False, name='', partner_id=False,
- lang=False, update_tax=True, date_order=False):
- res = self.product_id_change(cursor, user, ids, pricelist, product,
- qty=qty, uom=uom, qty_uos=qty_uos, uos=uos, name=name,
- partner_id=partner_id, lang=lang, update_tax=update_tax,
- date_order=date_order)
- if 'product_uom' in res['value']:
- del res['value']['product_uom']
- if not uom:
- res['value']['price_unit'] = 0.0
- return res
-
_name = 'sale.order.make.line'
- _description = 'Sale Order Line'
+ _description = 'Opportunity Sale Order Line'
_columns = {
- 'order_line': fields.many2one('crm.make.sale', 'Order Reference', required=True, ondelete='cascade', select=True, readonly=True, ),
- 'order_id': fields.many2one('sale.order', 'Order Reference', required=True, ondelete='cascade', select=True, readonly=True, ),
- 'name': fields.char('Description', size=256, required=True, select=True, readonly=True, ),
- 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of sale order lines."),
- 'delay': fields.float('Delivery Lead Time', required=True, help="Number of days between the order confirmation the the shipping of the products to the customer", readonly=True, ),
+ 'opportunity_order_id': fields.many2one('crm.make.sale', 'Order Reference', required=True, ondelete='cascade', select=True, readonly=True, ),
+ 'name': fields.char('Description', size=256, required=True, select=True, ),
+ 'delay': fields.float('Delivery Lead Time', required=True, help="Number of days between the order confirmation the the shipping of the products to the customer"),
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True),
- 'procurement_id': fields.many2one('procurement.order', 'Procurement'),
- 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price'), readonly=True, ),
- 'tax_id': fields.many2many('account.tax', 'sale_order_tax', 'order_line_id', 'tax_id', 'Taxes', readonly=True, states={'draft':[('readonly',False)]}),
- 'type': fields.selection([('make_to_stock', 'from stock'), ('make_to_order', 'on order')], 'Procurement Method', required=True, readonly=True, states={'draft':[('readonly',False)]}),
- 'product_uom_qty': fields.float('Quantity (UoM)', digits=(16, 2), required=True, readonly=True, states={'draft':[('readonly',False)]}),
- 'product_uom': fields.many2one('product.uom', 'Unit of Measure ', required=True, readonly=True, states={'draft':[('readonly',False)]}),
- 'product_uos_qty': fields.float('Quantity (UoS)', readonly=True, states={'draft':[('readonly',False)]}),
+ 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price')),
+ 'tax_id': fields.many2many('account.tax', 'sale_order_tax', 'order_line_id', 'tax_id', 'Taxes'),
+ 'type': fields.selection([('make_to_stock', 'from stock'), ('make_to_order', 'on order')], 'Procurement Method', required=True),
+ 'product_uom_qty': fields.float('Quantity (UoM)', digits=(16, 2), required=True, ),
+ 'product_uom': fields.many2one('product.uom', 'Unit of Measure ', required=True, ),
+ 'product_uos_qty': fields.float('Quantity (UoS)'),
'product_uos': fields.many2one('product.uom', 'Product UoS'),
'product_packaging': fields.many2one('product.packaging', 'Packaging'),
- 'discount': fields.float('Discount (%)', digits=(16, 2), readonly=True, states={'draft':[('readonly',False)]}),
+ 'discount': fields.float('Discount (%)', digits=(16, 2)),
'notes': fields.text('Notes'),
}
_order = 'sequence, id'
diff --git a/addons/sale_crm/wizard/crm_make_sale_view.xml b/addons/sale_crm/wizard/crm_make_sale_view.xml
index 17e743987f0..b8399eeda90 100644
--- a/addons/sale_crm/wizard/crm_make_sale_view.xml
+++ b/addons/sale_crm/wizard/crm_make_sale_view.xml
@@ -21,25 +21,21 @@
-
-
-
+
+
+
+
+
+
+
-
@@ -49,6 +45,9 @@
+
+
+
diff --git a/addons/sale_journal/sale_journal_view.xml b/addons/sale_journal/sale_journal_view.xml
index cbdb3e84fd0..952ca17ea12 100644
--- a/addons/sale_journal/sale_journal_view.xml
+++ b/addons/sale_journal/sale_journal_view.xml
@@ -1,6 +1,9 @@
+
+
@@ -40,7 +43,7 @@
tree,form
-
+
@@ -138,7 +141,8 @@
-
+
+
@@ -151,7 +155,7 @@
-
+
diff --git a/addons/sale_layout/report/report_sale_layout.rml b/addons/sale_layout/report/report_sale_layout.rml
index 28e007ecfdc..fe2f15ebf42 100755
--- a/addons/sale_layout/report/report_sale_layout.rml
+++ b/addons/sale_layout/report/report_sale_layout.rml
@@ -31,6 +31,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -233,7 +254,7 @@
- [[ o.name ]]
+ [[ o.client_order_ref ]]
[[ o.date_order ]]
@@ -345,8 +366,72 @@
Price
-
-
-
+
+
+
+
+
+
+
+
+
+
+ Net Total :
+
+
+ [[ formatLang(o.amount_untaxed ) ]]
+
+
+ [[ o.pricelist_id.currency_id.name ]]
+
+
+
+
+
+
+
+
+
+ Taxes :
+
+
+ [[ formatLang(o.amount_tax ) ]]
+
+
+ [[ o.pricelist_id.currency_id.name ]]
+
+
+
+
+
+
+
+
+
+ Total :
+
+
+ [[ formatLang(o.amount_total ) ]]
+
+
+ [[ o.pricelist_id.currency_id.name ]]
+
+
+
+
+
+
+
+
+
+ [[ format(o.note or '') ]]
+
+
+
+
+ [[ format((o.partner_id.property_payment_term and o.partner_id.property_payment_term.note) or '') ]]
+