Merge lp:~openerp-dev/openobject-addons/6.1-opw-579043-ado into lp:openobject-addons/6.1
- 6.1-opw-579043-ado
- Merge into 6.1
Status: | Approved |
---|---|
Approved by: | Naresh(OpenERP) |
Approved revision: | no longer in the source branch. |
Proposed branch: | lp:~openerp-dev/openobject-addons/6.1-opw-579043-ado |
Merge into: | lp:openobject-addons/6.1 |
Diff against target: |
142 lines (+91/-14) 1 file modified
mrp_subproduct/mrp_subproduct.py (+91/-14) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-579043-ado |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Naresh(OpenERP) | Pending | ||
Review via email: mp+125672@code.launchpad.net |
Commit message
Description of the change
Hello,
[FIX] mrp_subproduct doesnt pull sub products from bill of material when we have type phantom"
Issue :
After adding a suproduct line in Bill of matirial of type=Phantom we hope to see the material asigned in sub product of phantom bill of material when confirming the production order with the parent bill of material that the mrp_subproduct fills in finished product, but it doesn't do it.
Steps:
Check this video : http://
Regards,
Amit Dodiya
- 6999. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7000. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7001. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7002. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7003. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7004. By Olivier Dony (Odoo)
-
[FIX] OPW 574637: account_
analytic_ plans: remove the strange behavior of instance editing - a thing of the past - 7005. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7006. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7007. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7008. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7009. By Xavier ALT
-
[MERGE] OPW 50562: stock: fix picking type for chained picking
forward port of v6.0 revid: <email address hidden>
- 7010. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7011. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7012. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7013. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7014. By Olivier Dony (Odoo)
-
[MERGE] OPW 579232: mrp: better handle partial consumption of raw products that were split in production lots
- System will no longer consume every line of raw product after a split
- If a raw product line with the exact quantity to consume is present,
only this one will be consumed
- If no raw product line matches the quantity to consume, the system
will consume the available lines (starting with smallest quantities first)
until it attains the required quantity, possibly splitting one line
further if no combination of the existing lines gives the right
quantity.
- The production lot column and the split button will now be available
on both sides of the production order form, allowing fine control
of the production lots that were consumed, in case the defaults
do not match what was used in reality. - 7015. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7016. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7017. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7018. By Xavier ALT
-
[MERGE] OPW 577045: translations: collective fix of missing translation terms in reports
- 7019. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7020. By Xavier ALT
-
[MERGE] OPW 575716: account: force account.
financial. report balance of *zero* to be displayed positively - 7021. By Xavier ALT
-
[MERGE] OPW 579553: account: fix traceback when modifing existing journal entry line
- 7022. By Xavier ALT
-
[MERGE] OPW 576019: sale/purchase: when changing SO or PO line product, use product's UoM even if current UoM is of the same category
- 7023. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7024. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7025. By Stephane Wirtel (OpenERP)
-
[FIX] point_of_sale: remove unused file
- 7026. By Xavier ALT
-
[MERGE] OPW 578622: project: duplicating project must reset analytic account code
- 7027. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7028. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7029. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7030. By Olivier Dony (Odoo)
-
[FIX] wiki: remove unused 6.0 web addon components - web API was rewritten from scratch in 6.1
- 7031. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7032. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7033. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7034. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7035. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7036. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7037. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7038. By Xavier ALT
-
[MERGE] OPW 577723: purchase: add domain on purchase order partner field for autocomplete to search only for suppliers
- 7039. By Xavier ALT
-
[MERGE] OPW 577045: account/
hr_holidays: fix untranslated string and 'Filter By' display on account reports - 7040. By Xavier ALT
-
[MERGE] OPW 576804: hr_holidays: fix problem with accentuated chars in 'Leaves by Department' report
- 7041. By Xavier ALT
-
[MERGE] OPW 579990: account: changing invoice line account should take product taxes or account taxes, not both
backport of trunk addons revid: <email address hidden>
- 7042. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7043. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7044. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7045. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7046. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7047. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7048. By Xavier ALT
-
[MERGE] OPW 579331: base_vat: button check_vat should not return 'None' uppon success - this will cause error for clients using XML-RPC
- 7049. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7050. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7051. By Xavier ALT
-
[MERGE] OPW 578792: project_
issue/resource: fix calc. of open/close & working hours to open/close on issue + has to be timezone aware - 7052. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7053. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7054. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7055. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7056. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7057. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7058. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7059. By Olivier Dony (Odoo)
-
[FIX] project_issue: fix access rights error when using portal access
Due to the recent change in the computation of the closing duration
for project issues[1], viewing issues now fails for users who do not
have read access to project.project. This is typically the case for
portal users, who can view their own issues but not the project details.
Doing the computation in superuser mode does not cause any security
problem and avoids the access rights error. - 7060. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7061. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7062. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7063. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7064. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7065. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7066. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7067. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7068. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7069. By Xavier ALT
-
[MERGE] OPW 576829: pos: fix creation of payment line when pos order have multiple payment methods + return
partial trunk backport revid: <email address hidden>,
<email address hidden> - 7070. By Xavier ALT
-
[MERGE] OPW 576495: stock: fix missing 'state' field in view - required for button states evaluation
- 7071. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7072. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7073. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7074. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7075. By Antony Lesuisse (OpenERP)
-
[FIX] crm.lead add missing group_by country
- 7076. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7077. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7078. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7079. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7080. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7081. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7082. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7083. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7084. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7085. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7086. By Xavier ALT
-
[MERGE] OPW 581296: account_voucher: allow reconciling invoices with partially reconciled credit notes
- 7087. By Xavier ALT
-
[MERGE] OPW 577037: account_voucher: 'import entries' wizard should allow selecting credit notes
cumulative forward-port of v6.0 revids:
- <email address hidden>
- <email address hidden>
- <email address hidden> - 7088. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7089. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7090. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7091. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7092. By Xavier ALT
-
[MERGE] 577037: account_voucher: also allow matching payment line with bank, cash journal for existing 'advanced payment'
- 7093. By Xavier ALT
-
[FIX] account_voucher: make sure we do not match move lines that are totally used within partial payment
- 7094. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7095. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7096. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7097. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
- 7098. By Launchpad Translations on behalf of openerp
-
Launchpad automatic translations update.
Naresh(OpenERP) (nch-openerp) wrote : | # |
Hello,
This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad https:/
Thanks,
Naresh Soni
- 7099. By Amit Dodiya<email address hidden>
-
[FIX] mrp_subproduct doesnt pull sub products from bill of material when we have type phantom
Unmerged revisions
- 7099. By Amit Dodiya<email address hidden>
-
[FIX] mrp_subproduct doesnt pull sub products from bill of material when we have type phantom
Preview Diff
1 | === modified file 'mrp_subproduct/mrp_subproduct.py' | |||
2 | --- mrp_subproduct/mrp_subproduct.py 2012-02-14 15:57:46 +0000 | |||
3 | +++ mrp_subproduct/mrp_subproduct.py 2012-12-10 08:57:21 +0000 | |||
4 | @@ -22,6 +22,7 @@ | |||
5 | 22 | from osv import fields | 22 | from osv import fields |
6 | 23 | from osv import osv | 23 | from osv import osv |
7 | 24 | import decimal_precision as dp | 24 | import decimal_precision as dp |
8 | 25 | import tools | ||
9 | 25 | 26 | ||
10 | 26 | class mrp_subproduct(osv.osv): | 27 | class mrp_subproduct(osv.osv): |
11 | 27 | _name = 'mrp.subproduct' | 28 | _name = 'mrp.subproduct' |
12 | @@ -61,6 +62,79 @@ | |||
13 | 61 | _columns={ | 62 | _columns={ |
14 | 62 | 'sub_products':fields.one2many('mrp.subproduct', 'bom_id', 'sub_products'), | 63 | 'sub_products':fields.one2many('mrp.subproduct', 'bom_id', 'sub_products'), |
15 | 63 | } | 64 | } |
16 | 65 | |||
17 | 66 | def _bom_explode(self, cr, uid, bom, factor, properties=[], addthis=False, level=0, routing_id=False, result_subproducts=False): | ||
18 | 67 | """ Finds sub products and work centers for related bom lines which has several sub products defined in it. | ||
19 | 68 | @param bom: BoM of particular product. | ||
20 | 69 | @param factor: Factor of product UoM. | ||
21 | 70 | @param properties: A List of properties Ids. | ||
22 | 71 | @param addthis: If BoM found then True else False. | ||
23 | 72 | @param level: Depth level to find BoM lines starts from 10. | ||
24 | 73 | @return: result: List of dictionaries containing product details. | ||
25 | 74 | result2: List of dictionaries containing Work Center details. | ||
26 | 75 | """ | ||
27 | 76 | if result_subproducts is False: | ||
28 | 77 | result_subproducts = [] | ||
29 | 78 | if self._columns.has_key('sub_products'):#if module mrp_subproduct is installed | ||
30 | 79 | for sub_product in bom.sub_products: | ||
31 | 80 | qty1 = sub_product.product_qty | ||
32 | 81 | if sub_product.subproduct_type == 'variable': | ||
33 | 82 | qty1 = factor*qty1/bom.product_uom.factor_inv | ||
34 | 83 | result_subproducts.append({ | ||
35 | 84 | 'product_id': sub_product.product_id.id, | ||
36 | 85 | 'product_qty': qty1, | ||
37 | 86 | 'product_uom': sub_product.product_uom.id, | ||
38 | 87 | }) | ||
39 | 88 | routing_obj = self.pool.get('mrp.routing') | ||
40 | 89 | factor = factor / (bom.product_efficiency or 1.0) | ||
41 | 90 | factor = rounding(factor, bom.product_rounding) | ||
42 | 91 | if factor < bom.product_rounding: | ||
43 | 92 | factor = bom.product_rounding | ||
44 | 93 | result = [] | ||
45 | 94 | result2 = [] | ||
46 | 95 | phantom = False | ||
47 | 96 | if bom.type == 'phantom' and not bom.bom_lines: | ||
48 | 97 | newbom = self._bom_find(cr, uid, bom.product_id.id, bom.product_uom.id, properties) | ||
49 | 98 | |||
50 | 99 | if newbom: | ||
51 | 100 | newbom_pool = self.browse(cr, uid, newbom) | ||
52 | 101 | res = self._bom_explode(cr, uid, self.browse(cr, uid, [newbom])[0], factor*bom.product_qty/(newbom_pool.product_qty*newbom_pool.product_uom.factor_inv), properties, addthis=True, level=level+10, result_subproducts=result_subproducts) | ||
53 | 102 | result = result + res[0] | ||
54 | 103 | result2 = result2 + res[1] | ||
55 | 104 | phantom = True | ||
56 | 105 | else: | ||
57 | 106 | phantom = False | ||
58 | 107 | if not phantom: | ||
59 | 108 | if addthis and not bom.bom_lines: | ||
60 | 109 | result.append( | ||
61 | 110 | { | ||
62 | 111 | 'name': bom.product_id.name, | ||
63 | 112 | 'product_id': bom.product_id.id, | ||
64 | 113 | 'product_qty': bom.product_qty * factor, | ||
65 | 114 | 'product_uom': bom.product_uom.id, | ||
66 | 115 | 'product_uos_qty': bom.product_uos and bom.product_uos_qty * factor or False, | ||
67 | 116 | 'product_uos': bom.product_uos and bom.product_uos.id or False, | ||
68 | 117 | }) | ||
69 | 118 | routing = (routing_id and routing_obj.browse(cr, uid, routing_id)) or bom.routing_id or False | ||
70 | 119 | if routing: | ||
71 | 120 | for wc_use in routing.workcenter_lines: | ||
72 | 121 | wc = wc_use.workcenter_id | ||
73 | 122 | d, m = divmod(factor, wc_use.workcenter_id.capacity_per_cycle) | ||
74 | 123 | mult = (d + (m and 1.0 or 0.0)) | ||
75 | 124 | cycle = mult * wc_use.cycle_nbr | ||
76 | 125 | result2.append({ | ||
77 | 126 | 'name': tools.ustr(wc_use.name) + ' - ' + tools.ustr(bom.product_id.name), | ||
78 | 127 | 'workcenter_id': wc.id, | ||
79 | 128 | 'sequence': level+(wc_use.sequence or 0), | ||
80 | 129 | 'cycle': cycle, | ||
81 | 130 | 'hour': float(wc_use.hour_nbr*mult + ((wc.time_start or 0.0)+(wc.time_stop or 0.0)+cycle*(wc.time_cycle or 0.0)) * (wc.time_efficiency or 1.0)), | ||
82 | 131 | }) | ||
83 | 132 | for bom2 in bom.bom_lines: | ||
84 | 133 | res = self._bom_explode(cr, uid, bom2, factor, properties, addthis=True, level=level+10, result_subproducts=result_subproducts) | ||
85 | 134 | result = result + res[0] | ||
86 | 135 | result2 = result2 + res[1] | ||
87 | 136 | return result, result2 | ||
88 | 137 | |||
89 | 64 | 138 | ||
90 | 65 | mrp_bom() | 139 | mrp_bom() |
91 | 66 | 140 | ||
92 | @@ -73,27 +147,24 @@ | |||
93 | 73 | """ Confirms production order and calculates quantity based on subproduct_type. | 147 | """ Confirms production order and calculates quantity based on subproduct_type. |
94 | 74 | @return: Newly generated picking Id. | 148 | @return: Newly generated picking Id. |
95 | 75 | """ | 149 | """ |
96 | 150 | bom_obj = self.pool.get('mrp.bom') | ||
97 | 151 | uom_obj = self.pool.get('product.uom') | ||
98 | 76 | picking_id = super(mrp_production,self).action_confirm(cr, uid, ids) | 152 | picking_id = super(mrp_production,self).action_confirm(cr, uid, ids) |
99 | 77 | for production in self.browse(cr, uid, ids): | 153 | for production in self.browse(cr, uid, ids): |
100 | 78 | source = production.product_id.product_tmpl_id.property_stock_production.id | 154 | source = production.product_id.product_tmpl_id.property_stock_production.id |
102 | 79 | if not production.bom_id: | 155 | bom_id = production.bom_id |
103 | 156 | if not bom_id: | ||
104 | 80 | continue | 157 | continue |
113 | 81 | for sub_product in production.bom_id.sub_products: | 158 | factor = uom_obj._compute_qty(cr, uid, production.product_uom.id, production.product_qty, bom_id.product_uom.id) |
114 | 82 | qty1 = sub_product.product_qty | 159 | result_subproducts =[] |
115 | 83 | qty2 = production.product_uos and production.product_uos_qty or False | 160 | res = bom_obj._bom_explode(cr, uid, bom_id, factor / bom_id.product_qty, properties=False, routing_id=False, result_subproducts=result_subproducts) |
116 | 84 | if sub_product.subproduct_type == 'variable': | 161 | for sub_product in result_subproducts: |
109 | 85 | if production.product_qty: | ||
110 | 86 | qty1 *= production.product_qty / (production.bom_id.product_qty or 1.0) | ||
111 | 87 | if production.product_uos_qty: | ||
112 | 88 | qty2 *= production.product_uos_qty / (production.bom_id.product_uos_qty or 1.0) | ||
117 | 89 | data = { | 162 | data = { |
118 | 90 | 'name': 'PROD:'+production.name, | 163 | 'name': 'PROD:'+production.name, |
119 | 91 | 'date': production.date_planned, | 164 | 'date': production.date_planned, |
125 | 92 | 'product_id': sub_product.product_id.id, | 165 | 'product_id': sub_product['product_id'], |
126 | 93 | 'product_qty': qty1, | 166 | 'product_qty': sub_product['product_qty'], |
127 | 94 | 'product_uom': sub_product.product_uom.id, | 167 | 'product_uom': sub_product['product_uom'], |
123 | 95 | 'product_uos_qty': qty2, | ||
124 | 96 | 'product_uos': production.product_uos and production.product_uos.id or False, | ||
128 | 97 | 'location_id': source, | 168 | 'location_id': source, |
129 | 98 | 'location_dest_id': production.location_dest_id.id, | 169 | 'location_dest_id': production.location_dest_id.id, |
130 | 99 | 'move_dest_id': production.move_prod_id.id, | 170 | 'move_dest_id': production.move_prod_id.id, |
131 | @@ -127,6 +198,12 @@ | |||
132 | 127 | 198 | ||
133 | 128 | mrp_production() | 199 | mrp_production() |
134 | 129 | 200 | ||
135 | 201 | def rounding(f, r): | ||
136 | 202 | import math | ||
137 | 203 | if not r: | ||
138 | 204 | return f | ||
139 | 205 | return math.ceil(f / r) * r | ||
140 | 206 | |||
141 | 130 | class change_production_qty(osv.osv_memory): | 207 | class change_production_qty(osv.osv_memory): |
142 | 131 | _inherit = 'change.production.qty' | 208 | _inherit = 'change.production.qty' |
143 | 132 | 209 |
it seems big changes to incorporate in stable !