merge
This commit is contained in:
commit
3a49df4944
7 files changed
+115
-60
No files matched your search
@@ -1,7 +1,7 @@
|
||||
type,name,res_id,src,value,fuzzy
|
||||
error,stock.inventory.line,0,Move quantity must be positive,Zu bewegende Menge muss positiv sein,0
|
||||
error,stock.inventory.line,0,Product must be unique by inventory!,Ein Artikel kann in einem Lager nicht mehrfach vergeben werden!,0
|
||||
error,stock.move,0,Move can not be in both Supplier and Customer Packing,Eine Bewegung kann nicht als Lieferanten- und Kundenverpackung erfolgen,0
|
||||
error,stock.move,0,Move can not be in both Supplier and Customer Packing,Eine Bewegung kann nicht in Lieferanten- und Kundenlieferung erfolgen,0
|
||||
error,stock.move,0,Move quantity must be positive,Zu bewegende Menge muss positiv sein,0
|
||||
error,stock.move,0,Source and destination location must be different,Herkunfts- und Bestimmungsort müssen unterschiedlich sein,0
|
||||
error,stock.move,0,You can not set state to assigned!,Status kann nicht auf Zugewiesen gesetzt werden!,0
|
||||
@@ -42,15 +42,16 @@ field,"stock.location,output_location",0,Output,Ausgang,0
|
||||
field,"stock.location,parent",0,Parent,Übergeordnet (Lagerort),0
|
||||
field,"stock.location,quantity",0,Quantity,Menge,0
|
||||
field,"stock.location,right",0,Right,Rechts,0
|
||||
field,"stock.location_stock_date.init,forecast_date",0,Forecast Date,Voraussichtliches Datum,0
|
||||
field,"stock.location_stock_date.init,forecast_date",0,At Date,Am,0
|
||||
field,"stock.location,storage_location",0,Storage,Lagerhalle,0
|
||||
field,"stock.location,type",0,Location type,Lagerort,0
|
||||
field,"stock.move,company",0,Company,Unternehmen,0
|
||||
field,"stock.move,currency",0,Currency,Währung,0
|
||||
field,"stock.move,effective_date",0,Effective Date,Effektives Datum,0
|
||||
field,"stock.move,from_location",0,From Location,Von Lagerort,0
|
||||
field,"stock.move,packing_in",0,Supplier Packing,Verpackung Lieferant,0
|
||||
field,"stock.move,packing_out",0,Customer Packing,Verpackung Kunde,0
|
||||
field,"stock.move,packing_in",0,Supplier Packing,Lieferschein von Lieferant,0
|
||||
field,"stock.move,packing_internal",0,Internal Packing,Interner Lieferschein,0
|
||||
field,"stock.move,packing_out",0,Customer Packing,Lieferschein an Kunde,0
|
||||
field,"stock.move,planned_date",0,Planned Date,Geplantes Datum,0
|
||||
field,"stock.move,product",0,Product,Artikel,0
|
||||
field,"stock.move,quantity",0,Quantity,Menge,0
|
||||
@@ -70,6 +71,14 @@ field,"stock.packing.in,planned_date",0,Planned Date,Geplantes Datum,0
|
||||
field,"stock.packing.in,reference",0,Reference,Referenz,0
|
||||
field,"stock.packing.in,state",0,State,Status,0
|
||||
field,"stock.packing.in,supplier",0,Supplier,Lieferant,0
|
||||
field,"stock.packing.internal,code",0,Code,Code,0
|
||||
field,"stock.packing.internal,effective_date",0,Effective Date,Effektives Datum,0
|
||||
field,"stock.packing.internal,from_location",0,From Location,Von Lagerort,0
|
||||
field,"stock.packing.internal,moves",0,Moves,Bewegungen,0
|
||||
field,"stock.packing.internal,planned_date",0,Planned Date,Geplantes Datum,0
|
||||
field,"stock.packing.internal,reference",0,Reference,Referenz,0
|
||||
field,"stock.packing.internal,state",0,State,Status,0
|
||||
field,"stock.packing.internal,to_location",0,To Location,Zu Lagerort,0
|
||||
field,"stock.packing.in,warehouse",0,Warehouse,Lager,0
|
||||
field,"stock.packing.out,code",0,Code,Code,0
|
||||
field,"stock.packing.out,customer",0,Customer,Kunde,0
|
||||
@@ -82,10 +91,10 @@ field,"stock.packing.out,outgoing_moves",0,Outgoing Moves,Ausgehende Bewegungen,
|
||||
field,"stock.packing.out,planned_date",0,Planned Date,Geplantes Datum,0
|
||||
field,"stock.packing.out,reference",0,Reference,Referenz,0
|
||||
field,"stock.packing.out,state",0,State,Status,0
|
||||
field,"stock.packing.out,warehouse",0,Warehouse,Lager,0
|
||||
field,"stock.product_stock_date.init,forecast_date",0,Forecast Date,Voraussichtliches Datum,0
|
||||
help,"relationship.party,customer_location",0,The default destination location when sending products to the party.,Standardbestimmungsort für Sendungen zur Partei,0
|
||||
help,"relationship.party,supplier_location",0,The default source location when receiving products from the party.,Standardbestimmungsort für Sendungen von der Partei,0
|
||||
field,"stock.packing.out,warehouse",0,Warehouse,Warenlager,0
|
||||
field,"stock.product_stock_date.init,forecast_date",0,At Date,Am,0
|
||||
help,"relationship.party,customer_location",0,The default destination location when sending products to the party.,Standardbestimmungsort für Sendungen zum Geschäftspartner,0
|
||||
help,"relationship.party,supplier_location",0,The default source location when receiving products from the party.,Standardbestimmungsort für Sendungen vom Geschäftspartner,0
|
||||
help,"stock.location_stock_date.init,forecast_date",0,"Allow to compute expected stock quantities for this date.
|
||||
* An empty value is an infinite date in the future.
|
||||
* A date in the past will provide historical values.","Berechnet den erwarteten Lagerbestand für dieses Datum
|
||||
@@ -98,32 +107,40 @@ help,"stock.product_stock_date.init,forecast_date",0,"Allow to compute expected
|
||||
* ein leerer Wert ist ein unbegrenztes Datum in der Zukunft
|
||||
* ein Datum in der Vergangenheit berechnet historische Werte
|
||||
",0
|
||||
model,"ir.action,name",act_packing_out_form_assigned,Assigned Customer Packings,Zugewiesene Kundenverpackungen,0
|
||||
model,"ir.action,name",act_packing_out_form_assigned,Assigned Customer Packings,Zugewiesene Kundenlieferscheine,0
|
||||
model,"ir.action,name",act_packing_internal_assigned_form,Assigned Internal Packings,Zugewiesene Interne Lieferscheine,0
|
||||
model,"ir.action,name",wizard_complete_inventory,Complete Inventory,Gesamter Lagerbestand,0
|
||||
model,"ir.action,name",report_packing_out,Customer Packing,Kundenverpackungen,0
|
||||
model,"ir.action,name",act_packing_out_form,Customer Packings,Verpackung Kunde,0
|
||||
model,"ir.action,name",act_packing_out_form_ready,Customer Packings Ready for Shipping,Versandbereite Kundenverpackungen,0
|
||||
model,"ir.action,name",act_packing_out_form_waiting,Customer Packings Waiting Assignation,Zuzuweisende Kundenverpackungen,0
|
||||
model,"ir.action,name",report_packing_out,Customer Packing,Lieferschein an Kunde,0
|
||||
model,"ir.action,name",act_packing_out_form,Customer Packings,Lieferscheine an Kunden,0
|
||||
model,"ir.action,name",act_packing_out_form_ready,Customer Packings Ready for Shipping,Versandbereite Lieferscheine an Kunden,0
|
||||
model,"ir.action,name",act_packing_out_form_waiting,Customer Packings Waiting Assignation,Zuzuweisende Lieferscheine an Kunden,0
|
||||
model,"ir.action,name",act_packing_internal_draft_form,Draft Internal Packings,Entwürfe (Interne Lieferscheine),0
|
||||
model,"ir.action,name",act_location_form,Edit Locations,Lagerorte bearbeiten,0
|
||||
model,"ir.action,name",act_packing_internal_form,Internal Packings,Interne Lieferscheine,0
|
||||
model,"ir.action,name",act_packing_internal_waiting_form,Internal Packings Waiting Assignation,Zuzuweisende Interne Lieferscheine,0
|
||||
model,"ir.action,name",act_inventory_form,Inventories,Lager,0
|
||||
model,"ir.action,name",act_location_tree,Locations,Lagerorte,0
|
||||
model,"ir.action,name",act_move_form,Moves,Lagerbewegungen,0
|
||||
model,"ir.action,name",act_move_form_supp,Moves from Suppliers,Bewegungen von Lieferanten,0
|
||||
model,"ir.action,name",act_move_form_supp_proceed,Moves from Suppliers Waiting Arrival,Erwartete Bewegungen von Lieferanten,0
|
||||
model,"ir.action,name",act_move_form_cust,Moves to Customers,Bewegungen zu Kunden,0
|
||||
model,"ir.action,name",act_packing_in_form2,New Supplier Packings,Neue Lieferantenverpackung,0
|
||||
model,"ir.action,name",wizard_open_location,Product by Location,Artikel nach Lagerort,0
|
||||
model,"ir.action,name",wizard_open_product,Product Quantities,Artikel Mengen,0
|
||||
model,"ir.action,name",act_packing_in_form2,New Supplier Packing,Neuer Lieferschein an Lieferant,0
|
||||
model,"ir.action,name",wizard_location_open,Product by Location,Artikel nach Lagerort,0
|
||||
model,"ir.action,name",wizard_product_open,Product Quantities,Artikelbestand,0
|
||||
model,"ir.action,name",act_product_by_location,Products by Locations,Artikel nach Lagerort,0
|
||||
model,"ir.action,name",act_location_quantity_tree,Product Stock,Lagerbestand,0
|
||||
model,"ir.action,name",act_packing_in_form_received,Received Supplier packings,Erhaltene Lieferantenverpackungen,0
|
||||
model,"ir.action,name",act_packing_in_form,Supplier Packings,Lieferantenverpackungen,0
|
||||
model,"ir.ui.menu,name",menu_packing_out_assigned,Assigned Customer Packings,Zugewiesene Kundenverpackungen,0
|
||||
model,"ir.action,name",act_packing_in_form_received,Received Supplier packings,Erhaltene Lieferscheine von Lieferanten,0
|
||||
model,"ir.action,name",act_packing_in_form,Supplier Packings,Lieferscheine von Lieferanten,0
|
||||
model,"ir.ui.menu,name",menu_packing_out_assigned,Assigned Customer Packings,Zugewiesene Kundenlieferscheine,0
|
||||
model,"ir.ui.menu,name",menu_packing_internal_assigned_form,Assigned Internal Packings,Zugewiesene Interne Lieferscheine,0
|
||||
model,"ir.ui.menu,name",menu_configuration,Configuration,Einstellungen,0
|
||||
model,"ir.ui.menu,name",menu_packing_out_form,Customer Packings,Kundenverpackungen,0
|
||||
model,"ir.ui.menu,name",menu_packing_out_ready,Customer Packings Ready for Shipping,Versandbereite Kundenverpackungen,0
|
||||
model,"ir.ui.menu,name",menu_packing_out_waiting,Customer Packings Waiting Assignation,Zuzuweisende Kundenverpackungen,0
|
||||
model,"ir.ui.menu,name",menu_packing_out_form,Customer Packings,Lieferscheine an Kunden,0
|
||||
model,"ir.ui.menu,name",menu_packing_out_ready,Customer Packings Ready for Shipping,Versandbereite Lieferscheine an Kunden,0
|
||||
model,"ir.ui.menu,name",menu_packing_out_waiting,Customer Packings Waiting Assignation,Zuzuweisende Lieferscheine an Kunden,0
|
||||
model,"ir.ui.menu,name",menu_packing_internal_draft_form,Draft Internal Packings,Entwürfe (Interne Lieferscheine),0
|
||||
model,"ir.ui.menu,name",menu_location_form,Edit Locations,Lagerorte bearbeiten,0
|
||||
model,"ir.ui.menu,name",menu_packing_internal_form,Internal Packings,Interne Lieferscheine,0
|
||||
model,"ir.ui.menu,name",menu_packing_internal_waiting_form,Internal Packings Waiting Assignation,Zuzuweisende Interne Lieferscheine,0
|
||||
model,"ir.ui.menu,name",menu_inventory_form,Inventories,Lagerbestand,0
|
||||
model,"ir.ui.menu,name",menu_stock,Inventory Management,Lager,0
|
||||
model,"ir.ui.menu,name",menu_location_tree,Locations,Lagerorte,0
|
||||
@@ -131,15 +148,15 @@ model,"ir.ui.menu,name",menu_move_form,Moves,Bewegungen,0
|
||||
model,"ir.ui.menu,name",menu_move_form_supp,Moves from Suppliers,Bewegungen von Lieferanten,0
|
||||
model,"ir.ui.menu,name",menu_move_form_supp_proceed,Moves from Suppliers Waiting Arrival,Erwartete Bewegungen von Lieferanten,0
|
||||
model,"ir.ui.menu,name",menu_move_form_cust,Moves to Customers,Bewegungen zu Kunden,0
|
||||
model,"ir.ui.menu,name",menu_packing_in_form2,New Supplier Packings,Neue Lieferantenverpackung,0
|
||||
model,"ir.ui.menu,name",menu_packing_in_received,Received Supplier packings,Erhaltene Lieferantenverpackungen,0
|
||||
model,"ir.ui.menu,name",menu_packing_in_form,Supplier Packings,Lieferantenverpackungen,0
|
||||
model,"ir.ui.menu,name",menu_packing_in_form2,New Supplier Packing,Neuer Lieferschein an Lieferant,0
|
||||
model,"ir.ui.menu,name",menu_packing_in_received,Received Supplier packings,Erhaltene Lieferscheine von Lieferanten,0
|
||||
model,"ir.ui.menu,name",menu_packing_in_form,Supplier Packings,Lieferscheine von Lieferanten,0
|
||||
odt,stock.packing.out,0,Customer Code:,Kundennummer:,0
|
||||
odt,stock.packing.out,0,Date:,Datum:,0
|
||||
odt,stock.packing.out,0,Email:,E-Mail:,0
|
||||
odt,stock.packing.out,0,List,Liste,0
|
||||
odt,stock.packing.out,0,Packing,Verpackung,0
|
||||
odt,stock.packing.out,0,Packing Number:,Verpackungsnummer:,0
|
||||
odt,stock.packing.out,0,Packing,Lieferschein,0
|
||||
odt,stock.packing.out,0,Packing Number:,Lieferscheinnummer:,0
|
||||
odt,stock.packing.out,0,Phone:,Telefon:,0
|
||||
odt,stock.packing.out,0,Product,Artikel,0
|
||||
odt,stock.packing.out,0,Quantity,Menge,0
|
||||
@@ -164,6 +181,11 @@ selection,"stock.packing.in,state",0,Cancel,Abbrechen,0
|
||||
selection,"stock.packing.in,state",0,Done,Erledigt,0
|
||||
selection,"stock.packing.in,state",0,Draft,Entwurf,0
|
||||
selection,"stock.packing.in,state",0,Received,Erhalten,0
|
||||
selection,"stock.packing.internal,state",0,Assigned,Zugewiesen,0
|
||||
selection,"stock.packing.internal,state",0,Cancel,Abbrechen,0
|
||||
selection,"stock.packing.internal,state",0,Done,Erledigt,0
|
||||
selection,"stock.packing.internal,state",0,Draft,Entwurf,0
|
||||
selection,"stock.packing.internal,state",0,Waiting,Wartend,0
|
||||
selection,"stock.packing.out,state",0,Assigned,Zugewiesen,0
|
||||
selection,"stock.packing.out,state",0,Cancel,Abbrechen,0
|
||||
selection,"stock.packing.out,state",0,Done,Erledigt,0
|
||||
@@ -174,7 +196,7 @@ view,product_stock_date.init,0,Product Quantity.,Artikelmenge,0
|
||||
view,stock.inventory,0,All generated moves will be cancelled!,Sämtliche erzeugten Bewegungen werden rückgängig gemacht!,0
|
||||
view,stock.inventory,0,Cancel,Abbrechen,0
|
||||
view,stock.inventory,0,Complete Inventory,Gesamter Lagerbestand,0
|
||||
view,stock.inventory,0,Confirm,Bestätigen,0
|
||||
view,stock.inventory,0,Confirm,Beauftragen,0
|
||||
view,stock.inventory,0,Inventories,Lagerbestände,0
|
||||
view,stock.inventory,0,Inventory,Lagerbestand,0
|
||||
view,stock.inventory,0,Re-Open,Wiedereröffnen,0
|
||||
@@ -196,15 +218,23 @@ view,stock.packing.in,0,Moves,Bewegungen,0
|
||||
view,stock.packing.in,0,Received,Erhalten,0
|
||||
view,stock.packing.in,0,Reset to Draft,Auf Entwurf zurücksetzen,0
|
||||
view,stock.packing.in,0,Set Done,Auf Erledigt setzen,0
|
||||
view,stock.packing.in,0,Supplier Packing,Lieferantenverpackungen,0
|
||||
view,stock.packing.in,0,Supplier Packings,Lieferantenverpackungen,0
|
||||
view,stock.packing.in,0,Supplier Packing,Lieferschein von Lieferant,0
|
||||
view,stock.packing.in,0,Supplier Packings,Lieferscheine von Lieferanten,0
|
||||
view,stock.packing.internal,0,Assign,Zuweisen,0
|
||||
view,stock.packing.internal,0,Cancel,Abbrechen,0
|
||||
view,stock.packing.internal,0,Force Assign,Zuweisung erzwingen,0
|
||||
view,stock.packing.internal,0,Internal Packing,Interner Lieferschein,0
|
||||
view,stock.packing.internal,0,Internal Packings,Interne Lieferscheine,0
|
||||
view,stock.packing.internal,0,Reset to Draft,Auf Entwurf zurücksetzen,0
|
||||
view,stock.packing.internal,0,Set Done,Auf Erledigt setzen,0
|
||||
view,stock.packing.internal,0,Set Waiting,Auf Wartend setzen,0
|
||||
view,stock.packing.out,0,Assign,Zuweisen,0
|
||||
view,stock.packing.out,0,Cancel,Abbrechen,0
|
||||
view,stock.packing.out,0,Customer Packing,Kundenverpackung,0
|
||||
view,stock.packing.out,0,Customer Packings,Kundenverpackungen,0
|
||||
view,stock.packing.out,0,Customer Packing,Lieferschein an Kunde,0
|
||||
view,stock.packing.out,0,Customer Packings,Lieferscheine an Kunden,0
|
||||
view,stock.packing.out,0,Force Assign,Zuweisung erzwingen,0
|
||||
view,stock.packing.out,0,Inventory Moves,Lagerbewegungen,0
|
||||
view,stock.packing.out,0,Make packing,Verpackung fertigstellen,0
|
||||
view,stock.packing.out,0,Make packing,Lieferung fertigstellen,0
|
||||
view,stock.packing.out,0,Outgoing Moves,Ausgehende Bewegungen,0
|
||||
view,stock.packing.out,0,Reset to Draft,Auf Entwurf zurücksetzen,0
|
||||
view,stock.packing.out,0,Set Done,Auf Erledigt setzen,0
|
||||
|
||||
|
+7
-4
@@ -1,8 +1,8 @@
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level
|
||||
#of this repository contains the full copyright notices and license terms.
|
||||
'Inventory'
|
||||
from trytond.osv import fields, OSV
|
||||
from trytond.wizard import Wizard
|
||||
import datetime
|
||||
|
||||
STATES = {
|
||||
'readonly': "state != 'open'",
|
||||
@@ -54,7 +54,8 @@ class Inventory(OSV):
|
||||
return 'open'
|
||||
|
||||
def default_date(self, cursor, user, context=None):
|
||||
return datetime.date.today()
|
||||
date_obj = self.pool.get('ir.date')
|
||||
return date_obj.today(cursor, user, context=context)
|
||||
|
||||
def default_company(self, cursor, user, context=None):
|
||||
if context.get('company'):
|
||||
@@ -88,6 +89,8 @@ class Inventory(OSV):
|
||||
def _done(self, cursor, user, ids, context=None):
|
||||
product_obj = self.pool.get('product.product')
|
||||
move_obj = self.pool.get('stock.move')
|
||||
date_obj = self.pool.get('ir.date')
|
||||
|
||||
inventories = self.browse(cursor, user, ids, context=context)
|
||||
location_ids = []
|
||||
inv_by_loc = {}
|
||||
@@ -118,7 +121,7 @@ class Inventory(OSV):
|
||||
moves.append(move_id)
|
||||
|
||||
self.write(cursor, user, ids, {
|
||||
'date': datetime.date.today(),
|
||||
'date': date_obj.today(cursor, user, context=context),
|
||||
'moves': [('add', x) for x in moves],
|
||||
}, context=context)
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<record model="ir.action.wizard" id="wizard_complete_inventory">
|
||||
<field name="name">Complete Inventory</field>
|
||||
<field name="wiz_name">stock.inventory.complete</field>
|
||||
<field name="model">stock.inventory</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="inventory_view_form">
|
||||
|
||||
+7
-3
@@ -1,4 +1,5 @@
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level
|
||||
#of this repository contains the full copyright notices and license terms.
|
||||
"Wharehouse"
|
||||
from trytond.osv import fields, OSV
|
||||
from trytond.wizard import Wizard, WizardOSV
|
||||
@@ -94,12 +95,14 @@ class Location(OSV):
|
||||
|
||||
def get_quantity(self, cursor, user, ids, name, arg, context=None):
|
||||
product_obj = self.pool.get('product.product')
|
||||
date_obj = self.pool.get('ir.date')
|
||||
|
||||
if (not context) or (not context.get('product')):
|
||||
return dict([(i,0) for i in ids])
|
||||
|
||||
if name != 'forecast_quantity' and context.get('stock_date_end'):
|
||||
if context['stock_date_end'] != datetime.date.today():
|
||||
if context['stock_date_end'] != date_obj.today(cursor, user,
|
||||
context=context):
|
||||
context = context.copy()
|
||||
del context['stock_date_end']
|
||||
pbl = product_obj.products_by_location(cursor, user, location_ids=ids,
|
||||
@@ -155,7 +158,8 @@ class ChooseStockDateInit(WizardOSV):
|
||||
'* A date in the past will provide historical values.')
|
||||
|
||||
def default_forecast_date(self, cursor, user, context=None):
|
||||
return datetime.date.today()
|
||||
date_obj = self.pool.get('ir.date')
|
||||
return date_obj.today(cursor, user, context=context)
|
||||
|
||||
ChooseStockDateInit()
|
||||
|
||||
|
||||
+3
-2
@@ -88,15 +88,16 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="window_name" eval="False"/>
|
||||
</record>
|
||||
<record model="ir.action.wizard" id="wizard_open_product">
|
||||
<record model="ir.action.wizard" id="wizard_product_open">
|
||||
<field name="name">Product Quantities</field>
|
||||
<field name="wiz_name">stock.product.open</field>
|
||||
<field name="model">stock.location</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword"
|
||||
id="act_product_by_location_keyword1">
|
||||
<field name="keyword">tree_open</field>
|
||||
<field name="model">stock.location,0</field>
|
||||
<field name="action" ref="wizard_open_product"/>
|
||||
<field name="action" ref="wizard_product_open"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_product_form_view">
|
||||
<field name="sequence" eval="20"/>
|
||||
|
||||
+31
-16
@@ -1,4 +1,5 @@
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level
|
||||
#of this repository contains the full copyright notices and license terms.
|
||||
from trytond.osv import fields, OSV
|
||||
from trytond.wizard import Wizard, WizardOSV
|
||||
import datetime
|
||||
@@ -15,12 +16,16 @@ class Product(OSV):
|
||||
fnct_search='search_quantity', readonly=True)
|
||||
|
||||
def get_quantity(self, cursor, user, ids, name, args, context=None):
|
||||
date_obj = self.pool.get('ir.date')
|
||||
|
||||
if not (context and context.get('locations')):
|
||||
return dict([(id, 0.0) for id in ids])
|
||||
if name != 'forecast_quantity' and context.get('stock_date_end'):
|
||||
if context['stock_date_end'] != datetime.date.today():
|
||||
if context['stock_date_end'] != date_obj.today(cursor, user,
|
||||
context=context):
|
||||
context = context.copy()
|
||||
context['stock_date_end'] = datetime.date.today()
|
||||
context['stock_date_end'] = date_obj.today(cursor, user,
|
||||
context=context)
|
||||
if name == 'forecast_quantity' and not context.get('stock_date_end'):
|
||||
context = context.copy()
|
||||
context['stock_date_end'] = datetime.date.max
|
||||
@@ -48,10 +53,13 @@ class Product(OSV):
|
||||
return res
|
||||
|
||||
def search_quantity(self, cursor, user, name, domain=None, context=None):
|
||||
date_obj = self.pool.get('ir.date')
|
||||
|
||||
if not (context and context.get('locations') and domain):
|
||||
return []
|
||||
if (name != 'forecast_quantity') and context.get('stock_date_end'):
|
||||
if context['stock_date_end'] != datetime.date.today():
|
||||
if context['stock_date_end'] != date_obj.today(cursor, user,
|
||||
context=context):
|
||||
context = context.copy()
|
||||
del context['stock_date_end']
|
||||
|
||||
@@ -90,8 +98,9 @@ class Product(OSV):
|
||||
uom_obj = self.pool.get("product.uom")
|
||||
product_obj = self.pool.get("product.product")
|
||||
rule_obj = self.pool.get('ir.rule')
|
||||
|
||||
location_obj = self.pool.get('stock.location')
|
||||
date_obj = self.pool.get('ir.date')
|
||||
|
||||
if not location_ids:
|
||||
return []
|
||||
if context is None:
|
||||
@@ -119,7 +128,8 @@ class Product(OSV):
|
||||
state_date_vals = []
|
||||
else:
|
||||
# date end in the past or today: filter on state done for the moves
|
||||
if context['stock_date_end'] <= datetime.date.today():
|
||||
if context['stock_date_end'] <= date_obj.today(cursor, user,
|
||||
context=context):
|
||||
state_date_clause = '(state in (%s)) AND ('\
|
||||
'(effective_date IS NULL '\
|
||||
'AND ( planned_date <= %s or planned_date IS NULL)) '\
|
||||
@@ -151,15 +161,17 @@ class Product(OSV):
|
||||
'OR (effective_date <= %s AND effective_date > %s)'\
|
||||
')'\
|
||||
')'
|
||||
today = date_obj.today(cursor, user, context=context)
|
||||
state_date_vals = [
|
||||
'done', datetime.date.today(), datetime.date.today(),
|
||||
'done', today, today,
|
||||
'done', 'assigned', 'draft',
|
||||
context['stock_date_end'], datetime.date.today(),
|
||||
context['stock_date_end'], datetime.date.today()
|
||||
context['stock_date_end'], today,
|
||||
context['stock_date_end'], today,
|
||||
]
|
||||
|
||||
if context.get('stock_date_start'):
|
||||
if context['stock_date_start'] > datetime.date.today():
|
||||
if context['stock_date_start'] > date_obj.today(cursor, user,
|
||||
context=context):
|
||||
state_date_vals += '(state in (%s, %s, %s)) AND ('\
|
||||
'(effective_date IS NULL '\
|
||||
'AND ( planned_date >= %s or planned_date IS NULL)) '\
|
||||
@@ -174,9 +186,9 @@ class Product(OSV):
|
||||
'AND ( planned_date >= %s or planned_date IS NULL)) '\
|
||||
'OR effective_date >= %s'\
|
||||
')'
|
||||
today = date_obj.today(cursor, user, context=context)
|
||||
state_date_vals.extend(
|
||||
['done', 'assigned', 'draft',
|
||||
datetime.date.today(), datetime.date.today()])
|
||||
['done', 'assigned', 'draft', today, today])
|
||||
|
||||
state_date_clause = '(' + state_date_clause + \
|
||||
') OR (' + \
|
||||
@@ -189,8 +201,8 @@ class Product(OSV):
|
||||
')'
|
||||
state_date_vals.extend(
|
||||
['done', 'assigned', 'draft',
|
||||
context['stock_date_start'], datetime.date.today(),
|
||||
context['stock_date_start'], datetime.date.today()
|
||||
context['stock_date_start'], today,
|
||||
context['stock_date_start'], today,
|
||||
])
|
||||
|
||||
if with_childs:
|
||||
@@ -348,6 +360,7 @@ class Product(OSV):
|
||||
move_obj = self.pool.get('stock.move')
|
||||
product_obj = self.pool.get('product.product')
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
date_obj = self.pool.get('ir.date')
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -355,7 +368,8 @@ class Product(OSV):
|
||||
cursor.execute('LOCK TABLE stock_move')
|
||||
|
||||
local_ctx = context and context.copy() or {}
|
||||
local_ctx['stock_date_end'] = datetime.date.today()
|
||||
local_ctx['stock_date_end'] = date_obj.today(cursor, user,
|
||||
context=context)
|
||||
pbl = product_obj.products_by_location(cursor, user,
|
||||
location_ids=[m.from_location.id for m in moves],
|
||||
product_ids=[m.product.id for m in moves],
|
||||
@@ -425,7 +439,8 @@ class ChooseStockDateInit(WizardOSV):
|
||||
'* A date in the past will provide historical values.')
|
||||
|
||||
def default_forecast_date(self, cursor, user, context=None):
|
||||
return datetime.date.today()
|
||||
date_obj = self.pool.get('ir.date')
|
||||
return date_obj.today(cursor, user, context=context)
|
||||
|
||||
ChooseStockDateInit()
|
||||
|
||||
|
||||
+3
-2
@@ -46,15 +46,16 @@
|
||||
<field name="view" ref="location_quantity_view_tree"/>
|
||||
<field name="act_window" ref="act_location_quantity_tree"/>
|
||||
</record>
|
||||
<record model="ir.action.wizard" id="wizard_open_location">
|
||||
<record model="ir.action.wizard" id="wizard_location_open">
|
||||
<field name="name">Product by Location</field>
|
||||
<field name="wiz_name">stock.location.open</field>
|
||||
<field name="model">product.product</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword"
|
||||
id="act_location_quantity_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
<field name="model">product.product,0</field>
|
||||
<field name="action" ref="wizard_open_location"/>
|
||||
<field name="action" ref="wizard_location_open"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="product_stock_date_init_view_form">
|
||||
|
||||
Reference in new issue
Block a user