Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] base_edifact: improve method map2odoo_product to take pia segment into account #990

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions base_edifact/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Contributors
* Rafa Morant <[email protected]> (www.albasoft.com)
* Marc Poch <[email protected]>
* Duong (Tran Quoc) <[email protected]>
* Tris Doan <[email protected]>

Maintainers
~~~~~~~~~~~
Expand Down
11 changes: 6 additions & 5 deletions base_edifact/models/edifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,15 @@ def map2odoo_product(self, seg, pia=None):
['5', ['1276', 'SA', '', '9']]
SA. Supplier's Article Number
"""
res = {}
# Set default code based on SA if given
if pia is not None and pia[1][0]:
res["code"] = pia[1][0]
code = seg[2][0] if len(list(seg)) > 2 else False
if code:
field = "code" if seg[2][1] == "SRV" else "barcode"
return {field: code}
# Fallback on SA if no EAN given
if pia is not None and pia[1][0]:
return {"code": pia[1][0]}
return {}
res[field] = code
return res

@api.model
def map2odoo_qty(self, seg):
Expand Down
1 change: 1 addition & 0 deletions base_edifact/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Rafa Morant <[email protected]> (www.albasoft.com)
* Marc Poch <[email protected]>
* Duong (Tran Quoc) <[email protected]>
* Tris Doan <[email protected]>
12 changes: 8 additions & 4 deletions base_edifact/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -448,12 +449,15 @@ <h2><a class="toc-backref" href="#toc-entry-9">Contributors</a></h2>
<li>Rafa Morant &lt;<a class="reference external" href="mailto:rmorant&#64;albasoft.com">rmorant&#64;albasoft.com</a>&gt; (www.albasoft.com)</li>
<li>Marc Poch &lt;<a class="reference external" href="mailto:mpoch&#64;planetatic.com">mpoch&#64;planetatic.com</a>&gt;</li>
<li>Duong (Tran Quoc) &lt;<a class="reference external" href="mailto:duongtq&#64;trobz.com">duongtq&#64;trobz.com</a>&gt;</li>
<li>Tris Doan &lt;<a class="reference external" href="mailto:tridm&#64;trobz.com">tridm&#64;trobz.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
Expand Down
Loading