Skip to content

Commit

Permalink
Merge ec448e4 into 9fd6a2a
Browse files Browse the repository at this point in the history
  • Loading branch information
yvaucher committed Nov 10, 2014
2 parents 9fd6a2a + ec448e4 commit 7d20313
Show file tree
Hide file tree
Showing 6 changed files with 262 additions and 122 deletions.
16 changes: 9 additions & 7 deletions framework_agreement_sourcing/model/logistic_requisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ def _prepare_line_source(self, cr, uid, line,
:returns: dict to be used by Model.create
"""
res = {}
res['proposed_product_id'] = line.product_id.id
res['requisition_line_id'] = line.id
res['proposed_uom_id'] = line.requested_uom_id.id
res['unit_cost'] = 0.0
res['proposed_qty'] = qty
res['framework_agreement_id'] = False
res = {
'proposed_product_id': line.product_id.id,
'requisition_line_id': line.id,
'proposed_uom_id': line.requested_uom_id.id,
'unit_cost': 0.0,
'price_is': 'fixed',
'proposed_qty': qty,
'framework_agreement_id': False,
}
if agreement:
if not agreement.product_id.id == line.product_id.id:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion logistic_budget/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
#
{"name": "Logistics Budget",
"version": "0.1",
"version": "0.2",
"author": "Camptocamp",
"license": "AGPL-3",
"category": "Purchase Management",
Expand Down
6 changes: 3 additions & 3 deletions logistic_budget/view/logistic_requisition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<field name="inherit_id" ref="logistic_requisition.view_logistic_requisition_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@string='Requisition Lines']/field[@name='line_ids']/tree/field[@name='date_delivery']" position="after">
<field name="budget_unit_price"/>
<field name="budget_tot_price"/>
</xpath>
<xpath expr="//page[@string='Requisition Lines']/field[@name='line_ids']" position="after">
Expand All @@ -18,7 +17,8 @@
widget="monetary"
options="{'currency_field': 'currency_id'}"/>
</group>
<div class="oe_clear"/>
</xpath>
<xpath expr="//notebook" position="after">
<group string="Validation">
<div colspan="4">
<label for="budget_holder_id"/>
Expand Down Expand Up @@ -75,7 +75,7 @@
<field name="model">logistic.requisition.line</field>
<field name="inherit_id" ref="logistic_requisition.view_logistic_requisition_line_form"/>
<field name="arch" type="xml">
<xpath expr="//form[@string='Logistics Requisition Line']/sheet/group/group/field[@name='currency_id']" position="after">
<xpath expr="//form[@string='Logistics Requisition Line']//field[@name='date_delivery']/.." position="after">
<field name="budget_unit_price" widget="monetary"
options="{'currency_field': 'currency_id'}"/>
<field name="budget_tot_price" widget="monetary"
Expand Down
2 changes: 1 addition & 1 deletion logistic_requisition/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#

{"name": "Logistics Requisition",
"version": "1.0.1",
"version": "1.1",
"author": "Camptocamp",
"license": "AGPL-3",
"category": "Purchase Management",
Expand Down
51 changes: 39 additions & 12 deletions logistic_requisition/model/logistic_requisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,6 @@ class LogisticsRequisitionLine(models.Model):
readonly=True,
required=True,
ondelete='cascade')
# field for displaying requisition both on
# line form view and on requisition on inner line form view
display_requisition_id = fields.Many2one(
comodel_name='logistic.requisition',
string='Requisition',
compute='_get_display_requisition_id',
readonly=True)
source_ids = fields.One2many(
'logistic.requisition.source',
'requisition_line_id',
Expand Down Expand Up @@ -430,6 +423,37 @@ class LogisticsRequisitionLine(models.Model):
readonly=True,
copy=False)

# related fields to requisition_id
requestor_id = fields.Many2one(
related='requisition_id.partner_id',
co_model='res.partner',
string='Requestor')
consignee_id = fields.Many2one(
related='requisition_id.consignee_id',
co_model='res.partner',
string='Consignee')
consignee_shipping_id = fields.Many2one(
related='requisition_id.consignee_shipping_id',
co_model='res.partner',
string='Delivery Address')
incoterm_id = fields.Many2one(
related='requisition_id.incoterm_id',
co_model='stock.incoterms',
string='Incoterm',
help="International Commercial Terms are a series of "
"predefined commercial terms used in international "
"transactions.")
incoterm_address = fields.Char(
related='requisition_id.incoterm_address',
string='Incoterm Place',
help="Incoterm Place of Delivery. "
"International Commercial Terms are a series of "
"predefined commercial terms used in "
"international transactions.")

shipping_note = fields.Text(
related='requisition_id.shipping_note',
string='Delivery / Shipping Remarks')
_sql_constraints = [
('name_uniq',
'unique(name)',
Expand Down Expand Up @@ -735,7 +759,8 @@ def _default_source_address(self):
proposed_product_id = fields.Many2one(
'product.product',
string='Proposed Product',
states=SOURCED_STATES)
states=SOURCED_STATES,
required=True)
proposed_uom_id = fields.Many2one(
'product.uom',
string='Proposed UoM',
Expand All @@ -746,7 +771,7 @@ def _default_source_address(self):
digits_compute=dp.get_precision('Product UoM'),
default=1)
procurement_method = fields.Selection(
[('procurement', 'Procurement'),
[('procurement', 'Tender'),
('wh_dispatch', 'Warehouse Dispatch'),
('fw_agreement', 'Framework Agreement'),
('other', 'Other'),
Expand Down Expand Up @@ -778,8 +803,7 @@ def _default_source_address(self):
string='Price is',
required=True,
help="When the price is an estimation, the final price may change."
" I.e. it is not based on a request for quotation.",
default='fixed')
" I.e. it is not based on a request for quotation.")
#
purchase_requisition_line_id = fields.Many2one(
'purchase.requisition.line',
Expand Down Expand Up @@ -835,6 +859,9 @@ def _default_source_address(self):
string='Default source',
readonly=True)

# Procument Method = Other field
origin = fields.Char("Origin")

_constraints = [
(lambda self, cr, uid, ids: self._check_purchase_requisition_unique(
cr, uid, ids),
Expand All @@ -856,7 +883,7 @@ def _is_sourced_procurement(self, source):
def _is_sourced_other(self, source):
"""Predicate function to test if line on other
method are sourced"""
return self._is_sourced_procurement(source)
return True

@api.model
def _is_sourced_wh_dispatch(self, source):
Expand Down
Loading

0 comments on commit 7d20313

Please sign in to comment.