Commit Graph
192 Commits
Author SHA1 Message Date
Cédric Krier cca1c4a02d Don't override cost_price if it is zero
Only override the cost_price if it was not set which means if it is None.

issue5034
review18701002
2015-10-15 00:57:30 +02:00
Sergi Almacellas Abellana f6cc35f698 Fix average cost price when product quantity is negative
issue5038
review15721002
2015-10-14 15:45:21 +02:00
Nicolas Évrard e97f7eb78f Add buttons on stock move form & list
issue3945
review8991002
2015-09-26 21:19:37 +02:00
Cédric Krier 8507f1660f Allow to use view location on staging and draft moves
issue4912
review24321002
2015-09-22 23:00:48 +02:00
Cédric Krier a2da70ea13 Use new PYSON syntax
issue2205
review16391002
2015-06-28 23:45:31 +02:00
Cédric Krier f20586adcd Use Constraint instance in ModelSQL._sql_constraints
issue4814
review15491002
2015-06-22 17:00:00 +02:00
Cédric Krier 8a5de745c4 Pass explicit move to get_key in Move.assign_try
issue4811
review8161002
2015-06-15 01:21:31 +02:00
Cédric Krier 20dfc22151 Use new Rule.query_get
issue4800
review7211003
2015-06-15 01:16:21 +02:00
Cédric Krier b677e166ca Allow to re-compute cost price
and to change unit price of move done

issue4729
review12131002
2015-06-15 00:58:00 +02:00
Cédric Krier 6b8ce20a28 Fail assign_try if the remaining quantity is the rounding precision
issue4609
2015-03-09 20:44:21 +01:00
Cédric Krier 08ebed3b28 Round written quantity in assign_try
issue4609
review13051002
2015-03-09 19:36:31 +01:00
Cédric Krier a0e23f6faa Remove AS in GROUP BY of compute quantity query
It is not allowed to use alias output in the GROUP BY clause.

issue4495
review11811002
2015-01-27 22:59:44 +01:00
Cédric Krier 0a4c95ee08 staging move state should fail assignation
issue4462
review13871002
2015-01-09 19:06:36 +01:00
Cédric Krier 1014cf5400 Use price_digits
issue4438
review6791002
2015-01-06 23:31:09 +01:00
Cédric Krier bb7b385146 Add 'staging' state to stock move
issue4362
review5811002
2015-01-02 15:40:11 +01:00
Cédric Krier 88053c26bd Apply stock_assign of compute_quantity_query only on outgoing moves
It is too much optimistic to compute incoming assigned moves as done.

issue4384
review10681002
2014-12-11 22:18:32 +01:00
Cédric Krier 994bd8a103 Fix most flake8 errors
review8771002
2014-12-02 12:56:04 +01:00
Robin Baumgartner 486006e8ff Use Null constant from python-sql for comparisons
issue4143
review13701003
2014-11-24 14:03:52 +01:00
Cédric Krier 5b4b6b1558 New API for on_change
issue4203
review8581002
2014-10-29 20:40:25 +01:00
Nicolas Évrard 00505350c5 Do not filter out inactive products from stock computation
issue4240
review12621002
2014-10-24 17:28:53 +02:00
Cédric Krier abc4bd5a96 Use context to check model and field access
issue4081
review8481002
2014-09-17 21:45:58 +02:00
Cédric Krier 47a2190ede Compute cost price one move at a time
As _update_product_cost_price uses product quantity, this quantity must be
recomputed after each move in case some are for the same products.

issue4039
review11421002
2014-08-29 16:23:10 +02:00
Cédric Krier f04e44c681 The cancellation of move should not compute cost price
because such move can not be done (prevented by _deny_modify_done_cancel).

issue4107
review11421002
2014-08-29 16:21:21 +02:00
Cédric Krier a468a9b995 Fix compute_quantities_query when stock.move has no domain rule
move_rule_query is used with a IN clause so it doesn't work with literal True.
So in case of move_rule_query is empty, the clause should simply be the literal
without IN clause.

issue3999
review11341002
2014-07-09 00:13:47 +02:00
Cédric Krier 634913f549 Add warning for external move without origin
issue3677
review3521002
2014-03-10 20:16:00 +01:00
Cédric Krier ba81d4bbf0 Fix comment in Mixin, location_ids can be empty 2014-02-06 19:38:25 +01:00
Sergi Almacellas Abellana 0fd9f7ebc7 Allow to define the effective date of shipments
issue3579
review2651002
2014-01-30 19:19:49 +01:00
Cédric Krier 634b9ab416 Use fields.depends decorator
issue3487
review2301002
2014-01-26 14:29:37 +01:00
Cédric Krier 0ba33d88a2 Use a sequence of records, values in write
issue3499
review1641003
2013-12-19 14:45:31 +01:00
Guillem Barba 38ab876749 New methods on stock.move to compute quantities more modular
* Split products_by_location into two methods on Move:
  compute_quantities_query and compute_quantities
* Use new methods to compute quantities in StockMixin._search_quantity()

issue3201
review971002
2013-12-17 16:22:36 +01:00
Cédric Krier 2b78c34768 Use origin for inventory move
By using the origin, it is possible to create all the move with one create
call.

issue3512
review1811002
2013-11-28 23:21:45 +01:00
Cédric Krier 35a8bc1141 Allow partial assignation on Supplier Shipment Return
issue3492
review1681002
2013-11-25 12:27:06 +01:00
Cédric Krier 1d6e99e7b7 Fix usage of context company
Default value of company should be -1 to get the right cast and an impossible
value.
Replace False by None as other value in "in" clause.

issue3394
review1119002
2013-10-09 18:25:53 +02:00
Cédric Krier 68eb13ed88 Fix flake8 2013-10-05 12:17:26 +02:00
Cédric Krier 4f5c6a4727 Fix infinite loop when setting internal_quantity
There could be difference for Float field between the written value and the
read one. This could lead to an infinite loop of write calls, so we also test
that it is not already writing the same internal value.

issue3332
review1109002
2013-10-03 21:18:46 +02:00
Guillem Barba c74473ecfe Fix domain concatenation between list and tuple
issue3386
review1099002
2013-09-30 17:44:19 +02:00
Nicolas Évrard 20cb5a0791 Replace reference copying by relate
review932002
2013-09-19 17:34:23 +02:00
Guillem Barba fe08fb891e Remove incorrect staticmethod declaration 2013-09-12 18:12:31 +02:00
Guillem Barba 0096fed655 Add Mixin class with helper to setup stock quantity fields
Add StockMixin class in move.py file with helper functions to be used in getter
and searcher methods of quantity fields.
Reimplemented getter and searcher of quantity/forecast_quantity fields of
Product to use these helper functions.
Add test over product's quantity fields.

issue3279
review963003
2013-09-09 14:11:53 +02:00
Cédric Krier 4f833ee812 Migration to python-sql
review1001002
2013-09-06 22:34:48 +02:00
Nicolas Évrard 9c4fac4db7 Reenact check_period_closed on creation (removed by changeset a4feb97fdf49)
review1041004
2013-08-29 13:24:49 +02:00
Nicolas Évrard 8965437cf8 Do not check for closed period when writing on anglo_saxon_quantity
review928002
2013-08-28 18:23:45 +02:00
Cédric Krier 4e657bfcf1 merge 2013-06-25 19:18:28 +02:00
Cédric Krier 77c5845141 Extend Lot Management
Allow to customize move creation of Inventory
Allow to customize unique constraint on Inventory
Allow specific grouping Period Cache
Add grouping on products_by_location and assign_try

review845002
2013-06-21 23:24:17 +02:00
Giedrius Slavinskas 0931f3d391 Factorize field checks on StockMove write method
review891002
2013-06-05 10:45:18 +03:00
Albert Cervera i Areny f594f23e27 Add missing space in error message.
review751002
2013-04-29 11:24:46 +02:00
Cédric Krier 4cc0484027 Unit price should also be required for move to supplier
review791002
2013-04-16 15:30:21 +02:00
Cédric Krier c7326c55fb Use reference fields
Merge all shipment Many2One into shipment Reference
Add origin Reference on Stock Move

issue2642
review717002
2013-03-23 15:42:36 +01:00
Cédric Krier 65cfc60c14 Remove _inherits
review670002
2013-03-20 22:51:12 +01:00
Albert Cervera i Areny e1540c219a Replace _constraints with validate in ModelStorage and improve user messages.
issue2616
review371002
2013-03-07 16:56:01 +01:00